GATTC_DiscoverAllCharacteristics
C
uint16_t GATTC_DiscoverAllCharacteristics(uint16_t connHandle, uint16_t startHandle, uint16_t endHandle);
Description
GATT Client starts discovery of all characteristics within the given handle range when this API is called.
Following events may be generated:
Event GATTC_EVT_DISC_CHAR_RESP with procedureStatus in GATT_EvtDiscCharResp_T set to continue. This indicates characteristic declarations are found but the discovery is not yet complete (more declarations may be present). See p_attrData in GATT_EvtDiscCharResp_T for extracting the characteristic details.
Event GATTC_EVT_DISC_CHAR_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)
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_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] startHandle | Start of handle range to be queried. |
[in] endHandle | End of handle range to be queried. |
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. |