Phone Alert Status Application.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "console_serial.h"
#include "stdio.h"
#include "at_ble_api.h"
#include "at_ble_trace.h"
#include "at_ble_errno.h"
#include "platform.h"
#include "timer_hw.h"
#include "conf_extint.h"
#include "ble_manager.h"
#include "ble_utils.h"
#include "pas_client.h"
#include "pas_app.h"
Functions | |
static void | app_alert_status_notify (uint8_t *data, uint8_t len) |
displays alert status value came in notification More... | |
static void | app_alert_status_read (uint8_t *data, uint8_t len) |
displays alerts status value came in read response More... | |
static at_ble_status_t | app_connected_event_handler (void *params) |
app_connected_state blemanager notifies the application about state More... | |
static at_ble_status_t | app_disconnected_event_handler (void *params) |
app_connected_state ble manager notifies the application about state More... | |
static void | app_ringer_setting_notify (uint8_t *data, uint8_t len) |
displays ringer setting value came in notification More... | |
static void | app_ringer_setting_read (uint8_t *data, uint8_t len) |
displays ringer setting value came in read response More... | |
void | button_cb (void) |
Button Press Callback. More... | |
static void | display_alert_status_info (uint8_t *data) |
display alert status info notifies the application about state More... | |
static void | display_ringer_setting_info (uint8_t *data) |
display alert status info notifies the application about state More... | |
int | main (void) |
static at_ble_status_t | pas_custom_event (void *param) |
static void | timer_callback_handler (void) |
Timer Callback. More... | |
Variables | |
user_custom_event_t | app_button_event |
static const ble_gap_event_cb_t | app_gap_handle |
volatile bool | app_init_done = false |
volatile bool | app_state |
bool | appp_exec = true |
volatile bool | flag = false |
static const ble_custom_event_cb_t | pas_custom_event_cb |
volatile uint8_t | press_count = DEVICE_SILENT |
|
static |
displays alert status value came in notification
[in] | data | |
[in] | len |
References DBG_LOG, DBG_LOG_DEV, and display_alert_status_info().
Referenced by main().
|
static |
displays alerts status value came in read response
[in] | data | |
[in] | len |
References DBG_LOG, DBG_LOG_DEV, and display_alert_status_info().
Referenced by main().
|
static |
app_connected_state blemanager notifies the application about state
[in] | at_ble_connected_t |
References ALL_UNUSED, app_state, and AT_BLE_SUCCESS.
|
static |
app_connected_state ble manager notifies the application about state
[in] | connected |
References ALL_UNUSED, app_state, AT_BLE_SUCCESS, DEVICE_SILENT, pas_client_adv(), and press_count.
|
static |
displays ringer setting value came in notification
[in] | data | |
[in] | len |
References DBG_LOG, DBG_LOG_DEV, and display_ringer_setting_info().
Referenced by main().
|
static |
displays ringer setting value came in read response
[in] | data | |
[in] | len |
References DBG_LOG, DBG_LOG_DEV, and display_ringer_setting_info().
Referenced by main().
void button_cb | ( | void | ) |
Button Press Callback.
References app_init_done, and at_ble_event_user_defined_post().
|
static |
display alert status info notifies the application about state
[in] | data |
References BIT0_MASK, BIT1_MASK, BIT2_MASK, and DBG_LOG.
Referenced by app_alert_status_notify(), and app_alert_status_read().
|
static |
display alert status info notifies the application about state
[in] | data |
References DBG_LOG_CONT, RINGER_NORMAL, and RINGER_SILENT.
Referenced by app_ringer_setting_notify(), and app_ringer_setting_read().
int main | ( | void | ) |
References ALL_UNUSED, app_alert_status_notify(), app_alert_status_read(), app_init_done, app_ringer_setting_notify(), app_ringer_setting_read(), appp_exec, AT_BLE_SUCCESS, BLE_CUSTOM_EVENT_TYPE, ble_device_init(), ble_event_task(), BLE_GAP_EVENT_TYPE, ble_mgr_events_callback_handler(), board_init(), DBG_LOG, DBG_LOG_PTS, delay_ms, DEVICE_MUTE, DEVICE_NORMAL, DEVICE_SILENT, DISCOVER_ATTRIBUTES, flag, hw_timer_init(), hw_timer_register_callback(), NULL, pas_client_adv(), pas_client_init(), pas_client_read_alert_status_char(), pas_client_read_ringer_setting_char(), pas_client_start_service_discovery(), pas_client_write_ringer_control_point(), press_count, READ_ALERT_STATUS, READ_REQUEST, READ_RINGER_SETTING, register_alert_status_notification_callback(), register_alert_status_read_callback(), REGISTER_CALL_BACK, register_ringer_setting_notification_callback(), register_ringer_setting_read_callback(), serial_console_init(), system_init(), and timer_callback_handler().
|
static |
References APP_BUTTON_EVENT_ID, app_state, AT_BLE_FAILURE, AT_BLE_SUCCESS, and flag.
|
static |
Timer Callback.
user_custom_event_t app_button_event |
|
static |
Referenced by button_cb(), main(), and timer_callback_handler().
volatile bool app_state |
state of the app,true for connected false for disconnected
Referenced by app_connected_event_handler(), app_connected_state(), app_connected_state_handler(), app_disconnected_event_handler(), app_disconnected_state_handler(), blp_sensor_app_custom_event(), button_cb(), hr_sensor_app_custom_event(), and pas_custom_event().
To send values once per button press
Referenced by _rww_eeprom_emulator_erase_invalid_page(), BM_APPLICATION_ClientWriteRequestExecutePkt(), Boot_main(), events_is_detected(), events_is_overrun(), EVSYS_Handler(), http_client_send_request(), i2c_slave_dma_write_interrupt_status(), jumpToApplication(), main(), pas_custom_event(), run_cbc_mode_test(), run_cfb128_mode_test(), run_ctr_mode_test(), run_ecb_mode_test(), run_ecb_mode_test_dma(), run_ofb_mode_test(), SAL_AESCmac(), srecHandshake(), srecProtocol(), update_action(), usb_device_endpoint_is_configured(), usb_device_endpoint_read_buffer_job(), and usb_device_endpoint_write_buffer_job().
|
static |
volatile uint8_t press_count = DEVICE_SILENT |
button press count
Referenced by app_disconnected_event_handler(), and main().