Skip to content

Commit

Permalink
Remove the devices that have Random Mac from the internal memory (#1335)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
1technophile authored Nov 29, 2022
1 parent c58e765 commit 8714141
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main/ZgatewayBT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8714141

Please sign in to comment.