Skip to content

Commit 6c6dbf9

Browse files
committed
feat(ble): Add function to set pins when using hosted BLE
1 parent 491e2d2 commit 6c6dbf9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

libraries/BLE/src/BLEDevice.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,23 @@ void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) {
12191219

12201220
#if defined(CONFIG_NIMBLE_ENABLED)
12211221

1222+
/**
1223+
* @brief Set the SDIO pins for connection to external ESP MCU when using ESP-Hosted with NimBLE
1224+
* @param [in] clk The clock pin
1225+
* @param [in] cmd The command pin
1226+
* @param [in] d0 The data pin 0
1227+
* @param [in] d1 The data pin 1
1228+
* @param [in] d2 The data pin 2
1229+
* @param [in] d3 The data pin 3
1230+
* @param [in] rst The reset pin
1231+
* @return True if the pins were set successfully.
1232+
*/
1233+
#if CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE
1234+
bool BLEDevice::setPins(int8_t clk, int8_t cmd, int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t rst) {
1235+
return hostedSetPins(clk, cmd, d0, d1, d2, d3, rst);
1236+
}
1237+
#endif
1238+
12221239
/**
12231240
* @brief Checks if a peer device is whitelisted.
12241241
* @param [in] address The address to check for in the whitelist.

libraries/BLE/src/BLEDevice.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ class BLEDevice {
234234
static bool setOwnAddr(uint8_t *addr);
235235
static void setDeviceCallbacks(BLEDeviceCallbacks *cb);
236236
static bool onWhiteList(BLEAddress &address);
237+
#if CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE
238+
// Set SDIO pins for connection to external ESP MCU
239+
static bool setPins(int8_t clk, int8_t cmd, int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t rst);
240+
#endif
237241
#endif
238242

239243
private:

0 commit comments

Comments
 (0)