GATTS_SendErrorResponse

C

uint16_t GATTS_SendErrorResponse(uint16_t connHandle, GATTS_SendErrRespParams_T *p_errParams);

Description

GATT Server sends an error response. This API should be called when a request event is received by the application. The request is not processed by the GATT server.

For example, This API may be called after Application receives Write Request event (GATTS_EVT_WRITE) but request cannot be processed as the attribute value does not have Write permission.

Parameters

ParameterDescription
[in] connHandleHandle of the connection to send the error response.
[in] p_errParamsPointer to Error Response parameters. See GATTS_SendErrRespParams_T.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully initiates an error response.
MBA_RES_FAILOperation is not permitted. The error response is not for the received request. i.e. The reqOpcode field in the GATTS_SendErrRespParams_T is the matched to the receiving request.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid parameters. Connection handle is not valid.