Microchip® Advanced Software Framework

find_me_locator.c File Reference

Find Me Locator Profile.

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

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

Functions

at_ble_status_t fmp_locator_characteristic_found_handler (void *params)
 Handles all Discovered characteristics of a given handler in a connected device. More...
 
at_ble_status_t fmp_locator_connected_state_handler (void *params)
 me profile connected state handler function More...
 
at_ble_status_t fmp_locator_disconnect_event_handler (void *params)
 me profile disconnected state handler function More...
 
at_ble_status_t fmp_locator_discovery_complete_handler (void *params)
 Discover all Characteristics supported for Immediate alert Service of a connected device. More...
 
void fmp_locator_init (void)
 me Profile service initialization, declarations and advertisement More...
 
at_ble_status_t fmp_locator_pair_done_handler (void *params)
 
at_ble_status_t fmp_locator_service_discover (at_ble_handle_t handle)
 Discover all services. More...
 
at_ble_status_t fmp_locator_service_found_handler (void *param)
 Service found handler invoked by ble manager. More...
 

Variables

static const ble_gap_event_cb_t fmp_gap_handle
 
static const
ble_gatt_client_event_cb_t 
fmp_gatt_client_handle
 
uint8_t ias_char_data [MAX_IAS_CHAR_SIZE]
 
gatt_ias_char_handler_t ias_handle
 
uint8_t immediate_alert_value = INVALID_IAS_PARAM
 Alert value used for immediate alert service. More...
 

at_ble_status_t fmp_locator_characteristic_found_handler ( void *  params)
at_ble_status_t fmp_locator_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_SUCCESS, ble_check_iscentral(), fmp_locator_service_discover(), and status.

at_ble_status_t fmp_locator_disconnect_event_handler ( void *  params)

me profile disconnected state handler function

disconnection event handler

References ALL_UNUSED, and AT_BLE_SUCCESS.

void fmp_locator_init ( void  )

me Profile service initialization, declarations and advertisement

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

References BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, ble_mgr_events_callback_handler(), and REGISTER_CALL_BACK.

Referenced by main().

at_ble_status_t fmp_locator_service_discover ( at_ble_handle_t  handle)

Discover all services.

Parameters
[in]handleconnection handle
Returns
AT_BLE_SUCCESS operation programmed successfully.
AT_BLE_INVALID_PARAM incorrect parameter.
AT_BLE_FAILURE Generic error.

References at_ble_primary_service_discover_all(), AT_BLE_SUCCESS, DBG_LOG, DBG_LOG_DEV, GATT_DISCOVERY_ENDING_HANDLE, GATT_DISCOVERY_STARTING_HANDLE, and status.

Referenced by fmp_locator_connected_state_handler(), and fmp_locator_pair_done_handler().

const ble_gap_event_cb_t fmp_gap_handle
static
Initial value:
= {
.encryption_status_changed = fmp_locator_pair_done_handler
}
at_ble_status_t fmp_locator_connected_state_handler(void *params)
me profile connected state handler function
Definition: find_me_locator.c:253
at_ble_status_t fmp_locator_pair_done_handler(void *params)
Definition: find_me_locator.c:101
at_ble_status_t fmp_locator_disconnect_event_handler(void *params)
me profile disconnected state handler function
Definition: find_me_locator.c:281
const ble_gatt_client_event_cb_t fmp_gatt_client_handle
static
Initial value:
= {
.primary_service_found = fmp_locator_service_found_handler,
}
at_ble_status_t fmp_locator_characteristic_found_handler(void *params)
Handles all Discovered characteristics of a given handler in a connected device.
Definition: find_me_locator.c:165
at_ble_status_t fmp_locator_discovery_complete_handler(void *params)
Discover all Characteristics supported for Immediate alert Service of a connected device...
Definition: find_me_locator.c:195
at_ble_status_t fmp_locator_service_found_handler(void *param)
Service found handler invoked by ble manager.
Definition: find_me_locator.c:124
uint8_t ias_char_data[MAX_IAS_CHAR_SIZE]
Initial value:
=
#define NULL
Definition: def.h:47
Input Parameter invalid.
Definition: common/components/wifi/winc3400/ble/atmel_ble_api/include/at_ble_api.h:125
uint8_t immediate_alert_value = INVALID_IAS_PARAM

Alert value used for immediate alert service.