Microchip® Advanced Software Framework

pas_app.c File Reference

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 void app_alert_status_notify ( uint8_t *  data,
uint8_t  len 
)
static

displays alert status value came in notification

Parameters
[in]data
[in]len

References DBG_LOG, DBG_LOG_DEV, and display_alert_status_info().

Referenced by main().

static void app_alert_status_read ( uint8_t *  data,
uint8_t  len 
)
static

displays alerts status value came in read response

Parameters
[in]data
[in]len

References DBG_LOG, DBG_LOG_DEV, and display_alert_status_info().

Referenced by main().

static at_ble_status_t app_connected_event_handler ( void *  params)
static

app_connected_state blemanager notifies the application about state

Parameters
[in]at_ble_connected_t

References ALL_UNUSED, app_state, and AT_BLE_SUCCESS.

static at_ble_status_t app_disconnected_event_handler ( void *  params)
static

app_connected_state ble manager notifies the application about state

Parameters
[in]connected

References ALL_UNUSED, app_state, AT_BLE_SUCCESS, DEVICE_SILENT, pas_client_adv(), and press_count.

static void app_ringer_setting_notify ( uint8_t *  data,
uint8_t  len 
)
static

displays ringer setting value came in notification

Parameters
[in]data
[in]len

References DBG_LOG, DBG_LOG_DEV, and display_ringer_setting_info().

Referenced by main().

static void app_ringer_setting_read ( uint8_t *  data,
uint8_t  len 
)
static

displays ringer setting value came in read response

Parameters
[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 void display_alert_status_info ( uint8_t *  data)
static

display alert status info notifies the application about state

Parameters
[in]data

References BIT0_MASK, BIT1_MASK, BIT2_MASK, and DBG_LOG.

Referenced by app_alert_status_notify(), and app_alert_status_read().

static void display_ringer_setting_info ( uint8_t *  data)
static

display alert status info notifies the application about state

Parameters
[in]data

References DBG_LOG_CONT, RINGER_NORMAL, and RINGER_SILENT.

Referenced by app_ringer_setting_notify(), and app_ringer_setting_read().

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

Timer Callback.

user_custom_event_t app_button_event
Initial value:
=
{
.bptr = NULL
}
#define NULL
Definition: nm_bsp.h:64
#define APP_BUTTON_EVENT_ID
Button event ID.
Definition: pas_app.h:57
const ble_gap_event_cb_t app_gap_handle
static
Initial value:
= {
}
static at_ble_status_t app_disconnected_event_handler(void *params)
app_connected_state ble manager notifies the application about state
Definition: pas_app.c:287
static at_ble_status_t app_connected_event_handler(void *params)
app_connected_state blemanager notifies the application about state
Definition: pas_app.c:276
volatile bool app_init_done = false
bool appp_exec = true

Referenced by main().

const ble_custom_event_cb_t pas_custom_event_cb
static
Initial value:
= {
.custom_event = pas_custom_event
}
static at_ble_status_t pas_custom_event(void *param)
Definition: pas_app.c:212
volatile uint8_t press_count = DEVICE_SILENT

button press count

Referenced by app_disconnected_event_handler(), and main().