fix ESP32 ble (#304)

* remove redundant code for home presence

* hopefully fix ESP32 BLE hangs

* basic support for duplicate detection when JSON publishing is active
This commit is contained in:
animavitis authored and Florian committed 2018-11-09 22:19:02 +01:00
1 parent ba829e643e
commit a74eb76931
3 files changed
+19 -6

No files matched your search

+5 -5
View File
@@ -74,11 +74,12 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht
BLEdata.set("txpower", (int8_t) advertisedDevice.getTXPower());
}
if (advertisedDevice.haveServiceData()){
char mac[mac_adress.length()+1];
mac_adress.toCharArray(mac,mac_adress.length()+1);
trc(F("Get service data "));
std::string serviceData = advertisedDevice.getServiceData();
int serviceDataLength = serviceData.length();
String returnedString = "";
@@ -98,9 +99,7 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht
BLEdata.set("servicedatauuid", (char *)advertisedDevice.getServiceDataUUID().toString().c_str());
char topic[] = subjectBTtoMQTT;
strcat(topic, mac);
pub(topic,BLEdata);
pub((char *)mactopic.c_str(),BLEdata);
if (strstr(BLEdata["servicedatauuid"].as<char*>(),"fe95") != NULL){
trc("Processing BLE device data");
@@ -116,6 +115,7 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht
trc("mi jia data reading");
boolean result = process_data(pos - 26,service_data,mac);
}
}
}
}
@@ -129,7 +129,7 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht
"coreTask", /* Name of the task */
10000, /* Stack size in words */
NULL, /* Task input parameter */
0, /* Priority of the task */
1, /* Priority of the task */
NULL, /* Task handle. */
taskCore); /* Core where the task should run */
trc(F("ZgatewayBT multicore ESP32 setup done "));