Proximity Reporter Profile Application.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "console_serial.h"
#include "at_ble_api.h"
#include "platform.h"
#include "timer_hw.h"
#include "conf_extint.h"
#include "ble_utils.h"
#include "ble_manager.h"
#include "immediate_alert.h"
#include "link_loss.h"
#include "tx_power.h"
#include "pxp_reporter.h"
#include "pxp_reporter_app.h"
Macros | |
#define | APP_TIMER_EVENT_ID (1) |
Functions | |
static void | app_connected_state (bool state) |
function called by the profile to notify the app connected More... | |
static void | app_linkloss_alert (uint8_t alert_val) |
Alerting function on link loss alert. More... | |
static void | app_pathloss_alert (uint8_t alert_val) |
Alerting function on link loss alert. More... | |
int | main (void) |
Proximity Reporter Application main function. More... | |
static at_ble_status_t | pxp_reporter_custom_event (void *param) |
void | timer_callback_handler (void) |
Timer callback handler called on timer expiry. More... | |
Variables | |
user_custom_event_t | app_timer_event |
bool | pxp_led_state = true |
static const ble_custom_event_cb_t | pxp_reporter_custom_event_cb |
uint8_t | timer_interval = INIT_TIMER_INTERVAL |
Timer interval for timer used for led blinking. More... | |
#define APP_TIMER_EVENT_ID (1) |
Referenced by pxp_reporter_custom_event().
|
static |
function called by the profile to notify the app connected
[in] | state | true for notification |
References hw_timer_stop(), and pxp_led_state.
Referenced by main().
|
static |
Alerting function on link loss alert.
[in] | alert | level of alert level characteristic of linkloss service |
References DBG_LOG, hw_timer_start(), hw_timer_stop(), LL_INTERVAL_FAST, LL_INTERVAL_MEDIUM, LLS_HIGH_ALERT, LLS_MILD_ALERT, LLS_NO_ALERT, pxp_led_state, and timer_interval.
Referenced by main().
|
static |
Alerting function on link loss alert.
[in] | alert | level of alert level characteristic of linkloss service |
References DBG_LOG, hw_timer_start(), hw_timer_stop(), IAS_HIGH_ALERT, IAS_MID_ALERT, IAS_NO_ALERT, PL_INTERVAL_FAST, PL_INTERVAL_MEDIUM, pxp_led_state, and timer_interval.
Referenced by main().
int main | ( | void | ) |
Proximity Reporter Application main function.
References app_connected_state(), app_linkloss_alert(), app_pathloss_alert(), 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(), NULL, pxp_reporter_init(), REGISTER_CALL_BACK, register_linkloss_handler(), register_pathloss_handler(), register_state_handler(), serial_console_init(), system_init(), and timer_callback_handler().
|
static |
References APP_TIMER_EVENT_ID, AT_BLE_FAILURE, AT_BLE_SUCCESS, hw_timer_start(), pxp_led_state, and timer_interval.
void timer_callback_handler | ( | void | ) |
user_custom_event_t app_timer_event |
Referenced by app_connected_state(), app_linkloss_alert(), app_pathloss_alert(), and pxp_reporter_custom_event().
|
static |
uint8_t timer_interval = INIT_TIMER_INTERVAL |
Timer interval for timer used for led blinking.
Referenced by app_linkloss_alert(), app_pathloss_alert(), and pxp_reporter_custom_event().