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
Parameter | Description |
---|---|
[in] connHandle | Handle of the connection to send the read response. |
[in] p_respParams | Pointer to Read Response parameters. See GATTS_SendReadRespParams_T |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully starts to send the read response. |
MBA_RES_FAIL | Operation is not permitted as Read response/Read Blob response transmission was requested but read request/read blob request was not received. |
MBA_RES_OOM | Internal memory allocation failure. |
MBA_RES_INVALID_PARA | Invalid parameters. Connection handle is not valid. |