BLE Manager.
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 "ble_utils.h"
#include "link_loss.h"
#include "immediate_alert.h"
#include "tx_power.h"
#include "pxp_monitor.h"
Macros | |
#define | AT_BLE_EVENT_PARAM_MAX_SIZE 524 |
Functions | |
void | ble_conn_param_update (at_ble_conn_param_update_done_t *conn_param_update) |
connection update parameter function More... | |
void | ble_connected_state_handler (at_ble_connected_t *conn_params) |
function to handle connected event received from stack More... | |
void | ble_device_init (at_ble_addr_t *addr) |
BLE device initialization. More... | |
void | ble_disconnected_state_handler (at_ble_disconnected_t *disconnect) |
function handles disconnection event received from stack More... | |
void | ble_encryption_request_handler (at_ble_encryption_request_t *encry_req) |
function handles encryption requests More... | |
void | ble_encryption_status_change_handler (at_ble_encryption_status_changed_t *encry_status) |
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) |
Set BLE Address, If address is NULL then it will use BD public address. More... | |
static void | ble_init (void) |
initializes the platform More... | |
at_ble_status_t | ble_pair_done_handler (at_ble_pair_done_t *pairing_params) |
function handles pair done event More... | |
void | ble_pair_key_request_handler (at_ble_pair_key_request_t *pair_key) |
function handles pair key request More... | |
void | ble_pair_request_handler (at_ble_pair_request_t *at_ble_pair_req) |
function handles pair request More... | |
at_ble_status_t | ble_scan_info_handler (at_ble_scan_info_t *scan_param) |
function handling scanned information More... | |
at_ble_status_t | ble_scan_report_handler (at_ble_scan_report_t *scan_report) |
function handles scan report More... | |
at_ble_status_t | ble_send_slave_sec_request (at_ble_handle_t conn_handle) |
function to send slave security request More... | |
at_ble_status_t | ble_set_device_name (uint8_t *name, uint8_t name_len) |
set device name to BLE Device More... | |
void | ble_slave_security_handler (at_ble_slave_sec_request_t *slave_sec_req) |
slave security handler 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... | |
void | register_ble_characteristic_changed_cb (ble_characteristic_changed_callback_t char_changed_cb_fn) |
function to register callback to be called when AT_BLE_CHARACTERISTIC_CHANGED event triggered from stack More... | |
void | register_ble_connected_event_cb (ble_gap_event_callback_t connected_cb_fn) |
function to register callback to be called when device gets connected More... | |
void | register_ble_disconnected_event_cb (ble_gap_event_callback_t disconnected_cb_fn) |
function to register callback to be called when device gets disconnected More... | |
void | register_ble_paired_event_cb (ble_gap_event_callback_t paired_cb_fn) |
function to register callback to be called when device gets paired More... | |
uint8_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 | |
at_ble_LTK_t | app_bond_info |
bool | app_device_bond |
uint8_t | auth_info |
ble_characteristic_changed_callback_t | ble_char_changed_cb = NULL |
ble_gap_event_callback_t | ble_connected_cb = NULL |
callbacks initialized with user provided callbacks More... | |
at_ble_connected_t | ble_connected_dev_info [MAX_DEVICE_CONNECTED] |
information of the connected devices More... | |
ble_gap_event_callback_t | ble_disconnected_cb = NULL |
ble_gap_event_callback_t | ble_paired_cb = NULL |
at_ble_events_t | event |
uint8_t | params [AT_BLE_EVENT_PARAM_MAX_SIZE] |
at_ble_scan_info_t | scan_info [MAX_SCAN_DEVICE] |
uint8_t | scan_response_count = 0 |
#define AT_BLE_EVENT_PARAM_MAX_SIZE 524 |
|
static |
at_ble_status_t gap_dev_connect | ( | at_ble_addr_t * | dev_addr | ) |
request the peer device for connection
References at_ble_connect(), at_ble_connection_params_t::ce_len_max, at_ble_connection_params_t::ce_len_min, at_ble_connection_params_t::con_intv_max, at_ble_connection_params_t::con_intv_min, at_ble_connection_params_t::con_latency, GAP_CE_LEN_MAX, GAP_CE_LEN_MIN, GAP_CONN_INTERVAL_MAX, GAP_CONN_INTERVAL_MIN, GAP_CONN_SLAVE_LATENCY, GAP_CONNECT_PEER_COUNT, GAP_SUPERVISION_TIMEOUT, SCAN_INTERVAL, SCAN_WINDOW, and at_ble_connection_params_t::superv_to.
Referenced by pxp_monitor_connect_request(), and pxp_monitor_start_scan().
at_ble_LTK_t app_bond_info |
bool app_device_bond |
Referenced by ble_pair_done_handler(), ble_pair_request_handler(), and ble_slave_security_handler().
uint8_t auth_info |
Referenced by ble_encryption_request_handler(), and ble_pair_done_handler().
ble_characteristic_changed_callback_t ble_char_changed_cb = NULL |
Referenced by ble_event_manager(), and register_ble_characteristic_changed_cb().
ble_gap_event_callback_t ble_connected_cb = NULL |
callbacks initialized with user provided callbacks
Referenced by ble_connected_state_handler(), and register_ble_connected_event_cb().
at_ble_connected_t ble_connected_dev_info[MAX_DEVICE_CONNECTED] |
information of the connected devices
ble_gap_event_callback_t ble_disconnected_cb = NULL |
Referenced by ble_disconnected_state_handler(), and register_ble_disconnected_event_cb().
ble_gap_event_callback_t ble_paired_cb = NULL |
Referenced by ble_encryption_status_change_handler(), ble_pair_done_handler(), and register_ble_paired_event_cb().
Referenced by at_ble_max_PA_gain_get(), at_ble_rx_power_get(), at_ble_tx_power_get(), at_ble_tx_power_set(), and event_free().
uint8_t params[AT_BLE_EVENT_PARAM_MAX_SIZE] |
Referenced by at_ble_max_PA_gain_get(), at_ble_rx_power_get(), at_ble_tx_power_get(), at_ble_tx_power_set(), and ble_event_task().
at_ble_scan_info_t scan_info[MAX_SCAN_DEVICE] |
Referenced by pxp_monitor_scan_data_handler().
uint8_t scan_response_count = 0 |
Referenced by ble_scan_info_handler(), ble_scan_report_handler(), and gap_dev_scan().