Microchip® Advanced Software Framework

alert_notification.h File Reference

ANCS Service Declarations.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

Data Structures

struct  gatt_anp_handler
 

Macros

#define ALERT_CONTRL_POINT_READ   (3)
 
#define ANP_INVALID_CHAR_HANDLE   (0)
 
#define ANP_READ_LENGTH   (20)
 
#define ANP_READ_OFFSET   (0)
 
#define ANS_ALERT_NP_READ_LENGTH   (20)
 
#define ANS_NEW_ALERT_READ_LENGTH   (20)
 
#define ANS_SUP_NEW_READ_LENGTH   (20)
 
#define ANS_SUP_UNREA_READ_LENGTH   (20)
 
#define ANS_UNREA_ALERT_READ_LENGTH   (20)
 
#define BIT_MASK0   (1)
 
#define BIT_MASK1   (1 << 1)
 
#define BIT_MASK2   (1 << 2)
 
#define BIT_MASK3   (1 << 3)
 
#define BIT_MASK4   (1 << 4)
 
#define BIT_MASK5   (1 << 5)
 
#define BIT_MASK6   (1 << 6)
 
#define BIT_MASK7   (1 << 7)
 
#define SUPPORTED_NEW_ALERT_READ   (1)
 
#define SUPPORTED_UNREAD_ALERT_READ   (2)
 

Typedefs

typedef struct gatt_anp_handler gatt_anp_handler_t
 

Functions

at_ble_status_t anp_alert_noti (at_ble_handle_t conn_handle, at_ble_handle_t desc_handle, bool noti)
 invoked by the profile for enabling or disabling notifications More...
 
void anp_alert_notify_response (at_ble_notification_recieved_t *notify_resp, gatt_anp_handler_t *anp_handler)
 anp_alert_notify_response invoked by the profile after receiving notifications More...
 
at_ble_status_t anp_alert_read (at_ble_handle_t conn_handle, at_ble_handle_t char_handle)
 anp_alert_read invoked by ble manager More...
 
uint8_t anp_alert_read_response (at_ble_characteristic_read_response_t *read_resp, gatt_anp_handler_t *anp_handler)
 anp_alert_read_response invoked by the profile once it receives read response More...
 

#define ALERT_CONTRL_POINT_READ   (3)

Referenced by anp_alert_read_response().

#define ANP_INVALID_CHAR_HANDLE   (0)

Referenced by anp_alert_noti(), and anp_alert_read().

#define ANP_READ_LENGTH   (20)

Referenced by anp_alert_read().

#define ANP_READ_OFFSET   (0)

Referenced by anp_alert_read().

#define ANS_ALERT_NP_READ_LENGTH   (20)
#define ANS_NEW_ALERT_READ_LENGTH   (20)
#define ANS_SUP_NEW_READ_LENGTH   (20)
#define ANS_SUP_UNREA_READ_LENGTH   (20)
#define ANS_UNREA_ALERT_READ_LENGTH   (20)
#define BIT_MASK0   (1)

Referenced by anp_alert_category().

#define BIT_MASK1   (1 << 1)

Referenced by anp_alert_category().

#define BIT_MASK2   (1 << 2)

Referenced by anp_alert_category().

#define BIT_MASK3   (1 << 3)

Referenced by anp_alert_category().

#define BIT_MASK4   (1 << 4)

Referenced by anp_alert_category().

#define BIT_MASK5   (1 << 5)

Referenced by anp_alert_category().

#define BIT_MASK6   (1 << 6)

Referenced by anp_alert_category().

#define BIT_MASK7   (1 << 7)

Referenced by anp_alert_category().

#define SUPPORTED_NEW_ALERT_READ   (1)
#define SUPPORTED_UNREAD_ALERT_READ   (2)

at_ble_status_t anp_alert_noti ( at_ble_handle_t  conn_handle,
at_ble_handle_t  desc_handle,
bool  noti 
)

invoked by the profile for enabling or disabling notifications

Parameters
[in]at_ble_handle_tconnection handle
[in]at_ble_handle_tdescriptor handle
[in]truefor enabling notification false for disabling notifications
Note
Called by the profile

invoked by the profile for enabling or disabling notifications

Parameters
[in]at_ble_handle_tconnection handle
[in]at_ble_handle_tdescriptor handle
[in]truefor enabling notification false for disabling notifications
Note
Called by the profile

References ANP_INVALID_CHAR_HANDLE, AT_BLE_ATT_INVALID_HANDLE, at_ble_characteristic_write(), and AT_BLE_SUCCESS.

Referenced by anp_client_disable_notification(), and anp_client_write_notification_handler().

void anp_alert_notify_response ( at_ble_notification_recieved_t notify_resp,
gatt_anp_handler_t anp_handler 
)

anp_alert_notify_response invoked by the profile after receiving notifications

Parameters
[in]at_ble_notification_recieved_tconsists of characteristic handle and new value
[in]gatt_anp_handler_tanp service information in peer device

References anp_alert_type(), at_ble_notification_recieved_t::char_handle, at_ble_notification_recieved_t::char_len, at_ble_notification_recieved_t::char_value, DBG_LOG, DBG_LOG_DEV, gatt_anp_handler::new_alert_char_handle, and gatt_anp_handler::unread_alert_char_handle.

Referenced by anp_client_notification_handler().

at_ble_status_t anp_alert_read ( at_ble_handle_t  conn_handle,
at_ble_handle_t  char_handle 
)

anp_alert_read invoked by ble manager

Parameters
[in]at_ble_handle_tconsists of connection handle
[in]at_ble_handle_tconsists of char handle

References ANP_INVALID_CHAR_HANDLE, ANP_READ_LENGTH, ANP_READ_OFFSET, AT_BLE_ATT_INVALID_HANDLE, and at_ble_characteristic_read().

Referenced by anp_client_security_done_handler().