GATTS_SendReadResponse

C

uint16_t GATTS_SendReadResponse(uint16_t connHandle, GATTS_SendReadRespParams_T *p_respParams);

Description

GATT Server sends the read/read blob response when this API is called. responseType in GATTS_SendReadRespParams_T indicates if the response is for read request or read blob request.

Response to the GATT client is sent only if:

  • API initiates a Read response and a Read request was received by GATT server.

  • API initiates a Read Blob response and a Read Blob request was received by GATT server.

Note

If the attribute setting of the attribute is set as SETTING_MANUAL_READ_RSP, the event GATTS_EVT_READ with readType is ATT_READ_REQ or ATT_READ_BLOB_REQ will be sent to application when GATT server receives these requests performing on this attribute. In this case, application need to call this API to send read response or send error response if the request is not permitted.

This API should be called to send the response only when event GATTS_EVT_READ is received.

Parameters

ParameterDescription
[in] connHandleHandle of the connection to send the read response.
[in] p_respParamsPointer to Read Response parameters. See GATTS_SendReadRespParams_T

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts to send the read response.
MBA_RES_FAILOperation is not permitted as Read response/Read Blob response transmission was requested but read request/read blob request was not received.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid parameters. Connection handle is not valid.