mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
Ignore seen phoneapi packets (#4888)
* Ignore PhoneAPI packet if it's been seen * ignoramus * Also keep track of the last 20 packet IDs * Fill * Make this match the nimble one * Add the log too * Ignore zero ID packets * Remove message entirely * TRunkt
This commit is contained in:
@@ -141,10 +141,19 @@ void onFromRadioAuthorize(uint16_t conn_hdl, BLECharacteristic *chr, ble_gatts_e
|
||||
}
|
||||
authorizeRead(conn_hdl);
|
||||
}
|
||||
// Last ToRadio value received from the phone
|
||||
static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
|
||||
|
||||
void onToRadioWrite(uint16_t conn_hdl, BLECharacteristic *chr, uint8_t *data, uint16_t len)
|
||||
{
|
||||
LOG_INFO("toRadioWriteCb data %p, len %u\n", data, len);
|
||||
bluetoothPhoneAPI->handleToRadio(data, len);
|
||||
if (memcmp(lastToRadio, data, len) != 0) {
|
||||
LOG_DEBUG("New ToRadio packet\n");
|
||||
memcpy(lastToRadio, data, len);
|
||||
bluetoothPhoneAPI->handleToRadio(data, len);
|
||||
} else {
|
||||
LOG_DEBUG("Dropping duplicate ToRadio packet we just saw\n");
|
||||
}
|
||||
}
|
||||
|
||||
void setupMeshService(void)
|
||||
|
||||
Reference in New Issue
Block a user