Microchip® Advanced Software Framework

pxp_reporter.c File Reference

Proximity Reporter Profile.

Copyright (c) 2017-2019 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

at_ble_status_t pxp_disconnect_event_handler (at_ble_disconnected_t *disconnect)
 reporter disconnected state handler function called after More...
 
void pxp_reporter_adv (void)
 reporter advertisement initialization and adv start More...
 
at_ble_status_t pxp_reporter_char_changed_handler (at_ble_characteristic_changed_t *char_handle)
 Characteristic change handler function More...
 
at_ble_status_t pxp_reporter_connected_state_handler (at_ble_connected_t *conn_params)
 reporter connected state handler function called after 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_conn_update_handler (reporter_callback_t conn_update_fn)
 function which register notification callback on BLE connection update 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...
 

Variables

reporter_callback_t conn_update_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...
 
uint8_t scan_rsp_data [SCAN_RESP_LEN] = {0x09, 0xff, 0x00, 0x06, 0xd6, 0xb2, 0xf0, 0x05, 0xf0, 0xf8}
 led_state the state of the led More...
 
gatt_service_handler_t txps_handle
 

at_ble_status_t pxp_reporter_char_changed_handler ( at_ble_characteristic_changed_t char_handle)
at_ble_status_t pxp_reporter_connected_state_handler ( at_ble_connected_t conn_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.

References pxp_reporter_adv(), pxp_service_define(), and pxp_service_init().

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

References AT_BLE_SUCCESS, DBG_LOG, ias_primary_service_define(), lls_primary_service_define(), and txps_primary_service_define().

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

References init_immediate_alert_service(), init_linkloss_service(), and init_tx_power_service().

Referenced by pxp_reporter_init().

void register_conn_update_handler ( reporter_callback_t  conn_update_fn)

function which register notification callback on BLE connection update

Parameters
[in]callback function of the application for connection_update.

References conn_update_cb.

Referenced by ble_pxp_profile_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

References linkloss_cb.

Referenced by ble_pxp_profile_init().

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

References pathloss_cb.

Referenced by ble_pxp_profile_init().

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().

uint8_t scan_rsp_data[SCAN_RESP_LEN] = {0x09, 0xff, 0x00, 0x06, 0xd6, 0xb2, 0xf0, 0x05, 0xf0, 0xf8}

led_state the state of the led

Scan response data