Fix deprecation notice for ble::Gap::getState()

The deprecation notice suggests getConnectionCount() which
did not land in the final API. The proper replacement is keeping
your own record and updating during connection and disconnection
callbacks.
pull/10646/head
Lingkai Dong 2019-05-23 16:36:28 +01:00
parent 2a49ff6d50
commit c84a13c0f2
1 changed files with 5 additions and 3 deletions

View File

@ -1347,13 +1347,15 @@ public:
* @return The current GAP state of the device. * @return The current GAP state of the device.
* *
* @deprecated Deprecated since addition of extended advertising support. * @deprecated Deprecated since addition of extended advertising support.
* This is not meaningful when you use extended advertising; please use * This is not meaningful when you use extended advertising; Please replace
* isAdvertisingActive() and getConnectionCount(). * getState().advertising with isAdvertisingActive(), and replace
* getState().connected with your own record and update during callbacks.
*/ */
MBED_DEPRECATED_SINCE( MBED_DEPRECATED_SINCE(
"mbed-os-5.11.0", "mbed-os-5.11.0",
"Deprecated since addition of extended advertising support. " "Deprecated since addition of extended advertising support. "
"Use isAdvertisingActive() and getConnectionCount()." "Replace getState().advertising with isAdvertisingActive()."
"Replace getState().connected with your own record and update during callbacks."
) )
GapState_t getState(void) const; GapState_t getState(void) const;