Microchip® Advanced Software Framework

thirdparty/wireless/ble_sdk/apps/pxp_reporter/pxp_reporter_app.c File Reference

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)

static void app_connected_state ( bool  state)
static

function called by the profile to notify the app connected

Parameters
[in]statetrue for notification

References hw_timer_stop(), and pxp_led_state.

Referenced by main().

static void app_linkloss_alert ( uint8_t  alert_val)
static

Alerting function on link loss alert.

Parameters
[in]alertlevel 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 void app_pathloss_alert ( uint8_t  alert_val)
static

Alerting function on link loss alert.

Parameters
[in]alertlevel 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().

static at_ble_status_t pxp_reporter_custom_event ( void *  param)
static
void timer_callback_handler ( void  )

Timer callback handler called on timer expiry.

callback handler called on timer expiry

Timer Callback.

Timer call back handler called on timer expiry.

user_custom_event_t app_timer_event
Initial value:
=
{
.bptr = NULL
}
#define APP_TIMER_EVENT_ID
Definition: thirdparty/wireless/ble_sdk/apps/pxp_reporter/pxp_reporter_app.c:180
#define NULL
Definition: def.h:47
const ble_custom_event_cb_t pxp_reporter_custom_event_cb
static
Initial value:
= {
.custom_event = pxp_reporter_custom_event
}
static at_ble_status_t pxp_reporter_custom_event(void *param)
Definition: thirdparty/wireless/ble_sdk/apps/pxp_reporter/pxp_reporter_app.c:274
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().