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_ERR_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)

Parameters

ParameterDescription
[in] connHandleHandle of the connection to discover the characteristics for.
[in] p_discParamsPointer to structure containing the specific characteristic UUID to be discovered and the discovered handle range.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts discovering the characteristics.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid parameters. Connection handle is not valid.
MBA_RES_BUSYGATT Client is busy. Another request is ongoing.