Microchip® Advanced Software Framework

find_me_target.h File Reference

Find Me Profile declarations.

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

Macros

#define ADV_DATA_LEN   (18)
 ADV_DATA_LEN. More...
 
#define ADV_TYPE_LEN   (0x01)
 ADV_TYPE_LEN. More...
 
#define APP_FMP_ADV_TIMEOUT   (655) /* 10 min */
 APP_FMP_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out. More...
 
#define APP_FMP_FAST_ADV   (1600) /* 1000 ms */
 PATHLOSS which defines if the user wants pathloss functionality. More...
 
#define FMP_ADV_DATA_NAME_DATA   ("ATMEL-FMP")
 
#define FMP_ADV_DATA_NAME_LEN   (9)
 FMP_ADV_DATA_NAME_LEN the length of the device name. More...
 
#define FMP_ADV_DATA_NAME_TYPE   (0x09)
 FMP_ADV_DATA_NAME_TYPE the gap ad data type. More...
 
#define IAL_ADV_DATA_UUID_LEN   (2)
 IAL_ADV_DATA_UUID_LEN the size of IAL service uuid. More...
 
#define IAL_ADV_DATA_UUID_TYPE   (0x03)
 IAL_ADV_DATA_UUID_TYPE the total sizeof IAL service uuid. More...
 
#define SCAN_RESP_LEN   (10)
 scan_resp_len is the length of the scan response data More...
 

Typedefs

typedef void(* find_me_callback_t )(uint8_t)
 

Functions

void fmp_target_adv (void)
 sets the advertisement data and starts advertisement More...
 
at_ble_status_t fmp_target_char_changed_handler (void *params)
 character changed handler More...
 
at_ble_status_t fmp_target_connected_state_handler (void *params)
 connection state handler called when device goes on connected state More...
 
at_ble_status_t fmp_target_disconnect_event_handler (void *params)
 disconnection event handler More...
 
void fmp_target_init (void *param)
 Initialize the profile, includes all initializations and start up routines of the profiles. More...
 
at_ble_status_t fmp_target_service_define (void)
 profile services definition to the attribute data base More...
 
void fmp_target_service_init (void)
 Initialize the services of the profile. More...
 
void register_find_me_handler (find_me_callback_t immediate_alert_fn)
 function which register the application alerting function for Immediate Alert to the profile More...
 

#define ADV_DATA_LEN   (18)

ADV_DATA_LEN.

#define ADV_TYPE_LEN   (0x01)

ADV_TYPE_LEN.

#define APP_FMP_ADV_TIMEOUT   (655) /* 10 min */

APP_FMP_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out.

Referenced by fmp_target_adv(), and fmp_target_disconnect_event_handler().

#define APP_FMP_FAST_ADV   (1600) /* 1000 ms */

PATHLOSS which defines if the user wants pathloss functionality.

APP_FMP_FAST_ADV between 0x0020 and 0x4000 in 0.625 ms units (20ms to 10.24s).

Referenced by fmp_target_adv(), and fmp_target_disconnect_event_handler().

#define FMP_ADV_DATA_NAME_DATA   ("ATMEL-FMP")
#define FMP_ADV_DATA_NAME_LEN   (9)

FMP_ADV_DATA_NAME_LEN the length of the device name.

#define FMP_ADV_DATA_NAME_TYPE   (0x09)

FMP_ADV_DATA_NAME_TYPE the gap ad data type.

#define IAL_ADV_DATA_UUID_LEN   (2)

IAL_ADV_DATA_UUID_LEN the size of IAL service uuid.

#define IAL_ADV_DATA_UUID_TYPE   (0x03)

IAL_ADV_DATA_UUID_TYPE the total sizeof IAL service uuid.

#define SCAN_RESP_LEN   (10)

scan_resp_len is the length of the scan response data

typedef void(* find_me_callback_t)(uint8_t)

void fmp_target_adv ( void  )

sets the advertisement data and starts advertisement

Parameters
[in]void
Precondition
Must be called after ref fmp_target_service_init
Returns
void

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)

character changed handler

Parameters
[in]at_ble_characteristic_changed_twhich includes handle,new value
Precondition
Must be called when character change event occurred
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

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)

connection state handler called when device goes on connected state

Parameters
[in]at_ble_connected_twhich includes the connection parameters
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

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)

disconnection event handler

Parameters
[in]at_ble_disconencted_twhich includes the connection parameters like handle,reason for disconnection
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

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)

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

Parameters
[in]void
Precondition
Must be called after ble_init
Returns
void

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  )

profile services definition to the attribute data base

Parameters
[in]void
Precondition
Must be called after ref fmp_target_service_init
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

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  )

Initialize the services of the profile.

Parameters
[in]void
Precondition
Must be called before fmp_target_service_define
Returns
void

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)

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

Parameters
[in]callback function of the application for immediate alert value

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

References immediate_alert_cb.

Referenced by main().