1.2.2.1.2.4.4 GATTC_DiscoverCharacteristicsByUUID
C
uint16_t GATTC_DiscoverCharacteristicsByUUID(uint16_t connHandle, GATTC_DiscoverCharacteristicByUuidParams_T *p_discParams);
Description
GATT Client starts discovery of specific characteristics within the given handle range when this API is called.
Following events may be generated:
Event GATTC_EVT_DISC_CHAR_BY_UUID_RESP with procedureStatus in GATT_EvtDiscCharResp_T set to continue. This indicates specific characteristics are found but the discovery is not yet complete (more characteristics may be present). See p_attrData in GATT_EvtDiscCharResp_T for extracting the characteristic details.
Event GATTC_EVT_DISC_CHAR_BY_UUID_RESP with procedureStatus in GATT_EvtDiscCharResp_T set to Finish. This indicates termination of the procedure (Value handle of last found characteristic declaration is equal to end handle of input handle range). Please note that the response may be null if no characteristic found in last query.
Event GATTC_EVT_ERROR_RESP with error code ATT_ERRCODE_ATTRIBUTE_NOT_FOUND is generated. This indicates termination of the procedure. (Last found Value handle is not same as end handle of the input handle range or no characteristic declaration found)
Events generated
GATTC_EVT_ERROR_RESP Generated when characteristics not found or discovery procedure is end.
GATTC_EVT_DISC_CHAR_BY_UUID_RESP Generated when characteristics discovered from remote.
ATT_EVT_TIMEOUT Generated when server does not respond the request.
Parameters
Parameter | Description |
---|---|
[in] connHandle | Handle of the connection to discover the characteristics for. |
[in] p_discParams | Pointer to structure containing the specific characteristic UUID to be discovered and the discovered handle range. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully starts discovering the characteristics. |
MBA_RES_OOM | Internal memory allocation failure. |
MBA_RES_INVALID_PARA | Invalid parameters. Connection handle is not valid. |
MBA_RES_BUSY | GATT Client is busy. Another request is ongoing. |