[SYS] Misc bug fixes with strict compilation (#2188)
This commit is contained in:
1 parent
6175e03bc8
commit
301b3eecd8
1 file changed
+5
-5
+5
-5
@@ -81,7 +81,7 @@ static BLEdevice NO_BT_DEVICE_FOUND = {
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
(int)UNKWNON_MODEL,
|
(char)UNKWNON_MODEL,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
static bool oneWhite = false;
|
static bool oneWhite = false;
|
||||||
@@ -381,7 +381,7 @@ void createOrUpdateDevice(const char* mac, uint8_t flags, int model, int mac_typ
|
|||||||
if (strlen(name) > 20) {
|
if (strlen(name) > 20) {
|
||||||
Log.warning(F("Name too long, truncating" CR));
|
Log.warning(F("Name too long, truncating" CR));
|
||||||
strncpy(device->name, name, 20);
|
strncpy(device->name, name, 20);
|
||||||
device->name[20] = '\0';
|
device->name[19] = '\0';
|
||||||
} else {
|
} else {
|
||||||
strcpy(device->name, name);
|
strcpy(device->name, name);
|
||||||
}
|
}
|
||||||
@@ -1107,8 +1107,8 @@ void launchBTDiscovery(bool overrideDiscovery) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (p->sensorModel_id > BLEconectable::id::MIN &&
|
if ((p->sensorModel_id > BLEconectable::id::MIN &&
|
||||||
p->sensorModel_id < BLEconectable::id::MAX ||
|
p->sensorModel_id < BLEconectable::id::MAX) ||
|
||||||
p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC || p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::BM2) {
|
p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC || p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::BM2) {
|
||||||
// Discovery of sensors from which we retrieve data only by connect
|
// Discovery of sensors from which we retrieve data only by connect
|
||||||
if (p->sensorModel_id == BLEconectable::id::DT24_BLE) {
|
if (p->sensorModel_id == BLEconectable::id::DT24_BLE) {
|
||||||
@@ -1224,7 +1224,7 @@ void process_bledata(JsonObject& BLEdata) {
|
|||||||
} else if (BTConfig.extDecoderEnable && model_id < 0 && BLEdata.containsKey("servicedata")) {
|
} else if (BTConfig.extDecoderEnable && model_id < 0 && BLEdata.containsKey("servicedata")) {
|
||||||
const char* service_data = (const char*)(BLEdata["servicedata"] | "");
|
const char* service_data = (const char*)(BLEdata["servicedata"] | "");
|
||||||
if (strstr(service_data, "209800") != NULL) {
|
if (strstr(service_data, "209800") != NULL) {
|
||||||
model_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC;
|
model_id = TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC;
|
||||||
Log.trace(F("Connectable device found: HHCCJCY01HHCC" CR));
|
Log.trace(F("Connectable device found: HHCCJCY01HHCC" CR));
|
||||||
createOrUpdateDevice(mac, device_flags_connect, model_id, mac_type, deviceName);
|
createOrUpdateDevice(mac, device_flags_connect, model_id, mac_type, deviceName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user