Microchip® Advanced Software Framework

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 "ble_manager.h"
#include "ble_utils.h"
#include "link_loss.h"
#include "immediate_alert.h"
#include "tx_power.h"
#include "pxp_reporter.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_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...
 
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...
 

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]
 

#define AT_BLE_EVENT_PARAM_MAX_SIZE   524

static void ble_init ( void  )
static

initializes the platform

References DBG_LOG.

Referenced by ble_device_init().

at_ble_LTK_t app_bond_info
uint8_t auth_info
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