File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1302,10 +1302,11 @@ bool NimBLEDevice::setDeviceName(const std::string& deviceName) {
13021302/* *
13031303 * @brief Set a custom callback for gap events.
13041304 * @param [in] handler The function to call when gap events occur.
1305+ * @param [in] arg Argument to pass to the handler.
13051306 * @returns
13061307 */
1307- bool NimBLEDevice::setCustomGapHandler (gap_event_handler handler) {
1308- int rc = ble_gap_event_listener_register (&m_listener, handler, NULL );
1308+ bool NimBLEDevice::setCustomGapHandler (gap_event_handler handler, void * arg ) {
1309+ int rc = ble_gap_event_listener_register (&m_listener, handler, arg );
13091310 if (rc == BLE_HS_EALREADY) {
13101311 NIMBLE_LOGI (LOG_TAG, " Already listening to GAP events." );
13111312 return true ;
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ class NimBLEDevice {
139139 static void setScanDuplicateCacheSize (uint16_t cacheSize);
140140 static void setScanFilterMode (uint8_t type);
141141 static void setScanDuplicateCacheResetTime (uint16_t time);
142- static bool setCustomGapHandler (gap_event_handler handler);
142+ static bool setCustomGapHandler (gap_event_handler handler, void * arg = nullptr );
143143 static void setSecurityAuth (bool bonding, bool mitm, bool sc);
144144 static void setSecurityAuth (uint8_t auth);
145145 static void setSecurityIOCap (uint8_t iocap);
You can’t perform that action at this time.
0 commit comments