Skip to content

Commit a142b91

Browse files
committed
SDK3.3: Changed structures for ESPNow and BLE PIN
1 parent 9cb28f5 commit a142b91

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/helpers/esp32/ESPNOWRadio.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ static uint8_t rx_buf[256];
1212
static uint8_t last_rx_len = 0;
1313

1414
// callback when data is sent
15+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
16+
static void OnDataSent(const esp_now_send_info_t *tx_info, esp_now_send_status_t status) {
17+
#else
1518
static void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
19+
#endif
1620
is_send_complete = true;
1721
ESPNOW_DEBUG_PRINTLN("Send Status: %d", (int)status);
1822
}

src/helpers/esp32/SerialBLEInterface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code
2929
BLEDevice::setMTU(MAX_FRAME_SIZE);
3030

3131
BLESecurity sec;
32+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
33+
sec.setPassKey(true, pin_code);
34+
#else
3235
sec.setStaticPIN(pin_code);
36+
#endif
3337
sec.setAuthenticationMode(ESP_LE_AUTH_REQ_SC_MITM_BOND);
3438

3539
//BLEDevice::setPower(ESP_PWR_LVL_N8);

0 commit comments

Comments
 (0)