GATTC_Read

C

uint16_t GATTC_Read(uint16_t connHandle, uint16_t charHandle, uint16_t valueOffset);

Description

Initiates a read operation from the GATT Client to the GATT Server.

Note

This API is used to read a Characteristic Value or a Characteristic Descriptor. - For non-long attributes, set valueOffset to 0. A Read Request is sent. - For long attributes, read the first (ATT_MTU-1) bytes with valueOffset set to 0. Subsequent bytes are read with a non-zero valueOffset using Read Blob Requests. Continue issuing GATTC_Read with updated offsets upon receiving each GATTC_EVT_READ_RESP until the entire attribute is read.

Parameters

ParameterDescription
[in] connHandleHandle of the connection to send read operation.
[in] charHandleThe handle of the characteristic or descriptor to read.
[in] valueOffsetThe offset for a Read Blob Request. Set to 0 for a normal Read Request.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts the read operation.
MBA_RES_OOMMemory allocation failure occurred internally.
MBA_RES_INVALID_PARAInvalid parameters, such as an invalid connection handle.
MBA_RES_BUSYGATT Client is busy with another ongoing request.