Proximity Monitor Profile Application.
Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "platform.h"
#include "console_serial.h"
#include "pxp_monitor_app.h"
#include "immediate_alert.h"
#include "tx_power.h"
#include "link_loss.h"
#include "pxp_reporter.h"
Macros | |
#define | APP_BUTTON_EVENT_ID (2) |
#define | APP_INVALID_EVENT_ID (0) |
#define | APP_TIMER_EVENT_ID (1) |
Functions | |
void | button_cb (void) |
int | main (void) |
static void | pxp_app_init (void) |
Proximity Application initialization start the device scanning process. More... | |
static void | pxp_monitor_app_button_event (void) |
static at_ble_status_t | pxp_monitor_app_custom_event (void *param) |
static void | pxp_monitor_app_timer_event (void) |
static void | rssi_update (at_ble_handle_t conn_handle) |
Check for Link Loss and Path Loss alert check for Low Alert value if crossed write Low Alert value to Immediate Alert Service. More... | |
static void | timer_callback_handler (void) |
Variables | |
pxp_current_alert_t | alert_level = PXP_NO_ALERT |
user_custom_event_t | app_custom_event [2] |
volatile bool | app_init_done = false |
volatile bool | app_timer_done = false |
ble_connected_dev_info_t | ble_dev_info [BLE_MAX_DEVICE_CONNECTION] |
Initialize the service with its included service, characteristics, and descriptors. More... | |
volatile bool | button_pressed = false |
Determine if button is pressed. More... | |
gatt_ias_char_handler_t | ias_handle |
gatt_lls_char_handler_t | lls_handle |
at_ble_addr_t | peer_addr = {AT_BLE_ADDRESS_PUBLIC, {0x03, 0x18, 0xf0, 0x05, 0xf0, 0xf8}} |
uint8_t | pxp_connect_request_flag |
static const ble_custom_event_cb_t | pxp_monitor_custom_event_cb |
int8_t | rssi_power = 0 |
gatt_txps_char_handler_t | txps_handle |
#define APP_BUTTON_EVENT_ID (2) |
Referenced by pxp_monitor_app_custom_event().
#define APP_INVALID_EVENT_ID (0) |
#define APP_TIMER_EVENT_ID (1) |
Referenced by pxp_monitor_app_custom_event().
void button_cb | ( | void | ) |
References app_init_done, at_ble_event_user_defined_post(), and button_pressed.
int main | ( | void | ) |
References app_init_done, BLE_CUSTOM_EVENT_TYPE, ble_device_init(), ble_event_task(), ble_mgr_events_callback_handler(), board_init(), DBG_LOG, hw_timer_init(), hw_timer_register_callback(), hw_timer_start(), hw_timer_stop(), NULL, pxp_app_init(), pxp_monitor_init(), REGISTER_CALL_BACK, register_hw_timer_start_func_cb(), register_hw_timer_stop_func_cb(), serial_console_init(), sw_timer_start(), sw_timer_stop(), SwTimerCreate(), system_init(), SYSTEM_RunTasks(), and timer_callback_handler().
|
static |
Proximity Application initialization start the device scanning process.
References AT_BLE_FAILURE, AT_BLE_INVALID_PARAM, DBG_LOG, and gap_dev_scan().
Referenced by main().
|
static |
References app_timer_done, at_ble_disconnect(), at_ble_encryption_start(), AT_BLE_TERMINATED_BY_USER, button_pressed, gatt_lls_char_handler::char_handle, gatt_ias_char_handler::char_handle, DBG_LOG, ias_alert_level_write(), IAS_HIGH_ALERT, IAS_MID_ALERT, IAS_NO_ALERT, lls_alert_level_write(), LLS_HIGH_ALERT, LLS_MILD_ALERT, LLS_NO_ALERT, and pxp_monitor_service_discover().
Referenced by pxp_monitor_app_custom_event().
|
static |
|
static |
References app_timer_done, count, hw_timer_start(), pxp_connect_request_flag, PXP_DEV_CONNECTED, PXP_RSSI_UPDATE_INTERVAL, rssi_power, rssi_update(), and sw_timer_start().
Referenced by pxp_monitor_app_custom_event().
|
static |
Check for Link Loss and Path Loss alert check for Low Alert value if crossed write Low Alert value to Immediate Alert Service.
High Alert value if crossed write High Alert value to IAS service
[in] | conn_handle | Connection handle of a connected device |
References alert_level, app_timer_done, at_ble_rx_power_get(), AT_BLE_SUCCESS, gatt_ias_char_handler::char_handle, DBG_LOG, DBG_LOG_CONT, ias_alert_level_write(), IAS_HIGH_ALERT, IAS_MID_ALERT, IAS_NO_ALERT, PXP_HIGH_ALERT, PXP_HIGH_ALERT_RANGE, PXP_LOW_ALERT_RANGE, PXP_MID_ALERT, PXP_NO_ALERT, and rssi_power.
Referenced by pxp_monitor_app_timer_event().
|
static |
References app_timer_done, at_ble_event_user_defined_post(), hw_timer_stop(), and sw_timer_stop().
pxp_current_alert_t alert_level = PXP_NO_ALERT |
Referenced by rssi_update().
user_custom_event_t app_custom_event[2] |
ble_connected_dev_info_t ble_dev_info[BLE_MAX_DEVICE_CONNECTION] |
Initialize the service with its included service, characteristics, and descriptors.
[in] | scan_param | gatt service information |
gatt_ias_char_handler_t ias_handle |
gatt_lls_char_handler_t lls_handle |
at_ble_addr_t peer_addr = {AT_BLE_ADDRESS_PUBLIC, {0x03, 0x18, 0xf0, 0x05, 0xf0, 0xf8}} |
Referenced by app_connected_cb().
uint8_t pxp_connect_request_flag |
|
static |
int8_t rssi_power = 0 |
Referenced by pxp_monitor_app_timer_event(), and rssi_update().
gatt_txps_char_handler_t txps_handle |