Skip to content

Commit 5e99ea8

Browse files
correct the documentation for GattServer::addService
1 parent cdc8845 commit 5e99ea8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

connectivity/FEATURE_BLE/include/ble/GattServer.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,18 @@ class GattServer {
316316
*
317317
* The process assigns a unique attribute handle to all the elements added
318318
* into the attribute table. This handle is an ID that must be used for
319-
* subsequent interractions with the elements.
319+
* subsequent interactions with the elements.
320320
*
321321
* @note There is no mirror function that removes a single service.
322322
* Application code can remove all the registered services by calling
323323
* reset().
324324
*
325-
* @attention Service, characteristics and descriptors objects registered
326-
* within the GattServer must remain reachable until reset() is called.
325+
* @attention GattServer allocates its own memory for all the attributes.
326+
* The GattServer will set the handles on the service passed in and the
327+
* characteristics it contains. You may record the handles you want to
328+
* interact with in the future. After that the service and characteristics
329+
* you passed in as the parameter may be freed. To write to the GattServer
330+
* instances of the characteristics you have to use the saved handles.
327331
*
328332
* @param[in] service The service to be added; attribute handle of services,
329333
* characteristic and characteristic descriptors are updated by the

0 commit comments

Comments
 (0)