GATTC_DiscoverPrimaryServiceByUUID
C
uint16_t GATTC_DiscoverPrimaryServiceByUUID(uint16_t connHandle, GATTC_DiscoverPrimaryServiceParams_T *p_discParams);
Description
Begins the discovery of primary services by UUID within a specified handle range on the GATT server.
Note
The discovery may result in multiple events as services are found.
Events generated
GATTC_EVT_DISC_PRIM_SERV_BY_UUID_RESP indicates ongoing discovery or finalization of the process.
GATTC_EVT_ERROR_RESP indicates an error or the end of the discovery process if the last service's end handle is less than the specified end handle.
ATT_EVT_TIMEOUT indicates a timeout waiting for the server's response.
Parameters
Parameter | Description |
---|---|
[in] connHandle | Handle of the connection to discover the services. |
[in] p_discParams | Pointer to parameters specifying the UUID and handle range for discovery. See GATTC_DiscoverPrimaryServiceParams_T. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Discovery process successfully started. |
MBA_RES_OOM | Memory allocation failure occurred internally. |
MBA_RES_INVALID_PARA | Invalid parameters, such as an invalid connection handle. |
MBA_RES_BUSY | GATT Client is busy with another ongoing request. |