Microchip® Advanced Software Framework

find_me_target.c File Reference

Find Me Target Profile.

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

#include <asf.h>
#include "ble_manager.h"
#include "find_me_target.h"
#include "immediate_alert.h"

Functions

void fmp_target_adv (void)
 me advertisement initialization and adv start More...
 
at_ble_status_t fmp_target_char_changed_handler (void *params)
 alert service characteristic change handler function More...
 
at_ble_status_t fmp_target_connected_state_handler (void *params)
 me profile connected state handler function More...
 
at_ble_status_t fmp_target_disconnect_event_handler (void *params)
 me profile disconnected state handler function More...
 
void fmp_target_init (void *param)
 me Profile service initialization, declarations and advertisement More...
 
at_ble_status_t fmp_target_service_define (void)
 of profile immediate alert services to the attribute data base More...
 
void fmp_target_service_init (void)
 Initializations of find me profile services. More...
 
void register_find_me_handler (find_me_callback_t immediate_alert_fn)
 registering the path loss handler of the application More...
 

Variables

static const ble_gap_event_cb_t fmp_gap_handle
 
static const
ble_gatt_server_event_cb_t 
fmp_gatt_server_handle
 
gatt_service_handler_t ias_handle
 
find_me_callback_t immediate_alert_cb
 Callback handlers for Immediate Alert service. More...
 
uint8_t immediate_alert_value = INVALID_IAS_PARAM
 Alert value used for immediate alert service. More...
 
uint8_t scan_rsp_data [SCAN_RESP_LEN] = {0x09, 0xff, 0x00, 0x06, 0xd6, 0xb2, 0xf0, 0x05, 0xf0, 0xf8}
 Scan response data. More...
 

void fmp_target_adv ( void  )

me advertisement initialization and adv start

sets the advertisement data and starts advertisement

References APP_FMP_ADV_TIMEOUT, APP_FMP_FAST_ADV, AT_BLE_ADV_FP_ANY, AT_BLE_ADV_GEN_DISCOVERABLE, at_ble_adv_start(), AT_BLE_ADV_TYPE_UNDIRECTED, AT_BLE_SUCCESS, ble_advertisement_data_set(), DBG_LOG, and NULL.

Referenced by fmp_target_init().

at_ble_status_t fmp_target_char_changed_handler ( void *  params)

alert service characteristic change handler function

character changed handler

References AT_BLE_SUCCESS, ias_set_alert_value(), immediate_alert_cb, immediate_alert_value, and INVALID_IAS_PARAM.

at_ble_status_t fmp_target_connected_state_handler ( void *  params)

me profile connected state handler function

connection state handler called when device goes on connected state

References ALL_UNUSED, at_ble_characteristic_value_get(), AT_BLE_SUCCESS, DBG_LOG, immediate_alert_cb, immediate_alert_value, and INVALID_IAS_PARAM.

at_ble_status_t fmp_target_disconnect_event_handler ( void *  params)

me profile disconnected state handler function

disconnection event handler

References ALL_UNUSED, APP_FMP_ADV_TIMEOUT, APP_FMP_FAST_ADV, AT_BLE_ADV_FP_ANY, AT_BLE_ADV_GEN_DISCOVERABLE, at_ble_adv_start(), AT_BLE_ADV_TYPE_UNDIRECTED, AT_BLE_SUCCESS, DBG_LOG, and NULL.

void fmp_target_init ( void *  param)

me Profile service initialization, declarations and advertisement

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

References ALL_UNUSED, BLE_GAP_EVENT_TYPE, BLE_GATT_SERVER_EVENT_TYPE, ble_mgr_events_callback_handler(), fmp_target_adv(), fmp_target_service_define(), fmp_target_service_init(), and REGISTER_CALL_BACK.

Referenced by main().

at_ble_status_t fmp_target_service_define ( void  )

of profile immediate alert services to the attribute data base

profile services definition to the attribute data base

References AT_BLE_SUCCESS, DBG_LOG, and ias_primary_service_define().

Referenced by fmp_target_init().

void fmp_target_service_init ( void  )

Initializations of find me profile services.

Initialize the services of the profile.

Initializing the mandatory immediate alert service of find me profile

References init_immediate_alert_service().

Referenced by fmp_target_init().

void register_find_me_handler ( find_me_callback_t  immediate_alert_fn)

registering the path loss handler of the application

function which register the application alerting function for Immediate Alert to the profile

References immediate_alert_cb.

Referenced by main().

const ble_gap_event_cb_t fmp_gap_handle
static
Initial value:
= {
}
at_ble_status_t fmp_target_connected_state_handler(void *params)
me profile connected state handler function
Definition: find_me_target.c:161
at_ble_status_t fmp_target_disconnect_event_handler(void *params)
me profile disconnected state handler function
Definition: find_me_target.c:192
const ble_gatt_server_event_cb_t fmp_gatt_server_handle
static
Initial value:
= {
.characteristic_changed = fmp_target_char_changed_handler
}
at_ble_status_t fmp_target_char_changed_handler(void *params)
alert service characteristic change handler function
Definition: find_me_target.c:138
find_me_callback_t immediate_alert_cb

Callback handlers for Immediate Alert service.

Referenced by fmp_target_char_changed_handler(), fmp_target_connected_state_handler(), and register_find_me_handler().

uint8_t immediate_alert_value = INVALID_IAS_PARAM

Alert value used for immediate alert service.

Referenced by fmp_target_char_changed_handler(), and fmp_target_connected_state_handler().

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

Scan response data.