Microchip® Advanced Software Framework

thirdparty/wireless/ble_sdk/ble_profiles/pxp_reporter/pxp_reporter.c File Reference

Proximity Reporter Profile.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <string.h>
#include "at_ble_api.h"
#include "ble_manager.h"
#include "pxp_reporter.h"
#include "immediate_alert.h"
#include "link_loss.h"
#include "tx_power.h"
#include "ble_utils.h"

Functions

void pxp_reporter_adv (void)
 reporter advertisement initialization and adv start More...
 
at_ble_status_t pxp_reporter_char_changed_handler (void *params)
 Characteristic change handler function More...
 
at_ble_status_t pxp_reporter_connected_state_handler (void *params)
 reporter connected state handler More...
 
at_ble_status_t pxp_reporter_disconnect_event_handler (void *params)
 reporter disconnected state handler More...
 
void pxp_reporter_init (void *param)
 reporter Initialization which initializes service,defines and start adv More...
 
at_ble_status_t pxp_service_define (void)
 of profile services to the attribute data base based on pathloss More...
 
void pxp_service_init (void)
 Initializations of profile services based on pathloss option. More...
 
void register_linkloss_handler (reporter_callback_t linkloss_fn)
 registering the linkloss handler of the application More...
 
void register_pathloss_handler (reporter_callback_t pathloss_fn)
 registering the path loss handler of the application More...
 
void register_state_handler (reporter_state_callback_t state_fn)
 function which register the application state call back handler More...
 

Variables

reporter_state_callback_t connected_cb
 
gatt_service_handler_t ias_handle
 
reporter_callback_t linkloss_cb
 
uint8_t linkloss_current_alert_level
 Alert value used for Linkloss service. More...
 
gatt_service_handler_t lls_handle
 
uint8_t pathloss_alert_value = INVALID_IAS_PARAM
 Alert value used for immediate alert service helps in pathloss. More...
 
reporter_callback_t pathloss_cb
 Callback handlers for linkloss and pathloss. More...
 
static const ble_gap_event_cb_t pxp_gap_handle
 
static const
ble_gatt_server_event_cb_t 
pxp_gatt_server_handle
 
uint8_t scan_rsp_data [SCAN_RESP_LEN] = {0x09, 0xff, 0x00, 0x06, 0xd6, 0xb2, 0xf0, 0x05, 0xf0, 0xf8}
 Scan response data. More...
 
gatt_service_handler_t txps_handle
 

void pxp_reporter_adv ( void  )

reporter advertisement initialization and adv start

sets the advertisement data and starts advertisement

Referenced by pxp_reporter_init().

at_ble_status_t pxp_reporter_char_changed_handler ( void *  params)
at_ble_status_t pxp_reporter_connected_state_handler ( void *  params)

reporter connected state handler

connection state handler

References ALL_UNUSED, at_ble_characteristic_value_get(), AT_BLE_SUCCESS, connected_cb, DBG_LOG, len, linkloss_current_alert_level, pathloss_alert_value, and status.

at_ble_status_t pxp_reporter_disconnect_event_handler ( void *  params)
void pxp_reporter_init ( void *  param)

reporter Initialization which initializes service,defines and start adv

Initialize the profile, includes all initializations and start up routines of the profiles.

Referenced by main().

at_ble_status_t pxp_service_define ( void  )

of profile services to the attribute data base based on pathloss

profile services definition to the attribute data base

Referenced by pxp_reporter_init().

void pxp_service_init ( void  )

Initializations of profile services based on pathloss option.

Initialize the services of the profile.

Initializing the mandatory linkloss service of proximity reporter

Initializing the optional services for pathloss feature of proximity reporter

Referenced by pxp_reporter_init().

void register_linkloss_handler ( reporter_callback_t  linkloss_fn)

registering the linkloss handler of the application

function which register the application alerting function for linkloss to the profile

Referenced by ble_pxp_profile_init(), and main().

void register_pathloss_handler ( reporter_callback_t  pathloss_fn)

registering the path loss handler of the application

function which register the application alerting function for pathloss to the profile

Referenced by ble_pxp_profile_init(), and main().

void register_state_handler ( reporter_state_callback_t  state_fn)

function which register the application state call back handler

Parameters
[in]callback function of the application for connection state

References connected_cb.

Referenced by main().

uint8_t linkloss_current_alert_level
uint8_t pathloss_alert_value = INVALID_IAS_PARAM

Alert value used for immediate alert service helps in pathloss.

Referenced by pxp_reporter_char_changed_handler(), and pxp_reporter_connected_state_handler().

reporter_callback_t pathloss_cb

Callback handlers for linkloss and pathloss.

Referenced by pxp_reporter_char_changed_handler(), and register_pathloss_handler().

const ble_gap_event_cb_t pxp_gap_handle
static
Initial value:
= {
}
at_ble_status_t pxp_reporter_connected_state_handler(void *params)
reporter connected state handler
Definition: thirdparty/wireless/ble_sdk/ble_profiles/pxp_reporter/pxp_reporter.c:211
at_ble_status_t pxp_reporter_disconnect_event_handler(void *params)
reporter disconnected state handler
Definition: thirdparty/wireless/ble_sdk/ble_profiles/pxp_reporter/pxp_reporter.c:235
const ble_gatt_server_event_cb_t pxp_gatt_server_handle
static
Initial value:
= {
.characteristic_changed = pxp_reporter_char_changed_handler
}
at_ble_status_t pxp_reporter_char_changed_handler(void *params)
Characteristic change handler function
Definition: thirdparty/wireless/ble_sdk/ble_profiles/pxp_reporter/pxp_reporter.c:181
uint8_t scan_rsp_data[SCAN_RESP_LEN] = {0x09, 0xff, 0x00, 0x06, 0xd6, 0xb2, 0xf0, 0x05, 0xf0, 0xf8}

Scan response data.