From 8714141630a96361fdcb7f80435f940bd49e2d04 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Mon, 28 Nov 2022 20:29:07 -0600 Subject: [PATCH] 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 --- main/ZgatewayBT.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/ZgatewayBT.ino b/main/ZgatewayBT.ino index dc8add6..553a3c7 100644 --- a/main/ZgatewayBT.ino +++ b/main/ZgatewayBT.ino @@ -974,7 +974,9 @@ void process_bledata(JsonObject& BLEdata) { const char* mac = BLEdata["id"].as(); int model_id = BTConfig.extDecoderEnable ? -1 : decoder.decodeBLEJson(BLEdata); int mac_type = BLEdata["mac_type"].as(); - 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()); if (model_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC) { createOrUpdateDevice(mac, device_flags_connect, model_id, mac_type); // Device that broadcast and can be connected