Microchip® Advanced Software Framework

alert_notification.c File Reference

ALert Notification Service.

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

#include "at_ble_api.h"
#include "platform.h"
#include "alert_notification.h"
#include "ble_manager.h"

Functions

static void anp_alert_category (uint8_t *data)
 anp_alert_category to determine the supported alert categories More...
 
at_ble_status_t anp_alert_noti (at_ble_handle_t conn_handle, at_ble_handle_t desc_handle, bool noti)
 anp_alert_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...
 
static void anp_alert_type (uint8_t *data)
 anp_alert_type to determine the type of alert received More...
 

Variables

const char * bitmask0 []
 
const char * bitmask1 []
 

static void anp_alert_category ( uint8_t *  data)
static

anp_alert_category to determine the supported alert categories

Parameters
[in]datareceived from the peer device

References BIT_MASK0, BIT_MASK1, BIT_MASK2, BIT_MASK3, BIT_MASK4, BIT_MASK5, BIT_MASK6, BIT_MASK7, bitmask0, bitmask1, and DBG_LOG.

Referenced by anp_alert_read_response().

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

anp_alert_noti invoked by the profile for enabling or disabling notifications

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().

static void anp_alert_type ( uint8_t *  data)
static

anp_alert_type to determine the type of alert received

Parameters
[in]datareceived from the peer device consisting alert info

References bitmask0, bitmask1, and DBG_LOG.

Referenced by anp_alert_notify_response().

const char* bitmask0[]
Initial value:
= {"Simple Alert","Email","News","Call","Missed Call","Sms/Mms",
"Voice Mail","Schedule"}

Referenced by anp_alert_category(), and anp_alert_type().

const char* bitmask1[]
Initial value:
= {"High Prioritized Alert","Instant Message",
"Reserved For feature"}

Referenced by anp_alert_category(), and anp_alert_type().