| Airoha M0 BLE API 1.0.5.4

Data Structures | Macros | Typedefs | Enumerations | Functions
ble_gap.h

## Data Structures
struct | ble_addr_t
| BLE address structure. More...
struct | ble_gap_whitelist_t
| BLE while listing. More...
struct | ble_gap_adv_params
| BLE advertisement parameter. More...
struct | ble_gap_scan_params_t
| Parameter for scanning. More...
struct | ble_gap_create_conn_params_t
| parameters for creating a link More...
struct | ble_gap_conn_params_t
| parameters for a link It is usually used for updating parameters of a connection. More...
struct | ble_gap_master_id_t
| GAP Master Identification. More...
struct | ble_gap_evt_connected_t
| Event structure for BLE_GAP_EVT_CONNECTED. More...
struct | ble_gap_evt_disconnected_t
| Event structure for BLE_GAP_EVT_DISCONNECTED. More...
struct | ble_gap_evt_conn_param_update_t
| Event structure for BLE_GAP_EVT_CONNECT_PARM_UPDATE. More...
struct | ble_gap_evt_adv_report_t
| Event structure for BLE_GAP_EVT_ADV_REPORT. More...
struct | ble_gap_evt_conn_param_update_request_t
| Event structure for BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST. More...
struct | ble_gap_evt_operation_fail_t
| Event structure for BLE_GAP_EVT_DISCONNECT_FAIL, BLE_GAP_EVT_CONNECT_FAIL, BLE_GAP_EVT_START_ENCRYPT_FAIL and BLE_GAP_EVT_CONN_PARM_UPDATE_FAIL. More...
struct | ble_gap_evt_remote_version_t
| Event structure for BLE_GAP_EVT_READ_REMOTE_VERSION. More...
struct | ble_gap_evt_t
| GAP event structure. More...

## Macros
#define | BLE_GAP_ADV_MAX_SIZE 31
| Maximum size of advertising data in octets.

## Typedefs
typedef void(* | ai_cfm_gap_general) (bool isuccess, uint8_t err_code)
| Callback prototype for GAP operations. More...

## Enumerations
enum | ble_addr_type { ble_addr_type_public = 0, ble_addr_type_random_static = 1, ble_addr_type_random_resolvable = 2, ble_addr_type_random_non_resolvable = 3 }
| BLE ddress Type. More...
enum | ble_ad_type { ble_ad_type_ind = 0x00, ble_ad_type_direct_ind = 0x01, ble_ad_type_scan_ind = 0x02, ble_ad_type_nonconn_ind = 0x03, ble_ad_type_direct_ind_low = 0x04 }
| BLE AD Type The AD type was mapping to advertising PDU ID. More...
enum | ble_scan_type { ble_scan_type_passive = 0x00, ble_scan_type_active = 0x01 }
| BLE Scan Type Scan type which used in structure ble_gap_scan_params_t. More...
enum | ble_report_type { ble_report_type_ind = 0x00, ble_report_type_direct_ind = 0x01, ble_report_type_scan_ind = 0x02, ble_report_type_nonconn_ind = 0x03, ble_report_type_scan_rsp = 0x04 }
| BLE Report Type The report type is for the scanned peers' type. It could be AD type of passive scan or active scan(SCAN_RSP). It was used in structure ble_gap_evt_adv_report_t. More...
enum | ble_filter_policy_t { ble_filter_any = 0x00, ble_filter_filter_scan = 0x01, ble_filter_filter_conn = 0x02, ble_filter_filter_both = 0x03 }
| BLE Advertising Filter Policy. It was used in struct ble_gap_adv_params to indicate policy of filtering peers while advertising. More...
enum | ble_scan_policy_t { ble_scan_policy_0 = 0x00, ble_scan_policy_1 = 0x01, ble_scan_policy_2 = 0x02, ble_scan_policy_3 = 0x03 }
| BLE Scan Fileter Policy. More...
enum | ble_gap_event_id { BLE_GAP_EVT_CONNECTED = BT_EVENT_GAP, BLE_GAP_EVT_DISCONNECTED, BLE_GAP_EVT_CONNECT_PARM_UPDATE, BLE_GAP_EVT_ADV_REPORT, BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, BLE_GAP_EVT_DISCONNECT_FAIL, BLE_GAP_EVT_CONNECT_FAIL, BLE_GAP_EVT_START_ENCRYPT_FAIL, BLE_GAP_EVT_CONN_PARM_UPDATE_FAIL, BLE_GAP_EVT_READ_REMOTE_VERSION }
| GAP Event IDs. IDs that uniquely identify an event. More...

## Functions
BT_STATUS | ble_gap_adv_data_set (uint8_t *p_data, uint8_t dlen, ai_cfm_gap_general cb)
| Set Advertisement Data API. More...
BT_STATUS | ble_gap_scan_data_set (uint8_t *p_data, uint8_t dlen, ai_cfm_gap_general cb)
| Set Scan Response Data. More...
BT_STATUS | ble_gap_adv_set_parameter (ble_gap_adv_params *parm, ai_cfm_gap_general cb)
| Set Advertisement Parameter. More...
BT_STATUS | ble_gap_adv_start (ble_gap_adv_params *parm, ai_cfm_gap_general cb)
| Start Advertisement. More...
BT_STATUS | ble_gap_adv_stop (ai_cfm_gap_general cb)
| Stop Advertisement. More...
BT_STATUS | ble_gap_address_set (ble_addr_t *addr, ai_cfm_gap_general cb)
| Set BLE address. More...
BT_STATUS | ble_gap_pub_address_get (ble_addr_t *addr)
| Get Public BLE address. More...
BT_STATUS | ble_gap_random_address_get (ble_addr_t *addr)
| Get static random BLE address. More...
BT_STATUS | ble_gap_disconnect (uint16_t handle, uint8_t reason)
| Disconnect link. More...
BT_STATUS | ble_gap_tx_power_set (int8_t tx_power, ai_cfm_gap_general cb)
| Set TX power. More...
BT_STATUS | ble_gap_scan_set_parameter (ble_gap_scan_params_t *p_scan_params, ai_cfm_gap_general cb)
| Set Scan parameter. More...
BT_STATUS | ble_gap_scan_start (ble_gap_scan_params_t const *const p_scan_params, ai_cfm_gap_general cb)
| Start scan. More...
BT_STATUS | ble_gap_scan_stop (ai_cfm_gap_general cb)
| Stop scan. More...
BT_STATUS | ble_gap_start_encrypt (uint16_t conn_handle, ble_gap_master_id_t const *p_master_id)
| Start link encrypt. More...
BT_STATUS | ble_gap_conn_param_update (uint16_t handle, ble_gap_conn_params_t const *const p_conn_params)
| Connect update request. More...
BT_STATUS | ble_gap_connect (ble_gap_create_conn_params_t *p_conn_params)
| Connect request. More...
BT_STATUS | ble_gap_connect_cancel (ai_cfm_gap_general cb)
| Cancel ongoing connection request. More...
BT_STATUS | ble_gap_add_whitelist (ble_gap_whitelist_t *p_wlst, ai_cfm_gap_general cb)
| Add whiteList. More...
BT_STATUS | ble_gap_remote_version (uint16_t handle)
| Obtain remote version information. More...
void | ble_gap_disable_latency (uint8_t byDisable)
| Disable slave latency. More...
BT_STATUS | ble_gap_get_rssi (uint16_t handle, ai_cfm_gap_general cb)
| Get connection RSSI. More...

## GAP Role [Defines]
GAP Link's Roles
#define | BLE_GAP_ROLE_MASTER 0x00
| Master role.
#define | BLE_GAP_ROLE_SLAVE 0x01
| Slave role.

## GAP AD DATA TYPE [Defines]
GAP Advertisement Type
#define | BLE_GAP_AD_TYPE_FLAGS 0x01
| Flags for discoverability.
#define | BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02
| Partial list of 16 bit service UUIDs.
#define | BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03
| Complete list of 16 bit service UUIDs.
#define | BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04
| Partial list of 32 bit service UUIDs.
#define | BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05
| Complete list of 32 bit service UUIDs.
#define | BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06
| Partial list of 128 bit service UUIDs.
#define | BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07
| Complete list of 128 bit service UUIDs.
#define | BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08
| Short local device name.
#define | BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09
| Complete local device name.
#define | BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A
| Transmit power level.
#define | BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D
| Class of device.
#define | BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E
| Simple Pairing Hash C.
#define | BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F
| Simple Pairing Randomizer R.
#define | BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10
| Security Manager TK Value.
#define | BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11
| Security Manager Out Of Band Flags.
#define | BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12
| Slave Connection Interval Range.
#define | BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14
| List of 16-bit Service Solicitation UUIDs.
#define | BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15
| List of 128-bit Service Solicitation UUIDs.
#define | BLE_GAP_AD_TYPE_SERVICE_DATA 0x16
| Service Data - 16-bit UUID.
#define | BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17
| Public Target Address.
#define | BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18
| Random Target Address.
#define | BLE_GAP_AD_TYPE_APPEARANCE 0x19
| Appearance.
#define | BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A
| Advertising Interval.
#define | BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B
| LE Bluetooth Device Address.
#define | BLE_GAP_AD_TYPE_LE_ROLE 0x1C
| LE Role.
#define | BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D
| Simple Pairing Hash C-256.
#define | BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E
| Simple Pairing Randomizer R-256.
#define | BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20
| Service Data - 32-bit UUID.
#define | BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21
| Service Data - 128-bit UUID.
#define | BLE_GAP_AD_TYPE_UNIFORM_RESOUCE_IDENTIFIER 0x24
| Uniform Resource Identifier.
#define | BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D
| 3D Information Data.
#define | BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF
| Manufacturer Specific Data.

## GAP Advertisement Interval Constants [Defines]
#define | BLE_ADV_INTERVAL_MIN 0x0020
| Minimum Advertising interval in 625 us units, i.e. 20 ms.
#define | BLE_ADV_NONCON_INTERVAL_MIN 0x00A0
| Minimum Advertising interval in 625 us units for non connectable mode, i.e. 100 ms.
#define | BLE_ADV_INTERVAL_MAX 0x4000
| Maximum Advertising interval in 625 us units, i.e. 10.24 s.

## GAP Scan Interval Constants [Defines]
#define | BLE_SCAN_INTERVAL_MIN 0x0004
| Minimum Scan interval in 625 us units, i.e. 2.5 ms.
#define | BLE_SCAN_INTERVAL_MAX 0x4000
| Maximum Scan interval in 625 us units, i.e. 10.24 s.

## GAP Scan Window Constants [Defines]
#define | BLE_SCAN_WINDOW_MIN 0x0004
| Minimum Scan window in 625 us units, i.e. 2.5 ms.
#define | BLE_SCAN_WINDOW_MAX 0x4000
| Maximum Scan window in 625 us units, i.e. 10.24 s.

## GAP Scan Timeout Constants [Defines]
#define | BLE_SCAN_TIMEOUT_MIN 0x0001
| Minimum Scan timeout in seconds.
#define | BLE_SCAN_TIMEOUT_MAX 0xFFFF
| Maximum Scan timeout in seconds.

## BLE_GAP_ADV_FLAGS GAP Advertisement Flags
#define | BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01)
| LE Limited Discoverable Mode.
#define | BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01)
| LE Limited Discoverable Mode.
#define | BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02)
| LE General Discoverable Mode.
#define | BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02)
| LE General Discoverable Mode.
#define | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04)
| BR/EDR not supported.
#define | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04)
| BR/EDR not supported.
#define | BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08)
| Simultaneous LE and BR/EDR, Controller.
#define | BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08)
| Simultaneous LE and BR/EDR, Controller.
#define | BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10)
| Simultaneous LE and BR/EDR, Host.
#define | BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10)
| Simultaneous LE and BR/EDR, Host.
#define | BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
| LE Limited Discoverable Mode, BR/EDR not supported. More...
#define | BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
| LE Limited Discoverable Mode, BR/EDR not supported. More...
#define | BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
| LE General Discoverable Mode, BR/EDR not supported. More...
#define | BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
| LE General Discoverable Mode, BR/EDR not supported. More...

## BLE_GAP_ADV_INTERVALS GAP Advertising interval max and min
#define | BLE_GAP_ADV_INTERVAL_MIN 0x0020
| Minimum Advertising interval in 625 us units, i.e. 20 ms.
#define | BLE_GAP_ADV_NONCON_INTERVAL_MIN 0x00A0
| Minimum Advertising interval in 625 us units for non connectable mode, i.e. 100 ms.
#define | BLE_GAP_ADV_INTERVAL_MAX 0x4000
| Maximum Advertising interval in 625 us units, i.e. 10.24 s.

## BLE_GAP_SCAN_INTERVALS GAP Scan interval max and min
#define | BLE_GAP_SCAN_INTERVAL_MIN 0x0004
| Minimum Scan interval in 625 us units, i.e. 2.5 ms.
#define | BLE_GAP_SCAN_INTERVAL_MAX 0x4000
| Maximum Scan interval in 625 us units, i.e. 10.24 s.

## BLE_GAP_SCAN_WINDOW GAP Scan window max and min
#define | BLE_GAP_SCAN_WINDOW_MIN 0x0004
| Minimum Scan window in 625 us units, i.e. 2.5 ms.
#define | BLE_GAP_SCAN_WINDOW_MAX 0x4000
| Maximum Scan window in 625 us units, i.e. 10.24 s.

## BLE_GAP_ADDR_TYPES GAP Address types
#define | BLE_GAP_ADDR_TYPE_PUBLIC 0x00
| Public address.
#define | BLE_GAP_ADDR_TYPE_RANDOM 0x01
| Random address.

## BLE_GAP_ADV_TYPES GAP Advertising types
#define | BLE_GAP_ADV_TYPE_ADV_IND 0x00
| Connectable undirected.
#define | BLE_GAP_ADV_TYPE_ADV_DIRECT_IND 0x01
| Connectable directed.
#define | BLE_GAP_ADV_TYPE_ADV_SCAN_IND 0x02
| Scannable undirected.
#define | BLE_GAP_ADV_TYPE_ADV_NONCONN_IND 0x03
| Non connectable undirected.

## BLE_GAP_ADV_CHANNEL_MAP channel map
@ {
#define | BLE_GAP_ADV_CHANNEL_MAP_37 1
#define | BLE_GAP_ADV_CHANNEL_MAP_38 2
#define | BLE_GAP_ADV_CHANNEL_MAP_39 4
#define | BLE_GAP_ADV_CHANNEL_MAP_ALL 7

## BLE_GAP_ADV_FILTER_POLICIES GAP Advertising filter policies
#define | BLE_GAP_ADV_FP_ANY 0x00
| Allow scan requests and connect requests from any device.
#define | BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01
| Filter scan requests with whitelist.
#define | BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02
| Filter connect requests with whitelist.
#define | BLE_GAP_ADV_FP_FILTER_BOTH 0x03
| Filter both scan and connect requests with whitelist.

## BLE_CONN_HANDLES BLE Connection Handles
#define | BLE_CONN_HANDLE_INVALID 0xFFFF
| Invalid Connection Handle.
#define | BLE_CONN_HANDLE_ALL 0xFFFE
| Applies to all Connection Handles.

## BLE_UUID_VALUES Assigned Values for BLE UUIDs
#define | BLE_UUID_UNKNOWN 0x0000
| Reserved UUID.
#define | BLE_UUID_SERVICE_PRIMARY 0x2800
| Primary Service.
#define | BLE_UUID_SERVICE_SECONDARY 0x2801
| Secondary Service.
#define | BLE_UUID_SERVICE_INCLUDE 0x2802
| Include.
#define | BLE_UUID_CHARACTERISTIC 0x2803
| Characteristic.
#define | BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900
| Characteristic Extended Properties Descriptor.
#define | BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901
| Characteristic User Description Descriptor.
#define | BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902
| Client Characteristic Configuration Descriptor.
#define | BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903
| Server Characteristic Configuration Descriptor.
#define | BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904
| Characteristic Presentation Format Descriptor.
#define | BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905
| Characteristic Aggregate Format Descriptor.
#define | BLE_UUID_GATT 0x1801
| Generic Attribute Profile.
#define | BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05
| Service Changed Characteristic.
#define | BLE_UUID_GAP 0x1800
| Generic Access Profile.
#define | BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00
| Device Name Characteristic.
#define | BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01
| Appearance Characteristic.
#define | BLE_UUID_GAP_CHARACTERISTIC_PPF 0x2A02
| Peripheral Privacy Flag Characteristic.
#define | BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03
| Reconnection Address Characteristic.
#define | BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04
| Peripheral Preferred Connection Parameters Characteristic.

## UUID_SERVICES Service UUID definitions
#define | BLE_UUID_ALERT_NOTIFICATION_SERVICE 0x1811
| Alert Notification service UUID.
#define | BLE_UUID_BATTERY_SERVICE 0x180F
| Battery service UUID. */.
#define | BLE_UUID_BLOOD_PRESSURE_SERVICE 0x1810
| Blood Pressure service UUID. */.
#define | BLE_UUID_CURRENT_TIME_SERVICE 0x1805
| Current Time service UUID. */.
#define | BLE_UUID_CYCLING_SPEED_AND_CADENCE 0x1816
| Cycling Speed and Cadence service UUID. */.
#define | BLE_UUID_LOCATION_AND_NAVIGATION_SERVICE 0x1819
| Location and Navigation service UUID. */.
#define | BLE_UUID_DEVICE_INFORMATION_SERVICE 0x180A
| Device Information service UUID. */.
#define | BLE_UUID_GLUCOSE_SERVICE 0x1808
| Glucose service UUID. */.
#define | BLE_UUID_HEALTH_THERMOMETER_SERVICE 0x1809
| Health Thermometer service UUID. */.
#define | BLE_UUID_HEART_RATE_SERVICE 0x180D
| Heart Rate service UUID. */.
#define | BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE 0x1812
| Human Interface Device service UUID. */.
#define | BLE_UUID_IMMEDIATE_ALERT_SERVICE 0x1802
| Immediate Alert service UUID. */.
#define | BLE_UUID_LINK_LOSS_SERVICE 0x1803
| Link Loss service UUID. */.
#define | BLE_UUID_NEXT_DST_CHANGE_SERVICE 0x1807
| Next Dst Change service UUID. */.
#define | BLE_UUID_PHONE_ALERT_STATUS_SERVICE 0x180E
| Phone Alert Status service UUID. */.
#define | BLE_UUID_REFERENCE_TIME_UPDATE_SERVICE 0x1806
| Reference Time Update service UUID. */.
#define | BLE_UUID_RUNNING_SPEED_AND_CADENCE 0x1814
| Running Speed and Cadence service UUID. */.
#define | BLE_UUID_SCAN_PARAMETERS_SERVICE 0x1813
| Scan Parameters service UUID. */.
#define | BLE_UUID_TX_POWER_SERVICE 0x1804
| TX Power service UUID. */.
#define | BLE_UUID_IPSP_SERVICE 0x1820
| Internet Protocol Support service UUID. */.
#define | BLE_UUID_BMS_SERVICE 0x181E
| BOND MANAGEMENT service UUID*/.
#define | BLE_UUID_CGM_SERVICE 0x181F
| Contiunous Glucose Monitoring service UUID*/.
#define | BLE_UUID_PLX_SERVICE 0x1822
| Pulse Oximeter Service UUID*/.

## UUID_CHARACTERISTICS Characteristic UUID definitions
#define | BLE_UUID_REMOVABLE_CHAR 0x2A3A
| Removable characteristic UUID. */.
#define | BLE_UUID_SERVICE_REQUIRED_CHAR 0x2A3B
| Service Required characteristic UUID. */.
#define | BLE_UUID_ALERT_CATEGORY_ID_CHAR 0x2A43
| Alert Category Id characteristic UUID. */.
#define | BLE_UUID_ALERT_CATEGORY_ID_BIT_MASK_CHAR 0x2A42
| Alert Category Id Bit Mask characteristic UUID. */.
#define | BLE_UUID_ALERT_LEVEL_CHAR 0x2A06
| Alert Level characteristic UUID. */.
#define | BLE_UUID_ALERT_NOTIFICATION_CONTROL_POINT_CHAR 0x2A44
| Alert Notification Control Point characteristic UUID. */.
#define | BLE_UUID_ALERT_STATUS_CHAR 0x2A3F
| Alert Status characteristic UUID. */.
#define | BLE_UUID_BATTERY_LEVEL_CHAR 0x2A19
| Battery Level characteristic UUID. */.
#define | BLE_UUID_BLOOD_PRESSURE_FEATURE_CHAR 0x2A49
| Blood Pressure Feature characteristic UUID. */.
#define | BLE_UUID_BLOOD_PRESSURE_MEASUREMENT_CHAR 0x2A35
| Blood Pressure Measurement characteristic UUID. */.
#define | BLE_UUID_BODY_SENSOR_LOCATION_CHAR 0x2A38
| Body Sensor Location characteristic UUID. */.
#define | BLE_UUID_BOOT_KEYBOARD_INPUT_REPORT_CHAR 0x2A22
| Boot Keyboard Input Report characteristic UUID. */.
#define | BLE_UUID_BOOT_KEYBOARD_OUTPUT_REPORT_CHAR 0x2A32
| Boot Keyboard Output Report characteristic UUID. */.
#define | BLE_UUID_BOOT_MOUSE_INPUT_REPORT_CHAR 0x2A33
| Boot Mouse Input Report characteristic UUID. */.
#define | BLE_UUID_CURRENT_TIME_CHAR 0x2A2B
| Current Time characteristic UUID. */.
#define | BLE_UUID_DATE_TIME_CHAR 0x2A08
| Date Time characteristic UUID. */.
#define | BLE_UUID_DAY_DATE_TIME_CHAR 0x2A0A
| Day Date Time characteristic UUID. */.
#define | BLE_UUID_DAY_OF_WEEK_CHAR 0x2A09
| Day Of Week characteristic UUID. */.
#define | BLE_UUID_DST_OFFSET_CHAR 0x2A0D
| Dst Offset characteristic UUID. */.
#define | BLE_UUID_EXACT_TIME_256_CHAR 0x2A0C
| Exact Time 256 characteristic UUID. */.
#define | BLE_UUID_FIRMWARE_REVISION_STRING_CHAR 0x2A26
| Firmware Revision String characteristic UUID. */.
#define | BLE_UUID_GLUCOSE_FEATURE_CHAR 0x2A51
| Glucose Feature characteristic UUID. */.
#define | BLE_UUID_GLUCOSE_MEASUREMENT_CHAR 0x2A18
| Glucose Measurement characteristic UUID. */.
#define | BLE_UUID_GLUCOSE_MEASUREMENT_CONTEXT_CHAR 0x2A34
| Glucose Measurement Context characteristic UUID. */.
#define | BLE_UUID_HARDWARE_REVISION_STRING_CHAR 0x2A27
| Hardware Revision String characteristic UUID. */.
#define | BLE_UUID_HEART_RATE_CONTROL_POINT_CHAR 0x2A39
| Heart Rate Control Point characteristic UUID. */.
#define | BLE_UUID_HEART_RATE_MEASUREMENT_CHAR 0x2A37
| Heart Rate Measurement characteristic UUID. */.
#define | BLE_UUID_HID_CONTROL_POINT_CHAR 0x2A4C
| Hid Control Point characteristic UUID. */.
#define | BLE_UUID_HID_INFORMATION_CHAR 0x2A4A
| Hid Information characteristic UUID. */.
#define | BLE_UUID_IEEE_REGULATORY_CERTIFICATION_DATA_LIST_CHAR 0x2A2A
| IEEE Regulatory Certification Data List characteristic UUID. */.
#define | BLE_UUID_INTERMEDIATE_CUFF_PRESSURE_CHAR 0x2A36
| Intermediate Cuff Pressure characteristic UUID. */.
#define | BLE_UUID_INTERMEDIATE_TEMPERATURE_CHAR 0x2A1E
| Intermediate Temperature characteristic UUID. */.
#define | BLE_UUID_LOCAL_TIME_INFORMATION_CHAR 0x2A0F
| Local Time Information characteristic UUID. */.
#define | BLE_UUID_MANUFACTURER_NAME_STRING_CHAR 0x2A29
| Manufacturer Name String characteristic UUID. */.
#define | BLE_UUID_MEASUREMENT_INTERVAL_CHAR 0x2A21
| Measurement Interval characteristic UUID. */.
#define | BLE_UUID_MODEL_NUMBER_STRING_CHAR 0x2A24
| Model Number String characteristic UUID. */.
#define | BLE_UUID_UNREAD_ALERT_CHAR 0x2A45
| Unread Alert characteristic UUID. */.
#define | BLE_UUID_NEW_ALERT_CHAR 0x2A46
| New Alert characteristic UUID. */.
#define | BLE_UUID_PNP_ID_CHAR 0x2A50
| PNP Id characteristic UUID. */.
#define | BLE_UUID_PROTOCOL_MODE_CHAR 0x2A4E
| Protocol Mode characteristic UUID. */.
#define | BLE_UUID_RECORD_ACCESS_CONTROL_POINT_CHAR 0x2A52
| Record Access Control Point characteristic UUID. */.
#define | BLE_UUID_REFERENCE_TIME_INFORMATION_CHAR 0x2A14
| Reference Time Information characteristic UUID. */.
#define | BLE_UUID_REPORT_CHAR 0x2A4D
| Report characteristic UUID. */.
#define | BLE_UUID_REPORT_MAP_CHAR 0x2A4B
| Report Map characteristic UUID. */.
#define | BLE_UUID_RINGER_CONTROL_POINT_CHAR 0x2A40
| Ringer Control Point characteristic UUID. */.
#define | BLE_UUID_RINGER_SETTING_CHAR 0x2A41
| Ringer Setting characteristic UUID. */.
#define | BLE_UUID_SCAN_INTERVAL_WINDOW_CHAR 0x2A4F
| Scan Interval Window characteristic UUID. */.
#define | BLE_UUID_SCAN_REFRESH_CHAR 0x2A31
| Scan Refresh characteristic UUID. */.
#define | BLE_UUID_SERIAL_NUMBER_STRING_CHAR 0x2A25
| Serial Number String characteristic UUID. */.
#define | BLE_UUID_SOFTWARE_REVISION_STRING_CHAR 0x2A28
| Software Revision String characteristic UUID. */.
#define | BLE_UUID_SUPPORTED_NEW_ALERT_CATEGORY_CHAR 0x2A47
| Supported New Alert Category characteristic UUID. */.
#define | BLE_UUID_SUPPORTED_UNREAD_ALERT_CATEGORY_CHAR 0x2A48
| Supported Unread Alert Category characteristic UUID. */.
#define | BLE_UUID_SYSTEM_ID_CHAR 0x2A23
| System Id characteristic UUID. */.
#define | BLE_UUID_TEMPERATURE_MEASUREMENT_CHAR 0x2A1C
| Temperature Measurement characteristic UUID. */.
#define | BLE_UUID_TEMPERATURE_TYPE_CHAR 0x2A1D
| Temperature Type characteristic UUID. */.
#define | BLE_UUID_TIME_ACCURACY_CHAR 0x2A12
| Time Accuracy characteristic UUID. */.
#define | BLE_UUID_TIME_SOURCE_CHAR 0x2A13
| Time Source characteristic UUID. */.
#define | BLE_UUID_TIME_UPDATE_CONTROL_POINT_CHAR 0x2A16
| Time Update Control Point characteristic UUID. */.
#define | BLE_UUID_TIME_UPDATE_STATE_CHAR 0x2A17
| Time Update State characteristic UUID. */.
#define | BLE_UUID_TIME_WITH_DST_CHAR 0x2A11
| Time With Dst characteristic UUID. */.
#define | BLE_UUID_TIME_ZONE_CHAR 0x2A0E
| Time Zone characteristic UUID. */.
#define | BLE_UUID_TX_POWER_LEVEL_CHAR 0x2A07
| TX Power Level characteristic UUID. */.
#define | BLE_UUID_CSC_FEATURE_CHAR 0x2A5C
| Cycling Speed and Cadence Feature characteristic UUID. */.
#define | BLE_UUID_CSC_MEASUREMENT_CHAR 0x2A5B
| Cycling Speed and Cadence Measurement characteristic UUID. */.
#define | BLE_UUID_RSC_FEATURE_CHAR 0x2A54
| Running Speed and Cadence Feature characteristic UUID. */.
#define | BLE_UUID_SC_CTRLPT_CHAR 0x2A55
| Speed and Cadence Control Point UUID. */.
#define | BLE_UUID_RSC_MEASUREMENT_CHAR 0x2A53
| Running Speed and Cadence Measurement characteristic UUID. */.
#define | BLE_UUID_SENSOR_LOCATION_CHAR 0x2A5D
| Sensor Location characteristic UUID. */.
#define | BLE_UUID_EXTERNAL_REPORT_REF_DESCR 0x2907
| External Report Reference descriptor UUID. */.
#define | BLE_UUID_REPORT_REF_DESCR 0x2908
| Report Reference descriptor UUID. */.
#define | BLE_UUID_LN_FEATURE_CHAR 0x2A6A
| Location Navigation Service, Feature characteristic UUID. */.
#define | BLE_UUID_LN_POSITION_QUALITY_CHAR 0x2A69
| Location Navigation Service, Position quality UUID. */.
#define | BLE_UUID_LN_LOCATION_AND_SPEED_CHAR 0x2A67
| Location Navigation Service, Location and Speed characteristic UUID. */.
#define | BLE_UUID_LN_NAVIGATION_CHAR 0x2A68
| Location Navigation Service, Navigation characteristic UUID. */.
#define | BLE_UUID_LN_CONTROL_POINT_CHAR 0x2A6B
| Location Navigation Service, Control point characteristic UUID. */.
#define | BLE_UUID_BMS_CTRLPT 0x2AA4
| BMS Control Point characteristic UUID. */.
#define | BLE_UUID_BMS_FEATURE 0x2AA5
| BMS Feature characteristic UUID. */.
#define | BLE_UUID_CGM_MEASUREMENT 0x2AA7
| CGM Service, Measurement characteristic UUID*/.
#define | BLE_UUID_CGM_FEATURE 0x2AA8
| CGM Service, Feature characteristic UUID*/.
#define | BLE_UUID_CGM_STATUS 0x2AA9
| CGM Service, Status characteristic UUID*/.
#define | BLE_UUID_CGM_SESSION_START_TIME 0x2AAA
| CGM Service, session start time characteristic UUID*/.
#define | BLE_UUID_CGM_SESSION_RUN_TIME 0x2AAB
| CGM Service, session run time characteristic UUID*/.
#define | BLE_UUID_CGM_SPECIFIC_OPS_CTRLPT 0x2AAC
| CGM Service, specific ops ctrlpt characteristic UUID*/.
#define | BLE_UUID_PLX_SPOT_CHECK_MEAS 0x2A5E
| PLX Service, spot check measurement characteristic UUID*/.
#define | BLE_UUID_PLX_CONTINUOUS_MEAS 0x2A5F
| PLX Service, continuous measurement characteristic UUID*/.
#define | BLE_UUID_PLX_FEATURES 0x2A60
| PLX Service, feature characteristic UUID*/.

## BLE_APPEARANCES Bluetooth Appearance values
Note Retrieved from http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml
#define | BLE_APPEARANCE_UNKNOWN 0
| Unknown. */.
#define | BLE_APPEARANCE_GENERIC_PHONE 64
| Generic Phone. */.
#define | BLE_APPEARANCE_GENERIC_COMPUTER 128
| Generic Computer. */.
#define | BLE_APPEARANCE_GENERIC_WATCH 192
| Generic Watch. */.
#define | BLE_APPEARANCE_WATCH_SPORTS_WATCH 193
| Watch: Sports Watch. */.
#define | BLE_APPEARANCE_GENERIC_CLOCK 256
| Generic Clock. */.
#define | BLE_APPEARANCE_GENERIC_DISPLAY 320
| Generic Display. */.
#define | BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384
| Generic Remote Control. */.
#define | BLE_APPEARANCE_GENERIC_EYE_GLASSES 448
| Generic Eye-glasses. */.
#define | BLE_APPEARANCE_GENERIC_TAG 512
| Generic Tag. */.
#define | BLE_APPEARANCE_GENERIC_KEYRING 576
| Generic Keyring. */.
#define | BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640
| Generic Media Player. */.
#define | BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704
| Generic Barcode Scanner. */.
#define | BLE_APPEARANCE_GENERIC_THERMOMETER 768
| Generic Thermometer. */.
#define | BLE_APPEARANCE_THERMOMETER_EAR 769
| Thermometer: Ear. */.
#define | BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832
| Generic Heart rate Sensor. */.
#define | BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833
| Heart Rate Sensor: Heart Rate Belt. */.
#define | BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896
| Generic Blood Pressure. */.
#define | BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897
| Blood Pressure: Arm. */.
#define | BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898
| Blood Pressure: Wrist. */.
#define | BLE_APPEARANCE_GENERIC_HID 960
| Human Interface Device (HID). */.
#define | BLE_APPEARANCE_HID_KEYBOARD 961
| Keyboard (HID Subtype). */.
#define | BLE_APPEARANCE_HID_MOUSE 962
| Mouse (HID Subtype). */.
#define | BLE_APPEARANCE_HID_JOYSTICK 963
| Joystiq (HID Subtype). */.
#define | BLE_APPEARANCE_HID_GAMEPAD 964
| Gamepad (HID Subtype). */.
#define | BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965
| Digitizer Tablet (HID Subtype). */.
#define | BLE_APPEARANCE_HID_CARD_READER 966
| Card Reader (HID Subtype). */.
#define | BLE_APPEARANCE_HID_DIGITAL_PEN 967
| Digital Pen (HID Subtype). */.
#define | BLE_APPEARANCE_HID_BARCODE 968
| Barcode Scanner (HID Subtype). */.
#define | BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024
| Generic Glucose Meter. */.
#define | BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088
| Generic Running Walking Sensor. */.
#define | BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089
| Running Walking Sensor: In-Shoe. */.
#define | BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090
| Running Walking Sensor: On-Shoe. */.
#define | BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091
| Running Walking Sensor: On-Hip. */.
#define | BLE_APPEARANCE_GENERIC_CYCLING 1152
| Generic Cycling. */.
#define | BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153
| Cycling: Cycling Computer. */.
#define | BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154
| Cycling: Speed Sensor. */.
#define | BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155
| Cycling: Cadence Sensor. */.
#define | BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156
| Cycling: Power Sensor. */.
#define | BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157
| Cycling: Speed and Cadence Sensor. */.
#define | BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136
| Generic Pulse Oximeter. */.
#define | BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137
| Fingertip (Pulse Oximeter subtype). */.
#define | BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138
| Wrist Worn(Pulse Oximeter subtype). */.
#define | BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200
| Generic Weight Scale. */.
#define | BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184
| Generic Outdoor Sports Activity. */.
#define | BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185
| Location Display Device (Outdoor Sports Activity subtype). */.
#define | BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186
| Location and Navigation Display Device (Outdoor Sports Activity subtype). */.
#define | BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187
| Location Pod (Outdoor Sports Activity subtype). */.
#define | BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188
| Location and Navigation Pod (Outdoor Sports Activity subtype). */.

## Detailed Description

### ble_gap.h

ble_gap.h provide BLE generic access profile API.

## Macro Definition Documentation

## ◆ BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE [1/2]

#define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)

LE Limited Discoverable Mode, BR/EDR not supported.

LE Limited Discoverable Mode, BR/EDR not supported. */.

## ◆ BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE [2/2]

#define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)

LE Limited Discoverable Mode, BR/EDR not supported.

LE Limited Discoverable Mode, BR/EDR not supported. */.

## ◆ BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE [1/2]

#define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)

LE General Discoverable Mode, BR/EDR not supported.

LE General Discoverable Mode, BR/EDR not supported. */.

## ◆ BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE [2/2]

#define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)

LE General Discoverable Mode, BR/EDR not supported.

LE General Discoverable Mode, BR/EDR not supported. */.

## Typedef Documentation

## ◆ ai_cfm_gap_general

typedef void(* ai_cfm_gap_general) (bool isuccess, uint8_t err_code)

Callback prototype for GAP operations.

Parameters

  issuccess | Executing is successful or not.
  err_code | Reason for not successful.

## Enumeration Type Documentation

## ◆ ble_addr_type

enum ble_addr_type

BLE ddress Type.

Enumerator
ble_addr_type_public | public address
ble_addr_type_random_static | random static address
ble_addr_type_random_resolvable | random resolvable addresss
ble_addr_type_random_non_resolvable | random non resolvable address

## ◆ ble_ad_type

enum ble_ad_type

BLE AD Type The AD type was mapping to advertising PDU ID.

Enumerator
ble_ad_type_ind | Type for ADV_IND PDU.
ble_ad_type_direct_ind | Type for ADV_DIRECT_IND PDU.
ble_ad_type_scan_ind | Type for ADV_SCAN_IND PDU.
ble_ad_type_nonconn_ind | Type for ADV_NONCONN_IND PDU.
ble_ad_type_direct_ind_low | Type for ADV_DIRECT_IND PDU with low duty.

## ◆ ble_scan_type

enum ble_scan_type

BLE Scan Type Scan type which used in structure ble_gap_scan_params_t.

Enumerator
ble_scan_type_passive | Pasive scan method.
ble_scan_type_active | Active scan method.

## ◆ ble_report_type

enum ble_report_type

BLE Report Type The report type is for the scanned peers' type. It could be AD type of passive scan or active scan(SCAN_RSP). It was used in structure ble_gap_evt_adv_report_t.

Enumerator
ble_report_type_ind | Type for ADV_IND found (passive)
ble_report_type_direct_ind | Type for ADV_DIRECT_IND found (passive)
ble_report_type_scan_ind | Type for ADV_SCAN_IND found (passive)
ble_report_type_nonconn_ind | Type for ADV_NONCONN_IND found (passive)
ble_report_type_scan_rsp | Type for SCAN_RSP found (active)

## ◆ ble_filter_policy_t

enum ble_filter_policy_t

BLE Advertising Filter Policy. It was used in struct ble_gap_adv_params to indicate policy of filtering peers while advertising.

Enumerator
ble_filter_any | Process scan and connection requests from all devices (i.e., the White Listis not in use).
ble_filter_filter_scan | Process connection requests from all devices and only scan requests from devices that are in the White List.
ble_filter_filter_conn | Process scan requests from all devices and only connection requests from devices that are in the White List.
ble_filter_filter_both | Process scan and connection requests only from devices in the White List.

## ◆ ble_scan_policy_t

enum ble_scan_policy_t

BLE Scan Fileter Policy.

Enumerator
ble_scan_policy_0 | Accept all advertisement packets except directed advertising packets not addressed to this device
ble_scan_policy_1 | Accept only advertisement packets from devices where the advertiser' s address is in the White list. advertisement packets from devices where the advertiser' s address is in the White list.
ble_scan_policy_2 | Accept all undirected advertisement packets, and directed advertising packets where the initiator address is a resolvable private address, and directed advertising packets addressed to this device.
ble_scan_policy_3 | Accept all advertisement packets from devices where the advertiser¡¦s address is in the White list, and directed advertising packets where the initiator address is a resolvable private address, and directed advertising packets addressed to this device.

## ◆ ble_gap_event_id

enum ble_gap_event_id

GAP Event IDs. IDs that uniquely identify an event.

Enumerator
BLE_GAP_EVT_CONNECTED | Event for link connected.
BLE_GAP_EVT_DISCONNECTED | Event for link disconnected.
BLE_GAP_EVT_CONNECT_PARM_UPDATE | Event for notifying connection parameter has been updated.
BLE_GAP_EVT_ADV_REPORT | Event for scanning result.
BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST | Event for notifying connection parameter update request from peer.
BLE_GAP_EVT_DISCONNECT_FAIL | Event for ble_gap_disconnect operation fail.
BLE_GAP_EVT_CONNECT_FAIL | Event for ble_gap_connect operation fail.
BLE_GAP_EVT_START_ENCRYPT_FAIL | Event for ble_gap_start_encrypt operation fail.
BLE_GAP_EVT_CONN_PARM_UPDATE_FAIL | Event for ble_gap_conn_param_update operation fail.
BLE_GAP_EVT_READ_REMOTE_VERSION | Event for ble_gap_remote_version result.

## Function Documentation

## ◆ ble_gap_adv_data_set()

BT_STATUS ble_gap_adv_data_set | ( | uint8_t * | p_data,
|  | uint8_t | dlen,
|  | ai_cfm_gap_general | cb
| ) |  |

Set Advertisement Data API.

Parameters

  p_data | Advertisment data array. Maximal length is 31.
  dlen | Advertissment data array length.
  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_scan_data_set()

BT_STATUS ble_gap_scan_data_set | ( | uint8_t * | p_data,
|  | uint8_t | dlen,
|  | ai_cfm_gap_general | cb
| ) |  |

Set Scan Response Data.

Parameters

  p_data | Advertisment data array. Maximal length is 31.
  dlen | Advertissment data array length.
  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_adv_set_parameter()

BT_STATUS ble_gap_adv_set_parameter | ( | ble_gap_adv_params * | parm,
|  | ai_cfm_gap_general | cb
| ) |  |

Set Advertisement Parameter.

Parameters

  parm | Advertisement parameters
  cb | Callback which would be called after opertaion complete. This API is used to set advertisement parameter prior enabling advertisement by invoking ble_gap_adv_start(NULL, ...).

Note
  The paramter setting will be reset after power off or deep sleep.

## ◆ ble_gap_adv_start()

BT_STATUS ble_gap_adv_start | ( | ble_gap_adv_params * | parm,
|  | ai_cfm_gap_general | cb
| ) |  |

Start Advertisement.

Parameters

  parm | Advertisement parameters
  cb | Callback which would be called after opertaion complete. If parm is NULL, the function will use parameter which was set last time.

Note
  The paramter setting will be reset after power off or deep sleep.

## ◆ ble_gap_adv_stop()

BT_STATUS ble_gap_adv_stop | ( | ai_cfm_gap_general | cb | ) |

Stop Advertisement.

Parameters

  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_address_set()

BT_STATUS ble_gap_address_set | ( | ble_addr_t * | addr,
|  | ai_cfm_gap_general | cb
| ) |  |

Set BLE address.

Parameters

  addr | Address
  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_pub_address_get()

BT_STATUS ble_gap_pub_address_get | ( | ble_addr_t * | addr | ) |

Get Public BLE address.

Parameters

  addr | Address

## ◆ ble_gap_random_address_get()

BT_STATUS ble_gap_random_address_get | ( | ble_addr_t * | addr | ) |

Get static random BLE address.

Parameters

  addr | Address

## ◆ ble_gap_disconnect()

BT_STATUS ble_gap_disconnect | ( | uint16_t | handle,
|  | uint8_t | reason
| ) |  |

Disconnect link.

Parameters

  handle | Connection handle
  reason | Reason for disconnect

## ◆ ble_gap_tx_power_set()

BT_STATUS ble_gap_tx_power_set | ( | int8_t | tx_power,
|  | ai_cfm_gap_general | cb
| ) |  |

Set TX power.

Parameters

  tx_power | Power in DB unit.
  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_scan_set_parameter()

BT_STATUS ble_gap_scan_set_parameter | ( | ble_gap_scan_params_t * | p_scan_params,
|  | ai_cfm_gap_general | cb
| ) |  |

Set Scan parameter.

Parameters

  p_scan_params | Scan parameter
  cb | Callback which would be called after opertaion complete. This API is used to set scan parameter prior start scanning by by invoking ble_gap_scan_start(NULL, ...).

Note
  The paramter setting will be reset after power off or deep sleep.

## ◆ ble_gap_scan_start()

BT_STATUS ble_gap_scan_start | ( | ble_gap_scan_params_t const *const | p_scan_params,
|  | ai_cfm_gap_general | cb
| ) |  |

Start scan.

Parameters

  p_scan_params | Scan parameter
  cb | Callback which would be called after opertaion complete. If parm is NULL, the function will use parameter which was set last time.

Note
  The paramter setting will be reset after power off or deep sleep.

## ◆ ble_gap_scan_stop()

BT_STATUS ble_gap_scan_stop | ( | ai_cfm_gap_general | cb | ) |

Stop scan.

Parameters

  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_start_encrypt()

BT_STATUS ble_gap_start_encrypt | ( | uint16_t | conn_handle,
|  | ble_gap_master_id_t const * | p_master_id
| ) |  |

Start link encrypt.

Parameters

  conn_handle | Connection handle
  p_master_id | LTK, EVID and random number.

## ◆ ble_gap_conn_param_update()

BT_STATUS ble_gap_conn_param_update | ( | uint16_t | handle,
|  | ble_gap_conn_params_t const *const | p_conn_params
| ) |  |

Connect update request.

Parameters

  handle | Connection handle
  p_conn_params | Connection update parameters

## ◆ ble_gap_connect()

BT_STATUS ble_gap_connect | ( | ble_gap_create_conn_params_t * | p_conn_params | ) |

Connect request.

Parameters

  p_conn_params | Connection request parameters

## ◆ ble_gap_connect_cancel()

BT_STATUS ble_gap_connect_cancel | ( | ai_cfm_gap_general | cb | ) |

Cancel ongoing connection request.

Parameters

  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_add_whitelist()

BT_STATUS ble_gap_add_whitelist | ( | ble_gap_whitelist_t * | p_wlst,
|  | ai_cfm_gap_general | cb
| ) |  |

Add whiteList.

Parameters

  p_wlst | whitelist table
  cb | Callback which would be called after opertaion complete.

## ◆ ble_gap_remote_version()

BT_STATUS ble_gap_remote_version | ( | uint16_t | handle | ) |

Obtain remote version information.

Parameters

  handle | conneciton handle

## ◆ ble_gap_disable_latency()

void ble_gap_disable_latency | ( | uint8_t | byDisable | ) |

Disable slave latency.

Parameters

  byDisable | is true to disable slave latency

## ◆ ble_gap_get_rssi()

BT_STATUS ble_gap_get_rssi | ( | uint16_t | handle,
|  | ai_cfm_gap_general | cb
| ) |  |

Get connection RSSI.

Parameters

  handle | conneciton handle
  cb | Callback which would be called after opertaion complete.