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
Parameter | Description |
---|---|
[in] attrHandle | Attribute Handle. |
[out] p_attrValue | Pointer to the buffer where the attribute value will be stored. Valid if the API returns MBA_RES_SUCCESS. |
[in] p_attrLength | As 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 value | Description |
---|---|
MBA_RES_SUCCESS | Successfully retrieved the attribute value. |
MBA_RES_FAIL | The operation is not permitted. The attribute handle is valid, but the attribute cannot be read. |
MBA_RES_INVALID_PARA | Invalid parameters. |