Remove the devices that have Random Mac from the internal memory (#1335)

So as to avoid to have a growing memory consumption, indeed each time these devices change their MAC it will create a new entry into the list. This increase continuously the memory consumption of the list. And as these devices can't be discovered and doesn't have interest to be white or black listed we don't store them
This commit is contained in:
Florian authored and GitHub committed 2022-11-28 20:29:07 -06:00
1 parent c58e765253
commit 8714141630
1 file changed
+3 -1
+3 -1
View File
@@ -974,7 +974,9 @@ void process_bledata(JsonObject& BLEdata) {
const char* mac = BLEdata["id"].as<const char*>();
int model_id = BTConfig.extDecoderEnable ? -1 : decoder.decodeBLEJson(BLEdata);
int mac_type = BLEdata["mac_type"].as<int>();
if (model_id >= 0) { // Broadcaster devices
if (model_id >= 0 && model_id != TheengsDecoder::BLE_ID_NUM::IBEACON &&
model_id != TheengsDecoder::BLE_ID_NUM::MS_CDP &&
model_id != TheengsDecoder::BLE_ID_NUM::GAEN) { // Broadcaster devices
Log.trace(F("Decoder found device: %s" CR), BLEdata["model_id"].as<const char*>());
if (model_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC) {
createOrUpdateDevice(mac, device_flags_connect, model_id, mac_type); // Device that broadcast and can be connected