2022-01-10 23:37:21 +01:00
|
|
|
|
#include "MqttClient.h"
|
|
|
|
|
|
|
|
|
|
|
|
void mqttInit() {
|
|
|
|
|
|
mqtt.setCallback(mqttCallback);
|
|
|
|
|
|
ts.add(
|
|
|
|
|
|
WIFI_MQTT_CONNECTION_CHECK, MQTT_RECONNECT_INTERVAL,
|
|
|
|
|
|
[&](void*) {
|
|
|
|
|
|
if (WiFi.status() == WL_CONNECTED) {
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("WIFI"), F("OK"));
|
2022-01-10 23:37:21 +01:00
|
|
|
|
if (mqtt.connected()) {
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), "OK");
|
2022-02-12 14:34:17 +01:00
|
|
|
|
handleMqttStatus(false);
|
2022-02-12 03:09:57 +01:00
|
|
|
|
|
|
|
|
|
|
static unsigned int prevMillis;
|
|
|
|
|
|
mqttUptime = mqttUptime + (millis() - prevMillis);
|
|
|
|
|
|
prevMillis = millis();
|
2022-02-12 14:34:17 +01:00
|
|
|
|
|
2022-01-10 23:37:21 +01:00
|
|
|
|
// setLedStatus(LED_OFF);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
SerialPrint("E", F("MQTT"), F("✖ Connection lost"));
|
2022-02-12 14:34:17 +01:00
|
|
|
|
handleMqttStatus(false);
|
2022-02-12 03:09:57 +01:00
|
|
|
|
mqttUptime = 0;
|
2022-01-10 23:37:21 +01:00
|
|
|
|
mqttConnect();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
SerialPrint("E", F("WIFI"), F("✖ Lost WiFi connection"));
|
|
|
|
|
|
ts.remove(WIFI_MQTT_CONNECTION_CHECK);
|
|
|
|
|
|
startAPMode();
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
nullptr, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void mqttLoop() {
|
|
|
|
|
|
if (!isNetworkActive() || !mqtt.connected()) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mqtt.loop();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean mqttConnect() {
|
2022-02-11 00:22:59 +01:00
|
|
|
|
getMqttData();
|
2022-01-10 23:37:21 +01:00
|
|
|
|
bool res = false;
|
|
|
|
|
|
if (mqttServer == "") {
|
|
|
|
|
|
SerialPrint("E", "MQTT", F("mqttServer empty"));
|
2022-02-12 14:34:17 +01:00
|
|
|
|
|
|
|
|
|
|
handleMqttStatus(true, 6);
|
|
|
|
|
|
|
2022-01-10 23:37:21 +01:00
|
|
|
|
return res;
|
|
|
|
|
|
}
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", "MQTT", "connection started");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", "MQTT", "broker " + mqttServer + ":" + String(mqttPort, DEC));
|
|
|
|
|
|
SerialPrint("i", "MQTT", "topic " + mqttRootDevice);
|
2022-02-11 00:22:59 +01:00
|
|
|
|
|
2022-01-10 23:37:21 +01:00
|
|
|
|
// setLedStatus(LED_FAST);
|
2022-02-11 00:22:59 +01:00
|
|
|
|
|
2022-01-10 23:37:21 +01:00
|
|
|
|
mqtt.setServer(mqttServer.c_str(), mqttPort);
|
|
|
|
|
|
|
|
|
|
|
|
if (!mqtt.connected()) {
|
|
|
|
|
|
bool connected = false;
|
|
|
|
|
|
if (mqttUser != "" && mqttPass != "") {
|
|
|
|
|
|
connected = mqtt.connect(chipId.c_str(), mqttUser.c_str(), mqttPass.c_str());
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), F("Go to connection with login and password"));
|
2022-01-10 23:37:21 +01:00
|
|
|
|
} else if (mqttUser == "" && mqttPass == "") {
|
|
|
|
|
|
connected = mqtt.connect(chipId.c_str());
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), F("Go to connection without login and password"));
|
2022-01-10 23:37:21 +01:00
|
|
|
|
} else {
|
2022-02-11 00:22:59 +01:00
|
|
|
|
SerialPrint("E", F("MQTT"), F("✖ Login or password missed"));
|
2022-02-12 14:34:17 +01:00
|
|
|
|
handleMqttStatus(true, 7);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
return res;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-12 14:34:17 +01:00
|
|
|
|
if (mqtt.state() == 0) {
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), F("✔ connected"));
|
2022-02-12 14:34:17 +01:00
|
|
|
|
handleMqttStatus(true);
|
|
|
|
|
|
// setLedStatus(LED_OFF);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
mqttSubscribe();
|
|
|
|
|
|
res = true;
|
|
|
|
|
|
} else {
|
2022-02-11 00:22:59 +01:00
|
|
|
|
SerialPrint("E", F("MQTT"), "🡆 Could't connect, retry in " + String(MQTT_RECONNECT_INTERVAL / 1000) + "s");
|
2022-02-12 14:34:17 +01:00
|
|
|
|
handleMqttStatus(true);
|
|
|
|
|
|
// setLedStatus(LED_FAST);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return res;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-11 00:22:59 +01:00
|
|
|
|
void mqttDisconnect() {
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), F("disconnected"));
|
2022-02-11 00:22:59 +01:00
|
|
|
|
mqtt.disconnect();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void mqttReconnect() {
|
|
|
|
|
|
mqttDisconnect();
|
|
|
|
|
|
mqttConnect();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void getMqttData() {
|
|
|
|
|
|
mqttServer = jsonReadStr(settingsFlashJson, F("mqttServer"));
|
|
|
|
|
|
mqttPort = jsonReadInt(settingsFlashJson, F("mqttPort"));
|
|
|
|
|
|
mqttUser = jsonReadStr(settingsFlashJson, F("mqttUser"));
|
|
|
|
|
|
mqttPass = jsonReadStr(settingsFlashJson, F("mqttPass"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void mqttSubscribe() {
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), F("subscribed"));
|
|
|
|
|
|
SerialPrint("i", F("MQTT"), mqttRootDevice);
|
2022-02-11 00:22:59 +01:00
|
|
|
|
mqtt.subscribe(mqttPrefix.c_str());
|
|
|
|
|
|
mqtt.subscribe((mqttRootDevice + "/+/control").c_str());
|
|
|
|
|
|
mqtt.subscribe((mqttRootDevice + "/update").c_str());
|
|
|
|
|
|
|
|
|
|
|
|
if (jsonReadBool(settingsFlashJson, "MqttIn")) {
|
|
|
|
|
|
mqtt.subscribe((mqttPrefix + "/+/+/event").c_str());
|
|
|
|
|
|
mqtt.subscribe((mqttPrefix + "/+/+/order").c_str());
|
|
|
|
|
|
mqtt.subscribe((mqttPrefix + "/+/+/info").c_str());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-01-10 23:37:21 +01:00
|
|
|
|
void mqttCallback(char* topic, uint8_t* payload, size_t length) {
|
|
|
|
|
|
String topicStr = String(topic);
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", "=>MQTT", topicStr);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
String payloadStr;
|
|
|
|
|
|
payloadStr.reserve(length + 1);
|
|
|
|
|
|
for (size_t i = 0; i < length; i++) {
|
|
|
|
|
|
payloadStr += (char)payload[i];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", "=>MQTT", payloadStr);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
|
|
|
|
|
|
if (payloadStr.startsWith("HELLO")) {
|
2022-02-16 00:53:52 +01:00
|
|
|
|
SerialPrint("i", F("MQTT"), F("Full update"));
|
2022-01-10 23:37:21 +01:00
|
|
|
|
publishWidgets();
|
|
|
|
|
|
publishState();
|
|
|
|
|
|
#ifdef GATE_MODE
|
|
|
|
|
|
publishTimes();
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef EnableLogging
|
|
|
|
|
|
choose_log_date_and_send();
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// else if (topicStr.indexOf("control") != -1) {
|
|
|
|
|
|
// String key = selectFromMarkerToMarker(topicStr, "/", 3);
|
|
|
|
|
|
//
|
|
|
|
|
|
// String order;
|
|
|
|
|
|
// order += key;
|
|
|
|
|
|
// order += " ";
|
|
|
|
|
|
// order += payloadStr;
|
|
|
|
|
|
// order += ",";
|
|
|
|
|
|
//
|
|
|
|
|
|
// loopCmdAdd(order);
|
|
|
|
|
|
//
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", F("=>MQTT"), "Msg from iotmanager app: " + key + " " + payloadStr);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
//}
|
|
|
|
|
|
//
|
|
|
|
|
|
// else if (topicStr.indexOf("event") != -1) {
|
|
|
|
|
|
// if (!jsonReadBool(settingsFlashJson, "MqttIn")) {
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (topicStr.indexOf(chipId) == -1) {
|
|
|
|
|
|
// String devId = selectFromMarkerToMarker(topicStr, "/", 2);
|
|
|
|
|
|
// String key = selectFromMarkerToMarker(topicStr, "/", 3);
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", F("=>MQTT"), "Received event from other device: '" + devId + "' " + key + " " + payloadStr);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
// String event = key + " " + payloadStr + ",";
|
|
|
|
|
|
// eventBuf += event;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//
|
|
|
|
|
|
// else if (topicStr.indexOf("order") != -1) {
|
|
|
|
|
|
// if (!jsonReadBool(settingsFlashJson, "MqttIn")) {
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// String devId = selectFromMarkerToMarker(topicStr, "/", 2);
|
|
|
|
|
|
// String key = selectFromMarkerToMarker(topicStr, "/", 3);
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", F("=>MQTT"), "Received direct order " + key + " " + payloadStr);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
// String order = key + " " + payloadStr + ",";
|
|
|
|
|
|
// loopCmdAdd(order);
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", "Order add", order);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
//}
|
|
|
|
|
|
//
|
|
|
|
|
|
// else if (topicStr.indexOf("info") != -1) {
|
|
|
|
|
|
// if (topicStr.indexOf("scen") != -1) {
|
|
|
|
|
|
// writeFile(String(DEVICE_SCENARIO_FILE), payloadStr);
|
|
|
|
|
|
// loadScenario();
|
2022-02-16 00:53:52 +01:00
|
|
|
|
// SerialPrint("i", F("=>MQTT"), F("Scenario received"));
|
2022-01-10 23:37:21 +01:00
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publish(const String& topic, const String& data) {
|
|
|
|
|
|
if (mqtt.beginPublish(topic.c_str(), data.length(), false)) {
|
|
|
|
|
|
mqtt.print(data);
|
|
|
|
|
|
return mqtt.endPublish();
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishData(const String& topic, const String& data) {
|
|
|
|
|
|
String path = mqttRootDevice + "/" + topic;
|
|
|
|
|
|
if (!publish(path, data)) {
|
|
|
|
|
|
SerialPrint("E", F("MQTT"), F("on publish data"));
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishChart(const String& topic, const String& data) {
|
|
|
|
|
|
String path = mqttRootDevice + "/" + topic + "/status";
|
|
|
|
|
|
if (!publish(path, data)) {
|
|
|
|
|
|
SerialPrint("E", F("MQTT"), F("on publish chart"));
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishControl(String id, String topic, String state) {
|
|
|
|
|
|
String path = mqttPrefix + "/" + id + "/" + topic + "/control";
|
|
|
|
|
|
return mqtt.publish(path.c_str(), state.c_str(), false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishChart_test(const String& topic, const String& data) {
|
|
|
|
|
|
String path = mqttRootDevice + "/" + topic + "/status";
|
|
|
|
|
|
return mqtt.publish(path.c_str(), data.c_str(), false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-02 21:17:50 +01:00
|
|
|
|
boolean publishStatusMqtt(const String& topic, const String& data) {
|
2022-01-10 23:37:21 +01:00
|
|
|
|
String path = mqttRootDevice + "/" + topic + "/status";
|
|
|
|
|
|
String json = "{}";
|
|
|
|
|
|
jsonWriteStr(json, "status", data);
|
|
|
|
|
|
return mqtt.publish(path.c_str(), json.c_str(), false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishAnyJsonKey(const String& topic, const String& key, const String& data) {
|
|
|
|
|
|
String path = mqttRootDevice + "/" + topic + "/status";
|
|
|
|
|
|
String json = "{}";
|
|
|
|
|
|
jsonWriteStr(json, key, data);
|
|
|
|
|
|
return mqtt.publish(path.c_str(), json.c_str(), false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishEvent(const String& topic, const String& data) {
|
|
|
|
|
|
String path = mqttRootDevice + "/" + topic + "/event";
|
|
|
|
|
|
return mqtt.publish(path.c_str(), data.c_str(), false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean publishInfo(const String& topic, const String& data) {
|
|
|
|
|
|
String path = mqttRootDevice + "/" + topic + "/info";
|
|
|
|
|
|
return mqtt.publish(path.c_str(), data.c_str(), false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void publishWidgets() {
|
2022-02-13 00:40:15 +01:00
|
|
|
|
auto file = seekFile("layout.json");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
if (!file) {
|
2022-02-13 00:40:15 +01:00
|
|
|
|
SerialPrint("E", F("MQTT"), F("no file layout.json"));
|
2022-01-10 23:37:21 +01:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2022-02-13 00:40:15 +01:00
|
|
|
|
size_t size = file.size();
|
2022-02-13 16:13:51 +01:00
|
|
|
|
DynamicJsonDocument doc(size * 2);
|
2022-02-13 00:40:15 +01:00
|
|
|
|
DeserializationError error = deserializeJson(doc, file);
|
|
|
|
|
|
if (error) {
|
|
|
|
|
|
SerialPrint("E", F("MQTT"), error.f_str());
|
|
|
|
|
|
handleError("jse3", 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
JsonArray arr = doc.as<JsonArray>();
|
|
|
|
|
|
for (JsonVariant value : arr) {
|
|
|
|
|
|
publishData("config", value.as<String>());
|
2022-01-10 23:37:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
file.close();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void publishState() {
|
2022-02-13 00:40:15 +01:00
|
|
|
|
String json = "{}";
|
2022-02-13 16:13:51 +01:00
|
|
|
|
jsonMergeObjects(json, paramsHeapJson);
|
|
|
|
|
|
jsonMergeObjects(json, paramsFlashJson);
|
2022-02-13 00:40:15 +01:00
|
|
|
|
json.replace("{", "");
|
|
|
|
|
|
json.replace("}", "");
|
|
|
|
|
|
json.replace("\"", "");
|
|
|
|
|
|
json += ",";
|
|
|
|
|
|
while (json.length() != 0) {
|
|
|
|
|
|
String tmp = selectToMarker(json, ",");
|
|
|
|
|
|
String topic = selectToMarker(tmp, ":");
|
|
|
|
|
|
String state = deleteBeforeDelimiter(tmp, ":");
|
|
|
|
|
|
if (topic != "" && state != "") {
|
|
|
|
|
|
publishStatusMqtt(topic, state);
|
|
|
|
|
|
}
|
|
|
|
|
|
json = deleteBeforeDelimiter(json, ",");
|
|
|
|
|
|
}
|
2022-01-10 23:37:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-12 14:34:17 +01:00
|
|
|
|
void handleMqttStatus(bool send) {
|
|
|
|
|
|
String stateStr = getStateStr(mqtt.state());
|
2022-02-14 14:54:37 +01:00
|
|
|
|
// Serial.println(stateStr);
|
2022-02-12 14:34:17 +01:00
|
|
|
|
jsonWriteStr_(errorsHeapJson, F("mqtt"), stateStr);
|
|
|
|
|
|
if (!send) standWebSocket.broadcastTXT(errorsHeapJson);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handleMqttStatus(bool send, int state) {
|
|
|
|
|
|
String stateStr = getStateStr(state);
|
2022-02-14 14:54:37 +01:00
|
|
|
|
// Serial.println(stateStr);
|
2022-02-12 14:34:17 +01:00
|
|
|
|
jsonWriteStr_(errorsHeapJson, F("mqtt"), stateStr);
|
|
|
|
|
|
if (!send) standWebSocket.broadcastTXT(errorsHeapJson);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-12 03:09:57 +01:00
|
|
|
|
const String getStateStr(int e) {
|
|
|
|
|
|
switch (e) {
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case -4: //Нет ответа от сервера
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e1");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case -3: //Соединение было разорвано
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e2");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case -2: //Ошибка соединения. Обычно возникает когда неверно указано название сервера MQTT
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e3");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case -1: //Клиент был отключен
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e4");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 0: //подключено
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e5");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 1: //Ошибка версии
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e6");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 2: //Отклонен идентификатор
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e7");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 3: //Не могу установить соединение
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e8");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 4: //Неправильное имя пользователя/пароль
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e9");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 5: //Не авторизован для подключения
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e10");
|
|
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 6: //Название сервера пустое
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e11");
|
|
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 7: //Имя пользователя или пароль пустые
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e12");
|
|
|
|
|
|
break;
|
2022-02-12 14:34:17 +01:00
|
|
|
|
case 8: //Подключение в процессе
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("e13");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2022-02-12 03:09:57 +01:00
|
|
|
|
return F("unk");
|
2022-01-10 23:37:21 +01:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|