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 |
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
[in] | at_ble_handle_t | connection handle |
[in] | at_ble_handle_t | descriptor handle |
[in] | true | for enabling notification false for disabling notifications |
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
[in] | at_ble_notification_recieved_t | consists of characteristic handle and new value |
[in] | gatt_anp_handler_t | anp 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
[in] | at_ble_handle_t | consists of connection handle |
[in] | at_ble_handle_t | consists 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().
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
[in] | at_ble_characteristic_read_response_t | consists of characteristic handle value handle |
[in] | gatt_anp_handler_t | consists all anp service related handles |
References ALERT_CONTRL_POINT_READ, gatt_anp_handler::alert_np_char_handle, anp_alert_category(), at_ble_characteristic_read_response_t::char_handle, at_ble_characteristic_read_response_t::char_len, at_ble_characteristic_read_response_t::char_value, DBG_LOG, DBG_LOG_DEV, gatt_anp_handler::supp_new_char_handle, gatt_anp_handler::supp_unread_char_handle, SUPPORTED_NEW_ALERT_READ, and SUPPORTED_UNREAD_ALERT_READ.
Referenced by anp_client_read_response_handler().
|
static |
anp_alert_type to determine the type of alert received
[in] | data | received from the peer device consisting alert info |
References bitmask0, bitmask1, and DBG_LOG.
Referenced by anp_alert_notify_response().
const char* bitmask0[] |
Referenced by anp_alert_category(), and anp_alert_type().
const char* bitmask1[] |
Referenced by anp_alert_category(), and anp_alert_type().