GATTS_GetHandleValue

C

uint16_t GATTS_GetHandleValue(uint16_t attrHandle, uint8_t *p_attrValue, uint16_t *p_attrLength);

Description

Retrieves the value of an attribute from the GATT Server.

Note

If the attribute is readable, its value is returned in the provided buffer. The attribute value is returned as raw data.

Parameters

ParameterDescription
[in] attrHandleAttribute Handle.
[out] p_attrValuePointer to the buffer where the attribute value will be stored. Valid if the API returns MBA_RES_SUCCESS.
[in] p_attrLengthAs an input parameter, it specifies the size of the provided buffer. As an output parameter, it specifies the actual size of the retrieved attribute value when the API returns MBA_RES_SUCCESS.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully retrieved the attribute value.
MBA_RES_FAILThe operation is not permitted. The attribute handle is valid, but the attribute cannot be read.
MBA_RES_INVALID_PARAInvalid parameters.