Go to the documentation of this file.
55 #ifndef __BLE_GAPC_H__
56 #define __BLE_GAPC_H__
68 #define GAP_CHNL_MAP_LEN 0x05
69 #define GAP_FEATS_LEN 0x08
70 #define GAP_ADDR_LEN 0x06
71 #define GAP_INVALID_CONN_INDEX 0xFF
75 #define BLE_GAP_ADDR_TYPE_PUBLIC 0x00
76 #define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01
81 #define PHY_OPT_NO_CODING 0x00
82 #define PHY_OPT_S2_CODING 0x01
83 #define PHY_OPT_S8_CODING 0x02
534 void (*app_gap_phy_update_cb)(uint8_t conn_idx, uint8_t status,
const gap_le_phy_ind_t *p_phy);
558 void (*app_gap_adv_start_cb)(uint8_t inst_idx, uint8_t status);
579 void (*app_gap_scan_req_ind_cb)(uint8_t inst_idx,
const gap_bdaddr_t *p_scanner_addr);
589 void (*app_gap_adv_data_update_cb)(uint8_t inst_idx, uint8_t status);
602 void (*app_gap_scan_start_cb)(uint8_t status);
642 void (*app_gap_stop_sync_cb)(uint8_t inst_idx, uint8_t status);
651 void (*app_gap_sync_lost_cb)(uint8_t inst_idx);
666 void (*app_gap_connect_cb)(uint8_t conn_idx, uint8_t status,
const gap_conn_cmp_t *p_conn_param);
677 void (*app_gap_disconnect_cb)(uint8_t conn_idx, uint8_t status, uint8_t reason);
686 void (*app_gap_connect_cancel_cb)(uint8_t status);
694 void (*app_gap_auto_connection_timeout_cb)(void);
719 void (*app_gap_connection_update_cb)(uint8_t conn_idx, uint8_t status,
const gap_conn_update_cmp_t *p_conn_param_update_info);
729 void (*app_gap_connection_update_req_cb)(uint8_t conn_idx,
const gap_conn_param_t *p_conn_param_update_req);
762 void (*app_gap_le_pkt_size_info_cb)(uint8_t conn_idx, uint8_t status,
const gap_le_pkt_size_ind_t *p_supported_data_length_size);
uint16_t suppted_max_rx_octets
Maximum number of payload octets that the local Controller supports for reception of a single Link La...
uint8_t nb_adv_sets
Number of available advertising sets.
@ GAP_HCI_AUTHENTICATION_FAILURE
Authentication Failure.
The struct of device version.
@ GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
Remote Device Terminated Connection due to Low Resources .
@ GAP_LL_ROLE_SLAVE
Slave role.
gap_peer_info_t peer_info
Peer info.
uint16_t suppted_max_tx_time
Maximum time, in microseconds, that the local Controller supports for transmission of a single Link L...
The Structure for BLE Connection Arrangement.
#define __ARRAY_EMPTY
Empty Array.
Suggested default data length info.
gap_addr_t gap_addr
Device BD Address.
uint16_t suggted_max_tx_octets
The Host's suggested value for the Controller's maximum transmitted number of payload octets to be us...
#define GAP_CHNL_MAP_LEN
The length of channel map.
uint16_t conhdl
Connection_Handle.
uint16_t conn_idx
Connection Index.
uint8_t phy_prim
Primary PHY on which advertising report has been received.
uint8_t phy
PHY on which synchronization has been established.
@ GAP_REPORT_TYPE_ADV_EXT
Extended advertising report.
uint8_t hci_ver
HCI version.
@ GAP_LL_ROLE_MASTER
Master role.
uint16_t lmp_subvers
LMP subversion.
@ GAP_OPCODE_PER_ADV_LIST_SET
Set periodic advertising list.
uint8_t lmp_vers
LMP version.
uint16_t length
Report length.
gap_get_peer_info_op_t
The operation code used to get peer device info.
uint8_t lmp_ver
LMP version.
Get peer info operation struct.
Supported data length size Indication.
uint16_t rx_path_comp
RF RX path compensation.
gap_bdaddr_t bd_addr
Advertiser address.
uint8_t phy_second
Secondary PHY on which advertising report has been received.
Max data length info struct.
gap_psm_manager_op_id_t
Operation code used for LEPSM manager.
@ GAP_GET_PEER_FEATURES
Get peer device features info.
gap_bdaddr_t direct_addr
Target address (in case of a directed advertising report).
gap_bdaddr_t broadcaster_addr
Broadcaster device address.
gap_adv_report_type_t
Advertising report type.
@ GAP_REPORT_TYPE_SCAN_RSP_EXT
Extended scan response report.
The info of connecting operation.
int8_t rssi
RSSI (between -127 and +20 dBm).
uint8_t op_code
Operation code.
Name of peer device indication.
@ GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION
Remote User Terminated Connection.
uint16_t length
Maximum advertising data length supported by controller.
uint16_t latency
Latency for the connection in number of connection events.
@ GAP_OPCODE_WHITELIST_SET
Set white list.
uint8_t rx_phy
LE PHY for data reception.
@ GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
Remote Device Terminated Connection due to Power Off.
void(* app_ble_init_cmp_cb_t)(void)
BLE initialization completed callback function for application.
@ GAP_HCI_UNSUPPORTED_REMOTE_FEATURE
Unsupported Remote Feature.
@ GAP_OPCODE_LEPSM_REGISTER
LEPSM register operation.
uint16_t max_tx_octets
The maximum number of payload octets in TX.
uint16_t ble_gap_conn_info_get(uint8_t conn_idx, gap_get_conn_info_op_t opcode)
Get the information of the connection.
uint8_t adv_info
Bit field providing information about the received report.
uint16_t sup_timeout
Supervision timeout for the LE link.
@ GAP_REPORT_INFO_SCAN_ADV_BIT
Scannable advertising.
uint8_t clk_accuracy
Clock accuracy (0x00: 500 ppm, 0x01: 250 ppm, 0x02: 150 ppm, 0x03: 100 ppm, 0x04: 75 ppm,...
uint8_t single_tx
Slave transmits a single packet per connection event (False/True).
uint16_t ble_gap_latency_set(uint8_t conn_idx, uint16_t latency)
Set connection's Latency.
uint16_t period_adv_intv
Periodic advertising interval (in unit of 1.25ms, min is 7.5ms), valid only for periodic advertising ...
gap_addr_t peer_addr
Peer device bd address.
uint16_t intv
Periodic advertising interval (in unit of 1.25ms, min is 7.5ms).
Define the chip configuration.
uint8_t peer_addr_type
Peer address type(0x00: Public Device Address, 0x01 : Random Device Address, others: reserved for fut...
uint16_t host_subver
Host subversion.
The struct of broadcast address with broadcast type.
int8_t tx_pwr
TX power (in dBm).
uint16_t interval_min
Minimum value for the connection interval.
uint8_t adv_sid
Advertising SID , valid only for periodic advertising report.
Sync established indication.
@ GAP_GET_CON_CHANNEL_MAP
Get connection channel map.
@ GAP_GET_PEER_VERSION
Get peer device version info.
@ GAP_REPORT_TYPE_SCAN_RSP_LEG
Legacy scan response report.
Connection complete info.
uint8_t opcode
Operation code.
uint16_t ble_gap_phy_update(uint8_t conn_idx, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_opt)
Set the PHY preferences for the connection identified by the connection index.
@ GAP_OPCODE_LEPSM_UNREGISTER
LEPSM unregister operation.
int8_t max_tx_pwr
MAX of TX power.
The gap callback function struct.
@ GAP_STOPPED_REASON_CONN_EST
Stop with connection established.
gap_adv_report_info_t
Advertising report information.
File that contains error codes.
uint16_t compid
Manufacturer name.
uint32_t interval
Connection Interval (in 625us).
Get broadcast address struct.
Set preference slave event duration.
uint16_t duration
Preferred event duration.
uint16_t max_tx_time
The maximum time that the local Controller will take to TX.
uint8_t operation
Operation code.
@ GAP_GET_PHY
Get connection PHY.
uint16_t tx_path_comp
RF TX path compensation.
gap_addr_t peer_addr
Peer BT address.
gap_chnl_map_t chnl_map
channel map.
@ GAP_GET_CON_RSSI
Get connection RSSI info.
uint16_t ble_gap_conn_param_update(uint8_t conn_idx, const gap_conn_update_param_t *p_conn_param)
Change the Link Layer connection parameters of a connection.
gap_sugg_dflt_data_len_t sugg_dflt_data_len
Suggested default data length info.
gap_conn_info_t info
Connection info.
uint8_t per_sync_idx
Periodic syncronization index, valid only for periodic advertising report.
gap_nb_adv_sets_t nb_adv_sets
Number of available advertising sets.
gap_dev_adv_tx_power_t adv_tx_power
Advertising TX power info.
RF path compensation values info.
gap_dev_tx_power_t dev_tx_power
Device TX power info.
uint16_t interval_max
Maximum value for the connection interval.
gap_dev_version_ind_t dev_version
Version info.
uint16_t max_rx_time
The maximum time that the local Controller will take to RX.
uint16_t con_latency
Latency for the connection in number of connection events.
uint8_t addr_type
Peer device address type.
uint8_t opcode
Operation code.
@ GAP_REPORT_INFO_CONN_ADV_BIT
Connectable advertising.
uint16_t max_rx_octets
The maximum number of payload octets in RX.
Read resolvable address info struct.
uint16_t ble_gap_con_plan_consult(uint8_t *p_act_num, gap_con_plan_tag_t **p_conn_plan_arr)
Consult BLE connection activity plan situation function.
gap_get_conn_info_op_t
The operation code used to get connection info.
@ GAP_REPORT_INFO_DIR_ADV_BIT
Directed advertising.
#define GAP_FEATS_LEN
The length of features.
gap_dev_rf_path_comp_ind_t dev_rf_path_comp
RF path compensation values.
@ GAP_OPCODE_PRIVACY_MODE_SET
Set privacy mode for peer device.
gap_le_phy_ind_t phy
PHY indicaiton.
uint16_t ble_gap_data_length_update(uint8_t conn_idx, uint16_t tx_octects, uint16_t tx_time)
The suggested maximum transmission packet size and maximum packet transmission time to be used for a ...
uint16_t sync_hdl
Sync handle.
uint16_t con_interval
Connection interval.
gap_bdaddr_t bd_addr
BD address.
@ GAP_HCI_CONN_INTERVAL_UNACCEPTABLE
Unacceptable Connection Parameters.
gap_rslv_addr_read_op_id_t
Operation code used to read resolvable address.
uint16_t suppted_max_tx_octets
Maximum number of payload octets that the local Controller supports for transmission of a single Link...
uint16_t hci_subver
HCI subversion.
gap_dev_info_t dev_info
Device info.
uint16_t sup_to
Connection supervision timeout.
uint16_t manuf_name
Manufacturer name.
uint8_t chan_sel_algo
Chanel Selection algorithm, 0x00: LE Channel Selection Algorithm #1 is used.
uint16_t sup_timeout
Supervision timeout for the LE link.
Get device info operation struct.
uint16_t ble_gap_disconnect_with_reason(uint8_t conn_idx, gap_disconn_reason_t reason)
Terminate an existing connection with a specified reason.
@ GAP_STOPPED_REASON_TIMEOUT
Stop with timeout.
#define GAP_ADDR_LEN
The length of address.
gap_disconn_reason_t
The specified reason for terminating a connection.
uint16_t lmp_subver
LMP subversion.
uint32_t offset
Connection Offset (in 625us).
Connection parameter used to update connection parameters.
gap_max_adv_data_len_ind_t max_adv_data_len
Maximum advertising data length info.
gap_peer_features_ind_t peer_features
Features info.
uint16_t ble_gap_disconnect(uint8_t conn_idx)
Terminate an existing connection.
uint8_t index
Advertsing index.
The parameter of connection.
uint32_t duration
Connection Duration (in 625us).
gap_ll_role_type_t
Device role of LL layer type.
@ GAP_OPCODE_LOCAL_RSLV_ADDR_READ
Local resolvable address operation.
@ GAP_REPORT_TYPE_PER_ADV
Periodic advertising report.
uint16_t interval
Connection interval.
uint8_t tx_phy
LE PHY for data transmission.
gap_stopped_reason_t
Stop reason code.
int8_t min_tx_pwr
MIN of TX power.
uint16_t suppted_max_rx_time
Maximum time, in microseconds, that the local Controller supports for reception of a single Link Laye...
gap_addr_t gap_addr
Resolvable address info.
gap_ll_role_type_t ll_role
Device Role of LL Layer.
uint16_t ble_gap_conn_param_update_reply(uint8_t conn_idx, bool accept)
Connection param update reply to peer device.
APP receives the extended advertising report indication info struct.
uint16_t suggted_max_tx_time
The Host's suggested value for the Controller's maximum packet transmission time to be used for new c...
uint8_t adv_type
Advertising type.
uint8_t addr_type
Address type of the device: 0=public/1=random.
@ GAP_GET_CHAN_SEL_ALGO
Get selection algorithm for connection channel.
The parameter of update connection.
Number of available advertising sets info.
gap_max_data_len_t max_data_len
Suggested MAX data length info.
gap_get_bd_addr_t get_bd_addr
Device BD address info.
@ GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED
Pairing With Unit Key Not Supported.
int8_t power_lvl
Advertising channel TX power level.
@ GAP_REPORT_INFO_COMPLETE_BIT
Report is complete.
Maximum advertising data length info.
uint16_t ce_len
The length of connection event needed for this LE connection.
@ GAP_STOPPED_REASON_ON_USER
Stop with user stopping it actively.
uint16_t slave_latency
Slave latency for the connection in number of connection events.
uint16_t interval_min
Minimum value for the connection interval.
uint8_t clk_acc
Advertiser clock accuracy.
uint8_t adv_sid
Advertising SID.
uint16_t slave_latency
Slave latency for the connection in number of connection events.
@ GAP_REPORT_TYPE_ADV_LEG
Legacy advertising report.
uint8_t host_ver
Host version.
uint16_t interval_max
Maximum value for the connection interval.
uint16_t ble_gap_peer_info_get(uint8_t conn_idx, gap_get_peer_info_op_t opcode)
Get the information of the peer device.
gap_peer_version_ind_t peer_version
Version info.
gap_param_set_op_id_t
Operation code used to set param(s).
uint8_t name_len
Peer device name length.
@ GAP_OPCODE_CHNL_MAP_SET
Set Channel Map.
uint16_t sup_timeout
Supervision timeout for the LE link.
@ GAP_OPCODE_PEER_RSLV_ADDR_READ
Peer resolvable address operation.