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 @@ -1303,10 +1303,11 @@ bool NimBLEDevice::setDeviceName(const std::string& deviceName) {
13031303/* *
13041304 * @brief Set a custom callback for gap events.
13051305 * @param [in] handler The function to call when gap events occur.
1306+ * @param [in] arg Argument to pass to the handler.
13061307 * @returns
13071308 */
1308- bool NimBLEDevice::setCustomGapHandler (gap_event_handler handler) {
1309- int rc = ble_gap_event_listener_register (&m_listener, handler, NULL );
1309+ bool NimBLEDevice::setCustomGapHandler (gap_event_handler handler, void * arg ) {
1310+ int rc = ble_gap_event_listener_register (&m_listener, handler, arg );
13101311 if (rc == BLE_HS_EALREADY) {
13111312 NIMBLE_LOGI (LOG_TAG, " Already listening to GAP events." );
13121313 return true ;
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ class NimBLEDevice {
133133 static void setScanDuplicateCacheSize (uint16_t cacheSize);
134134 static void setScanFilterMode (uint8_t type);
135135 static void setScanDuplicateCacheResetTime (uint16_t time);
136- static bool setCustomGapHandler (gap_event_handler handler);
136+ static bool setCustomGapHandler (gap_event_handler handler, void * arg = nullptr );
137137 static void setSecurityAuth (bool bonding, bool mitm, bool sc);
138138 static void setSecurityAuth (uint8_t auth);
139139 static void setSecurityIOCap (uint8_t iocap);
You can’t perform that action at this time.
0 commit comments