Correct issue with interval being added and not set to the expected value

and add debug infos
This commit is contained in:
1technophile committed 2019-07-26 11:13:01 +02:00
1 parent 87c85eabe0
commit 4b0d3943ce
1 file changed
+6 -3
+6 -3
View File
@@ -676,11 +676,14 @@ void MQTTtoBT(char * topicOri, JsonObject& BTdata) { // json object decoding
// Scan interval set
if (BTdata.containsKey("interval")){
trc(F("BLE interval set"));
trc(F("BLE interval"));
// storing BLE interval for further use if needed
unsigned int prevBLEinterval = BLEinterval;
unsigned int prevBLEinterval = BLEinterval;
trc("previous interval");
trc(BLEinterval);
// set BLE interval if present if not setting default value
BLEinterval = (unsigned int)BTdata["interval"]|prevBLEinterval;
BLEinterval = (unsigned int)BTdata["interval"];
trc("new interval");
trc(BLEinterval);
if (BLEinterval == 0) {
if(BTtoMQTT())// as BLEinterval is = to 0 we can launch the loop and the scan will execute immediately