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.

Parameters

ParameterDescription
[in] connHandleHandle of the connection to send Handle Value Notification/Indication.
[in] p_hvParamsPointer to the Handle Value Notification/Indication Parameters.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts the Handle Value Notification/Indication.
MBA_RES_FAILOperation is not permitted. Memory not available to send notification/indication.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid 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_BUSYSend indication when another indication is ongoing. Only available in sending indication.
MBA_RES_NO_RESOURCENo available resource to send the handle value.