| BlueNRG-1 ACI APIs and events callbacks

- Main Page
- Modules
- Classes
- Files

Modules | Macros | Typedefs
GAP

API for GAP layer. More...

## Modules

| AD Types
| AD Types.

## Macros

#define | MAX_ADV_DATA_LEN (31)
#define | DEVICE_NAME_LEN (7)
#define | BD_ADDR_SIZE (6)

## Typedefs

typedef uint8_t | tBDAddr[6]

## GAP UUIDs

#define | GAP_SERVICE_UUID (0x1800)
#define | DEVICE_NAME_UUID (0x2A00)
#define | APPEARANCE_UUID (0x2A01)
#define | PERIPHERAL_PRIVACY_FLAG_UUID (0x2A02)
#define | RECONNECTION_ADDR_UUID (0x2A03)
#define | PERIPHERAL_PREFERRED_CONN_PARAMS_UUID (0x2A04)

## Characteristic value lengths

#define | DEVICE_NAME_CHARACTERISTIC_LEN (8)
#define | APPEARANCE_CHARACTERISTIC_LEN (2)
#define | PERIPHERAL_PRIVACY_CHARACTERISTIC_LEN (1)
#define | RECONNECTION_ADDR_CHARACTERISTIC_LEN (6)
#define | PERIPHERAL_PREF_CONN_PARAMS_CHARACTERISTIC_LEN (8)

## Privacy flag values

#define | PRIVACY_ENABLED (0x01)
#define | PRIVACY_DISABLED (0x00)

## Intervals

Intervals in terms of 625 micro sec
#define | DIR_CONN_ADV_INT_MIN (0x190)/*250ms*/
#define | DIR_CONN_ADV_INT_MAX (0x320)/*500ms*/
#define | UNDIR_CONN_ADV_INT_MIN (0x800)/*1.28s*/
#define | UNDIR_CONN_ADV_INT_MAX (0x1000)/*2.56s*/
#define | LIM_DISC_ADV_INT_MIN (0x190)/*250ms*/
#define | LIM_DISC_ADV_INT_MAX (0x320)/*500ms*/
#define | GEN_DISC_ADV_INT_MIN (0x800)/*1.28s*/
#define | GEN_DISC_ADV_INT_MAX (0x1000)/*2.56s*/

## Timeout values

#define | LIM_DISC_MODE_TIMEOUT (180000)/* 180 seconds. according to the errata published */
#define | PRIVATE_ADDR_INT_TIMEOUT (900000)/* 15 minutes */

## GAP Roles

#define | GAP_PERIPHERAL_ROLE (0x01)
#define | GAP_BROADCASTER_ROLE (0x02)
#define | GAP_CENTRAL_ROLE (0x04)
#define | GAP_OBSERVER_ROLE (0x08)

## GAP procedure codes

Procedure codes for EVT_BLUE_GAP_PROCEDURE_COMPLETE event and aci_gap_terminate_gap_procedure() command.
#define | GAP_LIMITED_DISCOVERY_PROC (0x01)
#define | GAP_GENERAL_DISCOVERY_PROC (0x02)
#define | GAP_NAME_DISCOVERY_PROC (0x04)
#define | GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC (0x08)
#define | GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC (0x10)
#define | GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC (0x20)
#define | GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC (0x40)
#define | GAP_OBSERVATION_PROC (0x80)

## Advertising filter

Advertising policy for filtering (white list related)
#define | NO_WHITE_LIST_USE (0x00)
#define | WHITE_LIST_FOR_ONLY_SCAN (0x01)
#define | WHITE_LIST_FOR_ONLY_CONN (0x02)
#define | WHITE_LIST_FOR_ALL (0x03)

## Bluetooth address types

Bluetooth address types
#define | PUBLIC_ADDR (0)
#define | RANDOM_ADDR (1)
#define | STATIC_RANDOM_ADDR (1)
#define | RESOLVABLE_PRIVATE_ADDR (2)
#define | NON_RESOLVABLE_PRIVATE_ADDR (3)

## Directed advertising types

Type of advertising during directed advertising
#define | HIGH_DUTY_CYCLE_DIRECTED_ADV (1)
#define | LOW_DUTY_CYCLE_DIRECTED_ADV (4)

## Advertising type

#define | ADV_IND (0x00)
#define | ADV_DIRECT_IND (0x01)
#define | ADV_SCAN_IND (0x02)
#define | ADV_NONCONN_IND (0x03)
#define | SCAN_RSP (0x04)

## Advertising ranges

#define | ADV_INTERVAL_LOWEST_CONN (0X0020)
#define | ADV_INTERVAL_HIGHEST (0X4000)
#define | ADV_INTERVAL_LOWEST_NONCONN (0X00a0)

## Advertising channels

#define | ADV_CH_37 0x01
#define | ADV_CH_38 0x02
#define | ADV_CH_39 0x04

## Scan_types Scan types

#define | PASSIVE_SCAN 0
#define | ACTIVE_SCAN 1

## IO capabilities

#define | IO_CAP_DISPLAY_ONLY (0x00)
#define | IO_CAP_DISPLAY_YES_NO (0x01)
#define | IO_CAP_KEYBOARD_ONLY (0x02)
#define | IO_CAP_NO_INPUT_NO_OUTPUT (0x03)
#define | IO_CAP_KEYBOARD_DISPLAY (0x04)

## Authentication requirements

#define | BONDING (0x01)
#define | NO_BONDING (0x00)

## MITM protection requirements

#define | MITM_PROTECTION_NOT_REQUIRED (0x00)
#define | MITM_PROTECTION_REQUIRED (0x01)

## Out-Of-Band data

#define | OOB_AUTH_DATA_ABSENT (0x00)
#define | OOB_AUTH_DATA_PRESENT (0x01)

## Authorization requirements

#define | AUTHORIZATION_NOT_REQUIRED (0x00)
#define | AUTHORIZATION_REQUIRED (0x01)

## Connection authorization

#define | CONNECTION_AUTHORIZED (0x01)
#define | CONNECTION_REJECTED (0x02)

## Use fixed pin

#define | USE_FIXED_PIN_FOR_PAIRING (0x0)
#define | DONOT_USE_FIXED_PIN_FOR_PAIRING (0x01)

## Link security status

#define | SM_LINK_AUTHENTICATED (0x01)
#define | SM_LINK_AUTHORIZED (0x02)
#define | SM_LINK_ENCRYPTED (0x04)

## SMP pairing failed reason codes

#define | PASSKEY_ENTRY_FAILED (0x01)
#define | OOB_NOT_AVAILABLE (0x02)
#define | AUTH_REQ_CANNOT_BE_MET (0x03)
#define | CONFIRM_VALUE_FAILED (0x04)
#define | PAIRING_NOT_SUPPORTED (0x05)
#define | INSUFF_ENCRYPTION_KEY_SIZE (0x06)
#define | CMD_NOT_SUPPORTED (0x07)
#define | UNSPECIFIED_REASON (0x08)
#define | VERY_EARLY_NEXT_ATTEMPT (0x09)
#define | SM_INVALID_PARAMS (0x0A)

## Pairing failed error codes

Error codes in EVT_BLUE_GAP_PAIRING_CMPLT event
#define | SM_PAIRING_SUCCESS (0x00)
#define | SM_PAIRING_TIMEOUT (0x01)
#define | SM_PAIRING_FAILED (0x02)

## Detailed Description

API for GAP layer.

## Macro Definition Documentation

#define ACTIVE_SCAN 1

Definition at line 154 of file link_layer.h.

#define ADV_CH_37 0x01

Definition at line 142 of file link_layer.h.

#define ADV_CH_38 0x02

Definition at line 143 of file link_layer.h.

#define ADV_CH_39 0x04

Definition at line 144 of file link_layer.h.

#define ADV_DIRECT_IND (0x01)

directed non scannable

Definition at line 90 of file link_layer.h.

#define ADV_IND (0x00)

undirected scannable and connectable

Definition at line 85 of file link_layer.h.

#define ADV_INTERVAL_HIGHEST (0X4000)

highest allowed interval value (10.24s)..multiple of 625us.

Definition at line 126 of file link_layer.h.

#define ADV_INTERVAL_LOWEST_CONN (0X0020)

lowest allowed interval value for connectable types(20ms)..multiple of 625us

Definition at line 121 of file link_layer.h.

#define ADV_INTERVAL_LOWEST_NONCONN (0X00a0)

lowest allowed interval value for non connectable types (100ms)..multiple of 625us.

Definition at line 132 of file link_layer.h.

#define ADV_NONCONN_IND (0x03)

non-connectable and no scan response (used for passive scan)

Definition at line 100 of file link_layer.h.

#define ADV_SCAN_IND (0x02)

scannable non connectable

Definition at line 95 of file link_layer.h.

#define APPEARANCE_CHARACTERISTIC_LEN (2)

Definition at line 51 of file bluenrg1_gap.h.

#define APPEARANCE_UUID (0x2A01)

Definition at line 38 of file bluenrg1_gap.h.

#define AUTH_REQ_CANNOT_BE_MET (0x03)

Definition at line 134 of file sm.h.

#define AUTHORIZATION_NOT_REQUIRED (0x00)

Definition at line 87 of file sm.h.

#define AUTHORIZATION_REQUIRED (0x01)

Definition at line 88 of file sm.h.

#define BD_ADDR_SIZE (6)

Definition at line 150 of file bluenrg1_gap.h.

#define BONDING (0x01)

Definition at line 54 of file sm.h.

#define CMD_NOT_SUPPORTED (0x07)

Definition at line 138 of file sm.h.

#define CONFIRM_VALUE_FAILED (0x04)

Definition at line 135 of file sm.h.

#define CONNECTION_AUTHORIZED (0x01)

Definition at line 98 of file sm.h.

#define CONNECTION_REJECTED (0x02)

Definition at line 99 of file sm.h.

#define DEVICE_NAME_CHARACTERISTIC_LEN (8)

Definition at line 50 of file bluenrg1_gap.h.

#define DEVICE_NAME_LEN (7)

Definition at line 149 of file bluenrg1_gap.h.

#define DEVICE_NAME_UUID (0x2A00)

Definition at line 37 of file bluenrg1_gap.h.

#define DIR_CONN_ADV_INT_MAX (0x320)/*500ms*/

Definition at line 168 of file bluenrg1_gap.h.

#define DIR_CONN_ADV_INT_MIN (0x190)/*250ms*/

Definition at line 167 of file bluenrg1_gap.h.

#define DONOT_USE_FIXED_PIN_FOR_PAIRING (0x01)

Definition at line 110 of file sm.h.

#define GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC (0x08)

Definition at line 213 of file bluenrg1_gap.h.

#define GAP_BROADCASTER_ROLE (0x02)

Definition at line 195 of file bluenrg1_gap.h.

#define GAP_CENTRAL_ROLE (0x04)

Definition at line 196 of file bluenrg1_gap.h.

#define GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC (0x40)

Definition at line 216 of file bluenrg1_gap.h.

#define GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC (0x10)

Definition at line 214 of file bluenrg1_gap.h.

#define GAP_GENERAL_DISCOVERY_PROC (0x02)

Definition at line 211 of file bluenrg1_gap.h.

#define GAP_LIMITED_DISCOVERY_PROC (0x01)

Definition at line 210 of file bluenrg1_gap.h.

#define GAP_NAME_DISCOVERY_PROC (0x04)

Definition at line 212 of file bluenrg1_gap.h.

#define GAP_OBSERVATION_PROC (0x80)

Definition at line 217 of file bluenrg1_gap.h.

#define GAP_OBSERVER_ROLE (0x08)

Definition at line 197 of file bluenrg1_gap.h.

#define GAP_PERIPHERAL_ROLE (0x01)

Definition at line 194 of file bluenrg1_gap.h.

#define GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC (0x20)

Definition at line 215 of file bluenrg1_gap.h.

#define GAP_SERVICE_UUID (0x1800)

Definition at line 36 of file bluenrg1_gap.h.

#define GEN_DISC_ADV_INT_MAX (0x1000)/*2.56s*/

Definition at line 174 of file bluenrg1_gap.h.

#define GEN_DISC_ADV_INT_MIN (0x800)/*1.28s*/

Definition at line 173 of file bluenrg1_gap.h.

#define HIGH_DUTY_CYCLE_DIRECTED_ADV (1)

Definition at line 71 of file link_layer.h.

#define INSUFF_ENCRYPTION_KEY_SIZE (0x06)

Definition at line 137 of file sm.h.

#define IO_CAP_DISPLAY_ONLY (0x00)

Definition at line 40 of file sm.h.

#define IO_CAP_DISPLAY_YES_NO (0x01)

Definition at line 41 of file sm.h.

#define IO_CAP_KEYBOARD_DISPLAY (0x04)

Definition at line 44 of file sm.h.

#define IO_CAP_KEYBOARD_ONLY (0x02)

Definition at line 42 of file sm.h.

#define IO_CAP_NO_INPUT_NO_OUTPUT (0x03)

Definition at line 43 of file sm.h.

#define LIM_DISC_ADV_INT_MAX (0x320)/*500ms*/

Definition at line 172 of file bluenrg1_gap.h.

#define LIM_DISC_ADV_INT_MIN (0x190)/*250ms*/

Definition at line 171 of file bluenrg1_gap.h.

#define LIM_DISC_MODE_TIMEOUT (180000)/* 180 seconds. according to the errata published */

Definition at line 183 of file bluenrg1_gap.h.

#define LOW_DUTY_CYCLE_DIRECTED_ADV (4)

Definition at line 72 of file link_layer.h.

#define MAX_ADV_DATA_LEN (31)

Definition at line 147 of file bluenrg1_gap.h.

#define MITM_PROTECTION_NOT_REQUIRED (0x00)

Definition at line 65 of file sm.h.

#define MITM_PROTECTION_REQUIRED (0x01)

Definition at line 66 of file sm.h.

#define NO_BONDING (0x00)

Definition at line 55 of file sm.h.

#define NO_WHITE_LIST_USE (0x00)

Process scan and connection requests from all devices (i.e., the White List is not in use)

Definition at line 37 of file link_layer.h.

#define NON_RESOLVABLE_PRIVATE_ADDR (3)

Definition at line 61 of file link_layer.h.

#define OOB_AUTH_DATA_ABSENT (0x00)

Definition at line 76 of file sm.h.

#define OOB_AUTH_DATA_PRESENT (0x01)

Definition at line 77 of file sm.h.

#define OOB_NOT_AVAILABLE (0x02)

Definition at line 133 of file sm.h.

#define PAIRING_NOT_SUPPORTED (0x05)

Definition at line 136 of file sm.h.

#define PASSIVE_SCAN 0

Definition at line 153 of file link_layer.h.

#define PASSKEY_ENTRY_FAILED (0x01)

Definition at line 132 of file sm.h.

#define PERIPHERAL_PREF_CONN_PARAMS_CHARACTERISTIC_LEN (8)

Definition at line 54 of file bluenrg1_gap.h.

#define PERIPHERAL_PREFERRED_CONN_PARAMS_UUID (0x2A04)

Definition at line 41 of file bluenrg1_gap.h.

#define PERIPHERAL_PRIVACY_CHARACTERISTIC_LEN (1)

Definition at line 52 of file bluenrg1_gap.h.

#define PERIPHERAL_PRIVACY_FLAG_UUID (0x2A02)

Definition at line 39 of file bluenrg1_gap.h.

#define PRIVACY_DISABLED (0x00)

Definition at line 157 of file bluenrg1_gap.h.

#define PRIVACY_ENABLED (0x01)

Definition at line 156 of file bluenrg1_gap.h.

#define PRIVATE_ADDR_INT_TIMEOUT (900000)/* 15 minutes */

Definition at line 184 of file bluenrg1_gap.h.

#define PUBLIC_ADDR (0)

Definition at line 57 of file link_layer.h.

#define RANDOM_ADDR (1)

Definition at line 58 of file link_layer.h.

#define RECONNECTION_ADDR_CHARACTERISTIC_LEN (6)

Definition at line 53 of file bluenrg1_gap.h.

#define RECONNECTION_ADDR_UUID (0x2A03)

Definition at line 40 of file bluenrg1_gap.h.

#define RESOLVABLE_PRIVATE_ADDR (2)

Definition at line 60 of file link_layer.h.

#define SCAN_RSP (0x04)

scan response

Definition at line 105 of file link_layer.h.

#define SM_INVALID_PARAMS (0x0A)

Definition at line 141 of file sm.h.

#define SM_LINK_AUTHENTICATED (0x01)

Definition at line 120 of file sm.h.

#define SM_LINK_AUTHORIZED (0x02)

Definition at line 121 of file sm.h.

#define SM_LINK_ENCRYPTED (0x04)

Definition at line 122 of file sm.h.

#define SM_PAIRING_FAILED (0x02)

Definition at line 154 of file sm.h.

#define SM_PAIRING_SUCCESS (0x00)

Definition at line 152 of file sm.h.

#define SM_PAIRING_TIMEOUT (0x01)

Definition at line 153 of file sm.h.

#define STATIC_RANDOM_ADDR (1)

Definition at line 59 of file link_layer.h.

#define UNDIR_CONN_ADV_INT_MAX (0x1000)/*2.56s*/

Definition at line 170 of file bluenrg1_gap.h.

#define UNDIR_CONN_ADV_INT_MIN (0x800)/*1.28s*/

Definition at line 169 of file bluenrg1_gap.h.

#define UNSPECIFIED_REASON (0x08)

Definition at line 139 of file sm.h.

#define USE_FIXED_PIN_FOR_PAIRING (0x0)

Definition at line 109 of file sm.h.

#define VERY_EARLY_NEXT_ATTEMPT (0x09)

Definition at line 140 of file sm.h.

#define WHITE_LIST_FOR_ALL (0x03)

Process scan and connection requests only from devices in the White List.

Definition at line 40 of file link_layer.h.

#define WHITE_LIST_FOR_ONLY_CONN (0x02)

Process scan requests from all devices and only connection requests from devices that are in the White List

Definition at line 39 of file link_layer.h.

#define WHITE_LIST_FOR_ONLY_SCAN (0x01)

Process connection requests from all devices and only scan requests from devices that are in the White List

Definition at line 38 of file link_layer.h.

## Typedef Documentation

typedef uint8_t tBDAddr[6]

Bluetooth 48 bit address (in little-endian order).

Definition at line 49 of file link_layer.h.