Microchip® Advanced Software Framework

thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c File Reference

BLE Manager.

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

#include <asf.h>
#include <string.h>
#include "at_ble_api.h"
#include "at_ble_trace.h"
#include "ble_manager.h"
#include "ble_utils.h"
#include "platform.h"
#include "pds.h"

Functions

at_ble_status_t ble_advertisement_data_set (void)
 ble_advertisement_data_set set the BLE advertisement data based on the available available services and profiles which is present in the current application. More...
 
at_ble_status_t ble_characteristic_write_cmd_complete_handler (void *params)
 ble_characteristic_write_cmd_complete_handler handler for Char write command complete event More...
 
at_ble_status_t ble_check_device_state (at_ble_handle_t conn_handle, ble_device_state_t state)
 Check the device state. More...
 
bool ble_check_disconnected_iscentral (at_ble_handle_t handle)
 Check the passed connection handle of the device is disconnected and central device. More...
 
bool ble_check_disconnected_isperipheral (at_ble_handle_t handle)
 Check the passed connection handle of the device is disconnected and peripheral device. More...
 
bool ble_check_iscentral (at_ble_handle_t handle)
 Check the passed connection handle of the device is central device. More...
 
bool ble_check_ispheripheral (at_ble_handle_t handle)
 Check the passed connection handle of the device is peripheral or central device. More...
 
at_ble_status_t ble_conn_param_update (void *params)
 connection update parameter function More...
 
at_ble_status_t ble_conn_param_update_req (void *params)
 function triggered on receiving a connection parameter update request from the peer. More...
 
at_ble_status_t ble_connected_device_role (at_ble_handle_t conn_handle, at_ble_dev_role_t *dev_role)
 Get the passed connection handle device role. More...
 
at_ble_status_t ble_connected_state_handler (void *params)
 function to handle connected event received from stack More...
 
at_ble_status_t ble_device_dead_handler (void *params)
 ble_device_dead_handler handler for BLE device dead indication handler. More...
 
void ble_device_init (at_ble_addr_t *addr)
 BLE device initialization. More...
 
at_ble_status_t ble_device_out_of_sync_handler (void *params)
 ble_device_out_of_sync_handler handler for out of sync indication handler. More...
 
at_ble_status_t ble_disconnected_device_role (at_ble_handle_t conn_handle, at_ble_dev_role_t *dev_role)
 Get the device role of disconnected device. More...
 
at_ble_status_t ble_disconnected_state_handler (void *params)
 function handles disconnection event received from stack More...
 
at_ble_status_t ble_encryption_request_handler (void *params)
 function handles encryption requests More...
 
at_ble_status_t ble_encryption_status_change_handler (void *params)
 function handles encryption status change More...
 
void ble_event_manager (at_ble_events_t events, void *event_params)
 function handling all the events from the stack, responsible for calling the respective functions initialized for the events. More...
 
at_ble_status_t ble_event_task (void)
 function to get event from stack More...
 
static void ble_init (at_ble_init_config_t *args)
 initializes the platform More...
 
bool ble_mgr_events_callback_handler (ble_mgr_event_cb_t event_cb_type, ble_mgr_event_t event_type, const void *ble_event_handler)
 The structure of BLE Event callback pointer will be registered or unregistered dynamically. More...
 
at_ble_status_t ble_mtu_changed_cmd_complete_handler (void *params)
 ble_mtu_changed_indication_handler handler for Peer device MTU size change More...
 
at_ble_status_t ble_mtu_changed_indication_handler (void *params)
 ble_mtu_changed_indication_handler handler for Peer device MTU size change More...
 
at_ble_status_t ble_pair_done_handler (void *params)
 function handles pair done event More...
 
at_ble_status_t ble_pair_key_request_handler (void *params)
 function handles pair key request More...
 
at_ble_status_t ble_pair_request_handler (void *params)
 function handles pair request More...
 
at_ble_status_t ble_remove_bonding_info (void)
 Remove all bonding information from PDS. More...
 
at_ble_status_t ble_resolv_rand_addr_handler (void *params)
 ble_resolv_rand_addr_handler handles the resolved random address event More...
 
at_ble_status_t ble_restore_bonding_info (void)
 Restore the bonding information from PDS. More...
 
static bool ble_scan_duplication_check (at_ble_scan_info_t *info)
 filter function for avoiding duplicated scan data. More...
 
at_ble_status_t ble_scan_info_handler (void *params)
 function handling scaned information More...
 
at_ble_status_t ble_scan_report_handler (void *params)
 function handles scan report More...
 
uint32_t ble_sdk_version (void)
 ble_sdk_version gets the version of BluSDK and also checks the SDK and Library version compatibility More...
 
at_ble_status_t ble_send_slave_sec_request (at_ble_handle_t conn_handle)
 function to send slave security request More...
 
static void ble_set_dev_config (at_ble_addr_t *addr)
 Set BLE Address, If address is NULL then it will use BD public address. More...
 
at_ble_status_t ble_set_device_name (uint8_t *name, uint8_t name_len)
 set device name to BLE Device More...
 
at_ble_status_t ble_slave_security_request_handler (void *params)
 
at_ble_status_t ble_store_bonding_info (void *params)
 Store the bonding information. More...
 
at_ble_status_t ble_undefined_event_handler (void *params)
 ble_undefined_event_handler handler for undefined events which is not expected in Library More...
 
at_ble_status_t gap_dev_connect (at_ble_addr_t *dev_addr)
 request the peer device for connection More...
 
at_ble_status_t gap_dev_scan (void)
 instructs device to start scanning More...
 
at_ble_status_t pds_module_init (void)
 Initialize the PDS Module. More...
 
at_ble_status_t scan_info_parse (at_ble_scan_info_t *scan_info_data, at_ble_uuid_t *ble_service_uuid, uint8_t adv_type)
 function parses the received advertising data for service and local name. More...
 

Variables

uint32_t att_db_data [BLE_ATT_DB_MEMORY_SIZE/4] = {0}
 
ble_connected_dev_info_t ble_dev_info [BLE_MAX_DEVICE_CONNECTION]
 Initialize the service with its included service, characteristics, and descriptors. More...
 
volatile uint8_t ble_device_count
 
volatile ble_device_ll_state_t ble_device_current_state = BLE_DEVICE_IDLE_STATE
 
uint32_t ble_event_params [BLE_EVENT_PARAM_MAX_SIZE/sizeof(uint32_t)]
 
const ble_custom_event_cb_tble_mgr_custom_event_cb [MAX_CUSTOM_EVENT_SUBSCRIBERS] = {NULL, }
 
static const ble_custom_event_cb_t ble_mgr_custom_event_handle
 
const ble_dtm_event_cb_tble_mgr_dtm_event_cb [MAX_DTM_EVENT_SUBSCRIBERS] = {NULL, }
 
const ble_gap_event_cb_tble_mgr_gap_event_cb [MAX_GAP_EVENT_SUBSCRIBERS] = {NULL, }
 
static const ble_gap_event_cb_t ble_mgr_gap_handle
 
const ble_gatt_client_event_cb_tble_mgr_gatt_client_event_cb [MAX_GATT_CLIENT_SUBSCRIBERS] = {NULL, }
 
const ble_gatt_server_event_cb_tble_mgr_gatt_server_event_cb [MAX_GATT_SERVER_SUBSCRIBERS] = {NULL, }
 
static const
ble_gatt_server_event_cb_t 
ble_mgr_gatt_server_handle
 
const ble_htpt_event_cb_tble_mgr_htpt_event_cb [MAX_HTPT_EVENT_SUBSCRIBERS] = {NULL, }
 
const ble_l2cap_event_cb_tble_mgr_l2cap_event_cb [MAX_L2CAP_EVENT_SUBSCRIBERS] = {NULL, }
 
static at_ble_addr_t ble_peripheral_dev_address
 
at_ble_connected_t connected_state_info
 
at_ble_events_t event
 
uint32_t event_params_memory [1024] = {0}
 
uint32_t event_pool_memory [256] = {0}
 
pds_env_t pds_env_cfg
 
at_ble_init_config_t pf_cfg
 
bool volatile resolve_addr_flag = false
 
uint32_t rx_fifo_memory [256] = {0}
 
at_ble_scan_info_t scan_info [MAX_SCAN_DEVICE]
 
volatile uint32_t scan_response_count = 0
 
bool volatile send_slave_security_flag = true
 
at_ble_encryption_request_t temp_param [sizeof(at_ble_encryption_request_t)]
 

at_ble_status_t ble_advertisement_data_set ( void  )

ble_advertisement_data_set set the BLE advertisement data based on the available available services and profiles which is present in the current application.

Parameters
[in]None
Returns
AT_BLE_SUCCESS BLE advertisement data set successfully
AT_BLE_FAILURE Failed to set the advertisement data

References _CONF_PUBLIC_TARGET_ADDR, _CONF_PUBLIC_TARGET_ADDR_SCAN_RSP, _CONF_RANDOM_TARGET_ADDR, _CONF_RANDOM_TARGET_ADDR_SCAN_RSP, _CONF_SERVICE_128BIT_UUID, _CONF_SERVICE_128BIT_UUID_SCAN_RSP, _CONF_SERVICE_16BIT_UUID, _CONF_SERVICE_16BIT_UUID_SCAN_RSP, _CONF_SERVICE_32BIT_UUID, _CONF_SERVICE_32BIT_UUID_SCAN_RSP, _CONF_SERVICE_SOLTN_128BIT_UUID, _CONF_SERVICE_SOLTN_128BIT_UUID_SCAN_RSP, _CONF_SERVICE_SOLTN_16BIT_UUID, _CONF_SERVICE_SOLTN_16BIT_UUID_SCAN_RSP, _CONF_SERVICE_SOLTN_32BIT_UUID, _CONF_SERVICE_SOLTN_32BIT_UUID_SCAN_RSP, ADV_ELEMENT_SIZE, adv_element_container::adv_ptr, ADV_TYPE_FLAG_SIZE, ADV_TYPE_SIZE, ADVERTISING_INTERVAL, APPEARANCE, at_ble_adv_data_set(), AT_BLE_ADV_MAX_SIZE, AT_BLE_GAP_INVALID_PARAM, AT_BLE_SUCCESS, BLE_GAP_ADV_ADVERTISING_INTERVAL_LENGTH, BLE_GAP_ADV_DATA_SLAVE_CONN_INTERVAL_RANGE_LENGTH, BLE_GAP_ADV_PUBLIC_TARGET_ADDR_LENGTH, BLE_GAP_ADV_RANDOM_TARGET_ADDR_LENGTH, BLE_GAP_ADV_SERVICE_128BIT_UUID_LENGTH, BLE_GAP_ADV_SERVICE_16BIT_UUID_LENGTH, BLE_GAP_ADV_SERVICE_32BIT_UUID_LENGTH, COMPLETE_LIST_128BIT_SERV_UUIDS, COMPLETE_LIST_16BIT_SERV_UUIDS, COMPLETE_LIST_32BIT_SERV_UUIDS, COMPLETE_LOCAL_NAME, DBG_LOG, DBG_LOG_ADV, DBG_LOG_DEV, LE_BLUETOOTH_DEVICE_ADDRESS, LE_ROLE, adv_element_container::len, scan_resp_element::len, LIST_128BIT_SERV_SOLICITATION_UUIDS, LIST_16BIT_SERV_SOLICITATION_UUIDS, LIST_32BIT_SERV_SOLICITATION_UUIDS, MANUFACTURER_SPECIFIC_DATA, MREPEAT, NULL, PUBLIC_RANDOM_ADDR_MAX_NUM, PUBLIC_TARGET_ADDR_MAX_NUM, PUBLIC_TARGET_ADDRESS, RANDOM_TARGET_ADDRESS, scan_resp_element::scn_ptr, SERVICE_DATA, SERVICE_DATA_128BIT, SERVICE_DATA_32BIT, SERVICE_UUID128_MAX_NUM, SERVICE_UUID16_MAX_NUM, SERVICE_UUID32_MAX_NUM, SHORTENED_LOCAL_NAME, SLAVE_CONNECTION_INTERVAL_RANGE, status, and TX_POWER_LEVEL.

Referenced by anp_client_init(), battery_service_advertise(), battery_set_advertisement_data(), blp_sensor_init(), csc_prf_init(), device_information_advertise(), fmp_target_adv(), hid_prf_dev_adv(), hr_sensor_init(), htpt_set_advertisement_data(), pas_client_init(), pxp_reporter_adv(), sps_service_advertise(), and time_info_adv().

at_ble_status_t ble_characteristic_write_cmd_complete_handler ( void *  params)

ble_characteristic_write_cmd_complete_handler handler for Char write command complete event

Parameters
[in]paramsof at_ble_cmd_complete_event_t type, Refer to at_ble_cmd_complete_event_t
Returns
AT_BLE_SUCCESS event handled successfully
AT_BLE_FAILURE event with error status

References AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_cmd_complete_event_t::conn_handle, DBG_LOG_DEV, at_ble_cmd_complete_event_t::operation, and at_ble_cmd_complete_event_t::status.

at_ble_status_t ble_check_device_state ( at_ble_handle_t  conn_handle,
ble_device_state_t  state 
)

Check the device state.

Parameters
[in]conn_handleat_ble_handle_t Device connection handle
[in]stateble_device_state_t device state
Returns
AT_BLE_SUCCESS if the passed handle of device states are matches
AT_BLE_FAILURE if the passed handle of device states are doesn't matches

References AT_BLE_FAILURE, AT_BLE_SUCCESS, BLE_MAX_DEVICE_CONNECTION, and status.

bool ble_check_disconnected_iscentral ( at_ble_handle_t  handle)

Check the passed connection handle of the device is disconnected and central device.

Parameters
[in]handleat_ble_handle_t Device connection handle
Returns
true if the passed handle of the device is disconnected and central
false if the passed handle of the device is not central or not disconnected.

References AT_BLE_ROLE_CENTRAL, AT_BLE_SUCCESS, and ble_disconnected_device_role().

Referenced by pxp_disconnect_event_handler().

bool ble_check_disconnected_isperipheral ( at_ble_handle_t  handle)

Check the passed connection handle of the device is disconnected and peripheral device.

Parameters
[in]handleat_ble_handle_t Device connection handle
Returns
true if the passed handle of the device is disconnected and peripheral
false if the passed handle of the device is not peripheral or not disconnected.

References AT_BLE_ROLE_PERIPHERAL, AT_BLE_SUCCESS, and ble_disconnected_device_role().

bool ble_check_ispheripheral ( at_ble_handle_t  handle)

Check the passed connection handle of the device is peripheral or central device.

Parameters
[in]handleat_ble_handle_t Device connection handle
Returns
true if the passed handle of the device is peripheral
false if the passed handle of the device is not peripheral.

References AT_BLE_ROLE_PERIPHERAL, AT_BLE_SUCCESS, and ble_connected_device_role().

Referenced by ble_connected_app_event(), ble_pair_done_handler(), pxp_monitor_encryption_change_handler(), and pxp_monitor_pair_done_handler().

at_ble_status_t ble_conn_param_update ( void *  params)

connection update parameter function

function used to update the connection parameter.

References ALL_UNUSED, AT_BLE_SUCCESS, and DBG_LOG_DEV.

at_ble_status_t ble_conn_param_update_req ( void *  params)

function triggered on receiving a connection parameter update request from the peer.

Parameters
[in]conn_param_reqat_ble_conn_param_update_request_t parameters received.
Returns
AT_BLE_SUCCESS operation completed successfully.
AT_BLE_FAILURE Generic error.

References at_ble_conn_update_reply(), AT_BLE_SUCCESS, and at_ble_conn_param_update_request_t::handle.

at_ble_status_t ble_connected_device_role ( at_ble_handle_t  conn_handle,
at_ble_dev_role_t dev_role 
)

Get the passed connection handle device role.

Parameters
[in]conn_handleat_ble_handle_t Device connection handle
[in]dev_roleat_ble_dev_role_t device role Central or Peripheral
Returns
AT_BLE_SUCCESS if the passed handle of the device gets the device role
AT_BLE_FAILURE if the passed handle doesn't match and failure of getting device role

References AT_BLE_FAILURE, AT_BLE_SUCCESS, BLE_DEVICE_DEFAULT_IDLE, BLE_DEVICE_DISCONNECTED, BLE_MAX_DEVICE_CONNECTION, and status.

Referenced by ble_check_iscentral(), and ble_check_ispheripheral().

at_ble_status_t ble_device_dead_handler ( void *  params)

ble_device_dead_handler handler for BLE device dead indication handler.

When the application receives this event that means BLE device is not responding. The application may start the BLE device from beginning by calling the at_ble_init, Refer to at_ble_init

Parameters
[in]paramsof void * type
Returns
AT_BLE_SUCCESS event handled successfully
AT_BLE_FAILURE event with error status

References ALL_UNUSED, AT_BLE_SUCCESS, and DBG_LOG.

at_ble_status_t ble_device_out_of_sync_handler ( void *  params)

ble_device_out_of_sync_handler handler for out of sync indication handler.

When device starts missing few events or UART BLE event data

Parameters
[in]paramsof void * type
Returns
AT_BLE_SUCCESS event handled successfully
AT_BLE_FAILURE event with error status

References ALL_UNUSED, AT_BLE_SUCCESS, and DBG_LOG.

at_ble_status_t ble_disconnected_device_role ( at_ble_handle_t  conn_handle,
at_ble_dev_role_t dev_role 
)

Get the device role of disconnected device.

Parameters
[in]conn_handleat_ble_handle_t Device connection handle
[in]dev_roleat_ble_dev_role_t device role Central or Peripheral
Returns
AT_BLE_SUCCESS if the passed handle of the device gets the device role
AT_BLE_FAILURE if the passed handle doesn't match and failure of getting device role

References AT_BLE_FAILURE, AT_BLE_ROLE_NONE, AT_BLE_SUCCESS, BLE_DEVICE_DEFAULT_IDLE, BLE_DEVICE_DISCONNECTED, BLE_MAX_DEVICE_CONNECTION, and status.

Referenced by ble_check_disconnected_iscentral(), and ble_check_disconnected_isperipheral().

at_ble_status_t ble_encryption_status_change_handler ( void *  params)
static void ble_init ( at_ble_init_config_t args)
static

initializes the platform

References at_ble_chip_id_get(), at_ble_init(), AT_BLE_SUCCESS, and DBG_LOG.

Referenced by ble_device_init().

bool ble_mgr_events_callback_handler ( ble_mgr_event_cb_t  event_cb_type,
ble_mgr_event_t  event_type,
const void *  ble_event_handler 
)

The structure of BLE Event callback pointer will be registered or unregistered dynamically.

ble_mgr_events_callback_handler handler for Profile/Service/application to register the BLE events callbacks

The callback pointers are registered according to the group type of BLE Events request is received AT_BLE_LECB_CONN_REQ

Parameters
[in]event_cb_typeRegister/Unregister the callback functions
[in]event_typetype of BLE event
[in]ble_event_handlerstructure of function pointers for the event
Returns
Upon successful completion the function shall return true, Otherwise the function shall return false

References BLE_CUSTOM_EVENT_TYPE, BLE_DTM_EVENT_TYPE, BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, BLE_GATT_HTPT_EVENT_TYPE, BLE_GATT_SERVER_EVENT_TYPE, BLE_L2CAP_EVENT_TYPE, MAX_CUSTOM_EVENT_SUBSCRIBERS, MAX_DTM_EVENT_SUBSCRIBERS, MAX_GAP_EVENT_SUBSCRIBERS, MAX_GATT_CLIENT_SUBSCRIBERS, MAX_GATT_SERVER_SUBSCRIBERS, MAX_HTPT_EVENT_SUBSCRIBERS, MAX_L2CAP_EVENT_SUBSCRIBERS, NULL, REGISTER_CALL_BACK, status, and UNREGISTER_CALL_BACK.

Referenced by anp_client_init(), ble_device_init(), blp_sensor_init(), csc_prf_init(), eddystone_app_init(), fmp_locator_init(), fmp_target_init(), hid_prf_init(), hr_sensor_init(), main(), pas_client_init(), pxp_monitor_init(), pxp_reporter_init(), sps_init_service(), and time_info_init().

at_ble_status_t ble_mtu_changed_cmd_complete_handler ( void *  params)

ble_mtu_changed_indication_handler handler for Peer device MTU size change

Parameters
[in]paramsof at_ble_mtu_changed_ind_t type, Refer to at_ble_mtu_changed_ind_t
Returns
AT_BLE_SUCCESS event handled successfully
AT_BLE_FAILURE event with error status

References AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_cmd_complete_event_t::conn_handle, DBG_LOG, DBG_LOG_DEV, at_ble_cmd_complete_event_t::operation, and at_ble_cmd_complete_event_t::status.

at_ble_status_t ble_mtu_changed_indication_handler ( void *  params)

ble_mtu_changed_indication_handler handler for Peer device MTU size change

Parameters
[in]paramsof at_ble_mtu_changed_ind_t type, Refer to at_ble_mtu_changed_ind_t
Returns
AT_BLE_SUCCESS event handled successfully
AT_BLE_FAILURE event with error status

References AT_BLE_SUCCESS, at_ble_mtu_changed_ind_t::conhdl, DBG_LOG_DEV, and at_ble_mtu_changed_ind_t::mtu_value.

at_ble_status_t ble_remove_bonding_info ( void  )

Remove all bonding information from PDS.

Remove all the valid bonding informations from PDS

Parameters
[in]None
Returns
Status of the Remove bonding information procedure
Return values
AT_BLE_SUCCESSbonding information removed successfully from the PDS
AT_BLE_FAILUREFailed to remove the bonding information from PDS

References AT_BLE_FAILURE, AT_BLE_SUCCESS, BLE_BONDING_INFO, BLE_MAX_DEVICE_CONNECTION, count, DBG_LOG, pds_delete(), PDS_ID, pds_list_item(), PDS_SUCCESS, and status.

Referenced by main().

at_ble_status_t ble_restore_bonding_info ( void  )

Restore the bonding information from PDS.

Restore all the valid bonding information from PDS to device info table

Parameters
[in]None
Returns
Status of the Restore bonding information
Return values
AT_BLE_SUCCESSPDS Restore bonding information is completed.
AT_BLE_FAILURERestore bonding information failed

References AT_BLE_FAILURE, AT_BLE_SUCCESS, BLE_BONDING_INFO, BLE_DEVICE_DISCONNECTED, BLE_MAX_DEVICE_CONNECTION, count, DBG_LOG, PDS_ID, pds_list_item(), pds_read(), PDS_SUCCESS, and status.

Referenced by ble_device_init().

static bool ble_scan_duplication_check ( at_ble_scan_info_t info)
static

filter function for avoiding duplicated scan data.

References at_ble_addr_t::addr, at_ble_scan_info_t::dev_addr, i, ret, scan_response_count, and at_ble_scan_info_t::type.

Referenced by ble_event_manager().

at_ble_status_t ble_scan_info_handler ( void *  params)

function handling scaned information

function to handle the scan information.

References at_ble_addr_t::addr, AT_BLE_FAILURE, at_ble_scan_stop(), AT_BLE_SUCCESS, DBG_LOG, DBG_LOG_DEV, at_ble_scan_info_t::dev_addr, MAX_SCAN_DEVICE, and scan_response_count.

at_ble_status_t ble_scan_report_handler ( void *  params)

function handles scan report

function to handle the scan status.

References AT_BLE_FAILURE, AT_BLE_SUCCESS, ble_device_current_state, BLE_DEVICE_IDLE_STATE, DBG_LOG, and at_ble_scan_report_t::status.

uint32_t ble_sdk_version ( void  )

ble_sdk_version gets the version of BluSDK and also checks the SDK and Library version compatibility

Parameters
[in]None
Returns
BluSDK version

References at_ble_firmware_version_get(), at_ble_rf_version_get(), AT_BLE_SUCCESS, BLE_SDK_BUILD_NO, BLE_SDK_MAJOR_NO, BLE_SDK_MINOR_NO, BLE_SDK_MINOR_NO_INC, BLE_SDK_VERSION, DBG_LOG, and DBG_LOG_DEV.

Referenced by ble_device_init().

at_ble_status_t ble_store_bonding_info ( void *  params)

Store the bonding information.

Parameters
[in]None
Returns
Status of the PDS bonding information store procedure
Return values
AT_BLE_SUCCESSStored the bonding information in PDS
AT_BLE_FAILUREFailed to store the bonding information in PDS

References AT_BLE_FAILURE, AT_BLE_SUCCESS, BLE_BONDING_INFO, BLE_MAX_DEVICE_CONNECTION, count, DBG_LOG, pds_compact_sector(), PDS_ID, pds_list_item(), PDS_NVM_NO_MEMORY, PDS_SECTOR_ITEM_ERROR, PDS_SUCCESS, pds_write(), and status.

Referenced by ble_pair_done_handler().

at_ble_status_t ble_undefined_event_handler ( void *  params)

ble_undefined_event_handler handler for undefined events which is not expected in Library

Parameters
[in]paramsof void * type
Returns
AT_BLE_SUCCESS event handled successfully
AT_BLE_FAILURE event with error status

References ALL_UNUSED, AT_BLE_SUCCESS, and DBG_LOG_DEV.

at_ble_status_t pds_module_init ( void  )

Initialize the PDS Module.

IInitialize the PDS & NVM Memory

Parameters
[in]None
Returns
Status of the PDS Module Initialize procedure
Return values
AT_BLE_SUCCESSPDS Module Initialize is completed
AT_BLE_FAILUREPDS Module Initialization Failure

References AT_BLE_FAILURE, AT_BLE_SUCCESS, DBG_LOG, pds_init(), PDS_SUCCESS, and status.

Referenced by main().

uint32_t att_db_data[BLE_ATT_DB_MEMORY_SIZE/4] = {0}

Referenced by ble_device_init().

Initialize the service with its included service, characteristics, and descriptors.

Peer Connected device info

Parameters
[in]scan_paramgatt service information
Returns
none
uint32_t ble_event_params[BLE_EVENT_PARAM_MAX_SIZE/sizeof(uint32_t)]

Referenced by ble_event_task().

const ble_custom_event_cb_t* ble_mgr_custom_event_cb[MAX_CUSTOM_EVENT_SUBSCRIBERS] = {NULL, }
const ble_custom_event_cb_t ble_mgr_custom_event_handle
static
Initial value:
= {
.custom_event = NULL,
.device_dead = ble_device_dead_handler,
.device_out_of_sync = ble_device_out_of_sync_handler,
.device_ready = NULL,
.event_max = NULL,
}
at_ble_status_t ble_device_dead_handler(void *params)
ble_device_dead_handler handler for BLE device dead indication handler.
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:2064
#define NULL
Definition: def.h:47
at_ble_status_t ble_device_out_of_sync_handler(void *params)
ble_device_out_of_sync_handler handler for out of sync indication handler.
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:2071
const ble_dtm_event_cb_t* ble_mgr_dtm_event_cb[MAX_DTM_EVENT_SUBSCRIBERS] = {NULL, }
const ble_gap_event_cb_t* ble_mgr_gap_event_cb[MAX_GAP_EVENT_SUBSCRIBERS] = {NULL, }
const ble_gap_event_cb_t ble_mgr_gap_handle
static
Initial value:
= {
.scan_info = ble_scan_info_handler,
.scan_report = ble_scan_report_handler,
.advt_cmp = NULL,
.adv_report = NULL,
.rand_addr_changed = NULL,
.conn_parameter_update_done = ble_conn_param_update,
.conn_param_update_request = ble_conn_param_update_req,
.pair_done = ble_pair_done_handler,
.pair_request = ble_pair_request_handler,
.slave_sec_request = ble_slave_security_request_handler,
.pair_key_request = ble_pair_key_request_handler,
.encryption_request = ble_encryption_request_handler,
.encryption_status_changed = ble_encryption_status_change_handler,
.resolv_rand_addr_status = ble_resolv_rand_addr_handler,
.sign_counters_ind = NULL,
.peer_att_info_ind = NULL,
.con_channel_map_ind = NULL
}
void ble_pair_key_request_handler(at_ble_pair_key_request_t *pair_key)
function handles pair key request
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:557
#define NULL
Definition: def.h:47
at_ble_status_t ble_undefined_event_handler(void *params)
ble_undefined_event_handler handler for undefined events which is not expected in Library ...
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:727
at_ble_status_t ble_pair_done_handler(at_ble_pair_done_t *pairing_params)
function handles pair done event
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:632
void ble_encryption_request_handler(at_ble_encryption_request_t *encry_req)
function handles encryption requests
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:679
void ble_encryption_status_change_handler(at_ble_encryption_status_changed_t *encry_status)
function handles encryption status change
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:657
void ble_pair_request_handler(at_ble_pair_request_t *at_ble_pair_req)
function handles pair request
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:478
at_ble_status_t ble_scan_report_handler(at_ble_scan_report_t *scan_report)
function handles scan report
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:249
void ble_conn_param_update(at_ble_conn_param_update_done_t *conn_param_update)
connection update parameter function
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:415
at_ble_status_t ble_scan_info_handler(at_ble_scan_info_t *scan_param)
function handling scanned information
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:223
at_ble_status_t ble_conn_param_update_req(void *params)
function triggered on receiving a connection parameter update request from the peer.
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:1392
void ble_connected_state_handler(at_ble_connected_t *conn_params)
function to handle connected event received from stack
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:351
void ble_disconnected_state_handler(at_ble_disconnected_t *disconnect)
function handles disconnection event received from stack
Definition: common/components/wifi/winc3400/ble/ble_services/ble_mgr/ble_manager.c:405
at_ble_status_t ble_slave_security_request_handler(void *params)
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:1400
at_ble_status_t ble_resolv_rand_addr_handler(void *params)
ble_resolv_rand_addr_handler handles the resolved random address event
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:1183
const ble_gatt_client_event_cb_t* ble_mgr_gatt_client_event_cb[MAX_GATT_CLIENT_SUBSCRIBERS] = {NULL, }
const ble_gatt_server_event_cb_t* ble_mgr_gatt_server_event_cb[MAX_GATT_SERVER_SUBSCRIBERS] = {NULL, }
const ble_gatt_server_event_cb_t ble_mgr_gatt_server_handle
static
Initial value:
= {
.notification_confirmed = NULL,
.indication_confirmed = NULL,
.characteristic_changed = NULL,
.characteristic_configuration_changed = NULL,
.service_changed_indication_sent = NULL,
.write_authorize_request = NULL,
.mtu_changed_indication = ble_mtu_changed_indication_handler,
.mtu_changed_cmd_complete = ble_mtu_changed_cmd_complete_handler,
.characteristic_write_cmd_cmp = ble_characteristic_write_cmd_complete_handler,
.read_authorize_request = NULL
}
at_ble_status_t ble_mtu_changed_cmd_complete_handler(void *params)
ble_mtu_changed_indication_handler handler for Peer device MTU size change
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:1275
#define NULL
Definition: def.h:47
at_ble_status_t ble_mtu_changed_indication_handler(void *params)
ble_mtu_changed_indication_handler handler for Peer device MTU size change
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:1265
at_ble_status_t ble_characteristic_write_cmd_complete_handler(void *params)
ble_characteristic_write_cmd_complete_handler handler for Char write command complete event ...
Definition: thirdparty/wireless/ble_sdk/ble_services/ble_mgr/ble_manager.c:1296
const ble_htpt_event_cb_t* ble_mgr_htpt_event_cb[MAX_HTPT_EVENT_SUBSCRIBERS] = {NULL, }
const ble_l2cap_event_cb_t* ble_mgr_l2cap_event_cb[MAX_L2CAP_EVENT_SUBSCRIBERS] = {NULL, }
at_ble_addr_t ble_peripheral_dev_address
static
at_ble_connected_t connected_state_info
uint32_t event_params_memory[1024] = {0}
uint32_t event_pool_memory[256] = {0}
pds_env_t pds_env_cfg
Initial value:
= {
.platform_api_list.at_ble_create_timer = platform_create_timer,
.platform_api_list.at_ble_delete_timer = platform_delete_timer,
.platform_api_list.at_ble_start_timer = platform_start_timer,
.platform_api_list.at_ble_stop_timer = platform_stop_timer,
.platform_api_list.at_ble_sleep = platform_sleep,
.platform_api_list.at_ble_gpio_set = platform_gpio_set,
.platform_api_list.at_ble_send_sync = platform_send_sync,
.platform_api_list.at_ble_recv_async = platform_recv_async,
.platform_api_list.at_ble_reconfigure_usart = platform_configure_hw_fc_uart,
.platform_api_list.at_ble_wait_for_signal = platform_wait_for_signal,
.platform_api_list.at_ble_create_signal = platform_create_signal,
.platform_api_list.at_ble_delete_signal = platform_delete_signal,
.platform_api_list.at_ble_trigger_signal = platform_trigger_signal,
.platform_api_list.at_ble_reset_signal = platform_reset_signal
}
void platform_wait_for_signal(uint32_t count, void **signal_handler_list)
Definition: ble_sdk/src/platform.c:273
void platform_delete_signal(void *signal_handler)
Definition: ble_sdk/src/platform.c:325
void * platform_create_signal(void)
Definition: ble_sdk/src/platform.c:310
void platform_send_sync(uint8_t *data, uint32_t len)
Definition: ble_sdk/src/platform.c:89
void * platform_create_timer(void(*timer_cb)(void *))
Definition: ble_sdk/src/platform.c:234
void platform_sleep(uint32_t ms)
Definition: ble_sdk/src/platform.c:258
void platform_delete_timer(void *timer_handle)
Definition: ble_sdk/src/platform.c:239
void platform_recv_async(void(*recv_async_callback)(uint8_t))
Definition: ble_sdk/src/platform.c:151
void platform_gpio_set(at_ble_gpio_pin_t pin, at_ble_gpio_status_t status)
Definition: ble_sdk/src/platform.c:112
void platform_start_timer(void *timer_handle, uint32_t ms)
Definition: ble_sdk/src/platform.c:244
void platform_configure_hw_fc_uart(uint32_t baudrate)
Definition: ble_sdk/src/platform.c:177
void platform_stop_timer(void *timer_handle)
Definition: ble_sdk/src/platform.c:251
void platform_reset_signal(void *signal_handler)
Definition: ble_sdk/src/platform.c:345
void platform_trigger_signal(void *signal_handler)
Definition: ble_sdk/src/platform.c:335
uint32_t rx_fifo_memory[256] = {0}
volatile uint32_t scan_response_count = 0