GATTS_SendHandleValue
C
uint16_t GATTS_SendHandleValue(uint16_t connHandle, GATTS_HandleValueParams_T *p_hvParams);
Description
GATT Server sends Handle Value Notification or Indication to GATT Client when this API is called. sendType in GATTS_HandleValueParams_T determines if a notification or Indication is sent.
If sendType is set to ATT_HANDLE_VALUE_NTF then a notification is sent if notify property is set for the characteristic and Notification is enabled in its CCCD.
If sendType is set to ATT_HANDLE_VALUE_IND then an Indication is sent if Indicate property is set for the characteristic and Indication is enabled in its CCCD.
Events generated
GATTS_EVT_HV_CONFIRM Generated if indication is successfully sent.
ATT_EVT_TIMEOUT Generated when client does not respond the indication.
Parameters
Parameter | Description |
---|---|
[in] connHandle | Handle of the connection to send Handle Value Notification/Indication. |
[in] p_hvParams | Pointer to the Handle Value Notification/Indication Parameters. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully starts the Handle Value Notification/Indication. |
MBA_RES_FAIL | Operation is not permitted. Memory not available to send notification/indication. |
MBA_RES_OOM | Internal memory allocation failure. |
MBA_RES_INVALID_PARA | Invalid parameters. One of the following errors may have occurred: - Connection handle is not valid - Parameters specified in GATTS_HandleValueParams_T have invalid/out of range values - The sending data length is exceeded the MTU. - Notification/Indication has to be sent but either Notify/Indicate property is not set for the characteristic or Notification/Indication is not enabled in the CCCD. |
MBA_RES_BUSY | Send indication when another indication is ongoing. Only available in sending indication. |
MBA_RES_NO_RESOURCE | No available resource to send the handle value. |