Microchip® Advanced Software Framework

gap.c File Reference
#include "at_ble_api.h"
#include "platform.h"
#include "gattc_task.h"
#include "gattm_task.h"
#include "gapm_task.h"
#include "gapc_task.h"
#include "dbg_task.h"
#include "device.h"
#include "event.h"

Macros

#define APP_CON_INTV_MAX   10
 
#define APP_CON_INTV_MIN   8
 
#define APP_CON_LATENCY   0
 
#define APP_FLAGS   0
 
#define APP_MAX_MTU   L2C_MIN_LE_MTUSIG
 
#define APP_SUPERV_TO   200
 
#define GAP_device_name   "MICROCHIP_BLE"
 
#define LOCAL_ADDR_TYPE   GAPM_PUBLIC_ADDR
 

Functions

at_ble_status_t at_ble_addr_get (at_ble_addr_t *address)
 Get device public BT Address. More...
 
at_ble_status_t at_ble_addr_set (at_ble_addr_t *address)
 Set the local device BT Address. More...
 
at_ble_status_t at_ble_adv_data_set (uint8_t const *const adv_data, uint8_t adv_data_len, uint8_t const *const scan_resp_data, uint8_t scan_response_data_len)
 Set, clear or update advertisement and scan response data. More...
 
at_ble_status_t at_ble_adv_set_tx_power (int8_t power)
 Set the Advertising transmission power. More...
 
at_ble_status_t at_ble_adv_start (at_ble_adv_type_t type, at_ble_adv_mode_t mode, at_ble_addr_t *peer_addr, at_ble_filter_type_t filtered, uint16_t interval, uint16_t timeout, bool disable_randomness)
 Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More...
 
at_ble_status_t at_ble_adv_stop (void)
 Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More...
 
void at_ble_conn_update_reply (at_ble_handle_t conn_handle, at_ble_connection_params_t *connection_params)
 Reply to connection parameters update request AT_BLE_CONN_PARAM_UPDATE_REQUEST. More...
 
at_ble_status_t at_ble_connect (at_ble_addr_t peers[], uint8_t peer_count, uint16_t scan_interval, uint16_t scan_window, at_ble_connection_params_t *connection_params)
 Connect to a peer device. More...
 
at_ble_status_t at_ble_connect_cancel (void)
 Cancels an ongoing connection attempt. More...
 
at_ble_status_t at_ble_connection_param_update (at_ble_handle_t handle, at_ble_connection_params_t *connection_params)
 Update the connection parameters of an ongoing connection. More...
 
at_ble_status_t at_ble_device_name_set (uint8_t *dev_name, uint8_t len)
 Set device name. More...
 
at_ble_status_t at_ble_disconnect (at_ble_handle_t handle, at_ble_disconnect_reason_t reason)
 Disconnect a connected peer device. More...
 
at_ble_status_t at_ble_init (void *args)
 Reset the link layer and the host. More...
 
int8_t at_ble_max_PA_gain_get (at_ble_handle_t conn_handle)
 Gets maximum allowed TX gain of a given connection. More...
 
at_ble_status_t at_ble_random_address_resolve (uint8_t nb_key, at_ble_addr_t *rand_addr, uint8_t *irk_key)
 Handles request of resolving a resolvable random address ,AT_BLE_RESOLV_RAND_ADDR_STATUS event is used to inform which key has been used to perform resolution. More...
 
int8_t at_ble_rx_power_get (at_ble_handle_t conn_handle)
 Gets RX power of a given connection. More...
 
at_ble_status_t at_ble_scan_start (uint16_t interval, uint16_t window, uint16_t timeout, at_ble_scan_type_t type, at_ble_scan_mode_t mode, bool filter_whitelist, bool filter_duplicates)
 Start scan operation. More...
 
at_ble_status_t at_ble_scan_stop (void)
 Stops an ongoing scan operation. More...
 
at_ble_status_t at_ble_sec_info_set (at_ble_handle_t handle, at_ble_signature_info_t signature_info, at_ble_auth_t auth, at_ble_author_t author)
 Set specific link security configuration and bonding data. More...
 
at_ble_status_t at_ble_set_dev_config (at_ble_gap_role role)
 Set GAP attribute data base into BLE chip. More...
 
at_ble_status_t at_ble_set_gap_deviceinfo (at_ble_gap_deviceinfo_t *gap_deviceinfo)
 Set GAP attribute data base in BLE API (Appearance , slave preferred connection parameters , device name write permissions) More...
 
at_ble_status_t at_ble_set_privacy_key (at_ble_gap_irk_t *irk, uint16_t interval)
 Set device Identity Resolving Key. More...
 
int8_t at_ble_tx_power_get (at_ble_handle_t conn_handle)
 Gets TX power of a given connection. More...
 
at_ble_status_t at_ble_tx_power_set (at_ble_handle_t conn_handle, int8_t powerdBm)
 Sets TX gain, relative to maximum gain, for a given connection. More...
 
at_ble_status_t at_ble_whitelist_add (at_ble_addr_t *address)
 Adds a peer device address to the white-list. More...
 
at_ble_status_t at_ble_whitelist_clear (void)
 Clear the white-list. More...
 
at_ble_status_t at_ble_whitelist_remove (at_ble_addr_t *address)
 Removes a peer device address from the white-list. More...
 
static uint8_t gapm_get_adv_type (uint8_t type)
 
static uint8_t gapm_get_device_address_type (uint8_t local_addr_type, bool device_addr_auto_gen)
 

Variables

struct device_info device
 

#define APP_CON_INTV_MAX   10

Referenced by at_ble_init().

#define APP_CON_INTV_MIN   8

Referenced by at_ble_init().

#define APP_CON_LATENCY   0

Referenced by at_ble_init().

#define APP_FLAGS   0
#define APP_MAX_MTU   L2C_MIN_LE_MTUSIG

Referenced by at_ble_set_dev_config().

#define APP_SUPERV_TO   200

Referenced by at_ble_init().

#define GAP_device_name   "MICROCHIP_BLE"

Referenced by at_ble_init().

#define LOCAL_ADDR_TYPE   GAPM_PUBLIC_ADDR