Merge branch 'master' into develop

This commit is contained in:
Ben Meadors 2025-09-24 06:03:14 -05:00
commit 8e04f9f631
3 changed files with 10 additions and 2 deletions

View File

@ -247,6 +247,9 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
bluetoothPhoneAPI->numBytes = 0; bluetoothPhoneAPI->numBytes = 0;
bluetoothPhoneAPI->queue_size = 0; bluetoothPhoneAPI->queue_size = 0;
} }
// Clear the last ToRadio packet buffer to avoid rejecting first packet from new connection
memset(lastToRadio, 0, sizeof(lastToRadio));
#ifdef NIMBLE_TWO #ifdef NIMBLE_TWO
// Restart Advertising // Restart Advertising
ble->startAdvertising(); ble->startAdvertising();

View File

@ -28,6 +28,9 @@ static BLEDfuSecure bledfusecure; //
static uint8_t fromRadioBytes[meshtastic_FromRadio_size]; static uint8_t fromRadioBytes[meshtastic_FromRadio_size];
static uint8_t toRadioBytes[meshtastic_ToRadio_size]; static uint8_t toRadioBytes[meshtastic_ToRadio_size];
// Last ToRadio value received from the phone
static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
static uint16_t connectionHandle; static uint16_t connectionHandle;
class BluetoothPhoneAPI : public PhoneAPI class BluetoothPhoneAPI : public PhoneAPI
@ -74,6 +77,9 @@ void onDisconnect(uint16_t conn_handle, uint8_t reason)
bluetoothPhoneAPI->close(); bluetoothPhoneAPI->close();
} }
// Clear the last ToRadio packet buffer to avoid rejecting first packet from new connection
memset(lastToRadio, 0, sizeof(lastToRadio));
// Notify UI (or any other interested firmware components) // Notify UI (or any other interested firmware components)
meshtastic::BluetoothStatus newStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED); meshtastic::BluetoothStatus newStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED);
bluetoothStatus->updateStatus(&newStatus); bluetoothStatus->updateStatus(&newStatus);
@ -145,8 +151,6 @@ void onFromRadioAuthorize(uint16_t conn_hdl, BLECharacteristic *chr, ble_gatts_e
} }
authorizeRead(conn_hdl); 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) void onToRadioWrite(uint16_t conn_hdl, BLECharacteristic *chr, uint8_t *data, uint16_t len)
{ {

View File

@ -2,6 +2,7 @@
extends = esp32s3_base extends = esp32s3_base
board = heltec_v4 board = heltec_v4
board_check = true board_check = true
board_build.partitions = default_16MB.csv
build_flags = build_flags =
${esp32s3_base.build_flags} ${esp32s3_base.build_flags}
-D HELTEC_V4 -D HELTEC_V4