Data Structures | Macros | Typedefs | Enumerations | Functions
ble_gapc.h File Reference

BLE GAPC API. More...

`#include "ble_error.h"`
`#include "gr55xx_sys_cfg.h"`
`#include <stdint.h>`
`#include <string.h>`
`#include <stdbool.h>`

Go to the source code of this file.

## Data Structures
struct | gap_dev_version_ind_t
| The struct of device version. More...
struct | gap_addr_t
| The struct of address. More...
struct | gap_bdaddr_t
| The struct of broadcast address with broadcast type. More...
struct | gap_get_bd_addr_t
| Get broadcast address struct. More...
struct | gap_dev_adv_tx_power_t
| TX power info struct. More...
struct | gap_dev_tx_power_t
| TX power info struct. More...
struct | gap_max_data_len_t
| Max data length info struct. More...
struct | gap_sugg_dflt_data_len_t
| Suggested default data length info. More...
struct | gap_nb_adv_sets_t
| Number of available advertising sets info. More...
struct | gap_max_adv_data_len_ind_t
| Maximum advertising data length info. More...
struct | gap_dev_rf_path_comp_ind_t
| RF path compensation values info. More...
union | gap_dev_info_t
| Device info. More...
struct | gap_dev_info_get_t
| Get device info operation struct. More...
struct | gap_rslv_addr_read_t
| Read resolvable address info struct. More...
struct | gap_sync_established_ind_t
| Sync established indication. More...
struct | gap_ext_adv_report_ind_t
| APP receives the extended advertising report indication info struct. More...
struct | gap_peer_name_ind_t
| Name of peer device indication. More...
struct | gap_conn_update_cmp_t
| Connection parameter used to update connection parameters. More...
struct | gap_conn_param_t
| The parameter of connection. More...
struct | gap_conn_update_param_t
| The parameter of update connection. More...
struct | gap_conn_cmp_t
| Connection complete info. More...
struct | gap_chnl_map_t
| Channel map structure. More...
struct | gap_le_phy_ind_t
| PHY info. More...
union | gap_conn_info_t
| Connection info. More...
struct | gap_conn_info_param_t
| The info of connecting operation. More...
struct | gap_peer_version_ind_t
| Peer version info. More...
struct | gap_peer_features_ind_t
| LE features info. More...
union | gap_peer_info_t
| LE peer info. More...
struct | gap_peer_info_param_t
| Get peer info operation struct. More...
struct | gap_le_pkt_size_ind_t
| Supported data length size Indication. More...
struct | gap_con_plan_tag_t
| The Structure for BLE Connection Arrangement. More...
struct | gap_set_pref_slave_evt_dur_param_t
| Set preference slave event duration. More...
struct | gap_cb_fun_t
| The gap callback function struct. More...

## Macros
#define | GAP_CHNL_MAP_LEN 0x05
#define | GAP_FEATS_LEN 0x08
#define | GAP_ADDR_LEN 0x06
#define | GAP_INVALID_CONN_INDEX 0xFF
#define | BLE_GAP_ADDR_TYPE_PUBLIC 0x00
#define | BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01
#define | PHY_OPT_NO_CODING 0x00
#define | PHY_OPT_S2_CODING 0x01
#define | PHY_OPT_S8_CODING 0x02

## Typedefs
typedef void(* | app_ble_init_cmp_cb_t) (void)
| BLE initialization completed callback function for application.

## Enumerations
enum | gap_get_conn_info_op_t { GAP_GET_CON_RSSI = 0, GAP_GET_CON_CHANNEL_MAP, GAP_GET_PHY, GAP_GET_CHAN_SEL_ALGO }
| The operation code used to get connection info. More...
enum | gap_get_peer_info_op_t { GAP_GET_PEER_VERSION = 0, GAP_GET_PEER_FEATURES }
| The operation code used to get peer device info. More...
enum | gap_adv_report_type_t { GAP_REPORT_TYPE_ADV_EXT = 0, GAP_REPORT_TYPE_ADV_LEG, GAP_REPORT_TYPE_SCAN_RSP_EXT, GAP_REPORT_TYPE_SCAN_RSP_LEG, GAP_REPORT_TYPE_PER_ADV }
| Advertising report type. More...
enum | gap_adv_report_info_t { GAP_REPORT_INFO_COMPLETE_BIT = (1 << 0), GAP_REPORT_INFO_CONN_ADV_BIT = (1 << 1), GAP_REPORT_INFO_SCAN_ADV_BIT = (1 << 2), GAP_REPORT_INFO_DIR_ADV_BIT = (1 << 3) }
| Advertising report information. More...
enum | gap_stopped_reason_t { GAP_STOPPED_REASON_TIMEOUT = 0, GAP_STOPPED_REASON_ON_USER, GAP_STOPPED_REASON_CONN_EST }
| Stop reason code. More...
enum | gap_ll_role_type_t { GAP_LL_ROLE_MASTER = 0, GAP_LL_ROLE_SLAVE = 1 }
| Device role of LL layer type. More...
enum | gap_param_set_op_id_t { GAP_OPCODE_CHNL_MAP_SET, GAP_OPCODE_WHITELIST_SET, GAP_OPCODE_PER_ADV_LIST_SET, GAP_OPCODE_PRIVACY_MODE_SET }
| Operation code used to set param(s). More...
enum | gap_rslv_addr_read_op_id_t { GAP_OPCODE_LOCAL_RSLV_ADDR_READ, GAP_OPCODE_PEER_RSLV_ADDR_READ }
| Operation code used to read resolvable address. More...
enum | gap_psm_manager_op_id_t { GAP_OPCODE_LEPSM_REGISTER, GAP_OPCODE_LEPSM_UNREGISTER }
| Operation code used for LEPSM manager. More...
enum | gap_disconn_reason_t { GAP_HCI_AUTHENTICATION_FAILURE = 0x05, GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13, GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES = 0x14, GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF = 0x15, GAP_HCI_UNSUPPORTED_REMOTE_FEATURE = 0x1A, GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED = 0X29, GAP_HCI_CONN_INTERVAL_UNACCEPTABLE = 0x3B }
| The specified reason for terminating a connection. More...

## Functions
uint16_t | ble_gap_disconnect (uint8_t conn_idx)
| Terminate an existing connection. More...
uint16_t | ble_gap_disconnect_with_reason (uint8_t conn_idx, gap_disconn_reason_t reason)
| Terminate an existing connection with a specified reason. More...
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. More...
uint16_t | ble_gap_latency_set (uint8_t conn_idx, uint16_t latency)
| Set connection's Latency. More...
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. More...
uint16_t | ble_gap_conn_param_update_reply (uint8_t conn_idx, bool accept)
| Connection param update reply to peer device. More...
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 given connection. More...
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. More...
uint16_t | ble_gap_conn_info_get (uint8_t conn_idx, gap_get_conn_info_op_t opcode)
| Get the information of the connection. More...
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. More...

## Detailed Description

BLE GAPC API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.