Microchip® Advanced Software Framework

scan_parameter_app.c File Reference

Scan parameters Service - 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 "ble_utils.h"
#include "conf_extint.h"
#include "scan_param.h"
#include "ble_manager.h"
#include "scan_parameter_app.h"

Macros

#define APP_TIMER_EVENT_ID   (1)
 
#define SCAN_PRAM_UPDATE_INTERVAL   (3)
 

Functions

static at_ble_status_t ble_connected_app_event (void *param)
 
static at_ble_status_t ble_disconnected_app_event (void *param)
 
static at_ble_status_t ble_encryption_app_event (void *param)
 
static at_ble_status_t ble_paired_app_event (void *param)
 
void button_cb (void)
 
int main (void)
 Parameter Application main function More...
 
static at_ble_status_t sps_char_changed_cb (void *param)
 Characteristic change handler function More...
 
static at_ble_status_t sps_custom_event (void *param)
 
static at_ble_status_t sps_notification_confirmed_cb (void *param)
 
static at_ble_status_t sps_service_advertise (void)
 
void timer_callback_handler (void)
 callback handler called on timer expiry More...
 

Variables

volatile bool app_init_done = false
 
user_custom_event_t app_timer_event
 
static const ble_gap_event_cb_t ble_scan_param_app_gap_cb
 
static const
ble_gatt_server_event_cb_t 
ble_scan_param_app_gatt_server_cb
 
bool volatile notification_cfm_flag = true
 
uint16_t scan_interval_window [2]
 
uint8_t scan_refresh
 
uint8_t scan_refresh_value = 0
 
static const ble_custom_event_cb_t sps_custom_event_cb
 
sps_gatt_service_handler_t sps_service_handler
 

#define APP_TIMER_EVENT_ID   (1)

Referenced by sps_custom_event().

#define SCAN_PRAM_UPDATE_INTERVAL   (3)

static at_ble_status_t ble_connected_app_event ( void *  param)
static
static at_ble_status_t ble_disconnected_app_event ( void *  param)
static
static at_ble_status_t ble_encryption_app_event ( void *  param)
static
static at_ble_status_t ble_paired_app_event ( void *  param)
static
void button_cb ( void  )
static at_ble_status_t sps_char_changed_cb ( void *  param)
static

Characteristic change handler function

References sps_char_changed_event().

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

callback handler called on timer expiry

Timer Callback.

Timer call back handler called on timer expiry.

References app_init_done, at_ble_event_user_defined_post(), and hw_timer_stop().

volatile bool app_init_done = false
user_custom_event_t app_timer_event
Initial value:
=
{
.bptr = NULL
}
#define NULL
Definition: def.h:47
#define APP_TIMER_EVENT_ID
Definition: scan_parameter_app.c:175
const ble_gap_event_cb_t ble_scan_param_app_gap_cb
static
Initial value:
= {
.disconnected = ble_disconnected_app_event,
.pair_done = ble_paired_app_event,
.encryption_status_changed = ble_encryption_app_event
}
static at_ble_status_t ble_encryption_app_event(void *param)
Definition: scan_parameter_app.c:272
static at_ble_status_t ble_connected_app_event(void *param)
Definition: scan_parameter_app.c:297
static at_ble_status_t ble_disconnected_app_event(void *param)
Definition: scan_parameter_app.c:286
static at_ble_status_t ble_paired_app_event(void *param)
Definition: scan_parameter_app.c:258
const ble_gatt_server_event_cb_t ble_scan_param_app_gatt_server_cb
static
Initial value:
= {
.notification_confirmed = sps_notification_confirmed_cb,
.characteristic_changed = sps_char_changed_cb
}
static at_ble_status_t sps_char_changed_cb(void *param)
Characteristic change handler function
Definition: scan_parameter_app.c:314
static at_ble_status_t sps_notification_confirmed_cb(void *param)
Definition: scan_parameter_app.c:321
bool volatile notification_cfm_flag = true
uint16_t scan_interval_window[2]

Referenced by main(), and sps_char_changed_event().

uint8_t scan_refresh

Referenced by main(), and sps_init_service().

uint8_t scan_refresh_value = 0
const ble_custom_event_cb_t sps_custom_event_cb
static
Initial value:
= {
.custom_event = sps_custom_event
}
static at_ble_status_t sps_custom_event(void *param)
Definition: scan_parameter_app.c:207
sps_gatt_service_handler_t sps_service_handler