# Bluetooth Low Energy Stack Abstraction Macro Definition Documentation

## GAPM_CFG_ADDR_PUBLIC

#define GAPM_CFG_ADDR_PUBLIC (0 << GAPM_PRIV_CFG_PRIV_ADDR_POS)

GAPM privacy configuration identity address public.

Location: ble_gap.h:36

## GAPM_CFG_ADDR_PRIVATE

#define GAPM_CFG_ADDR_PRIVATE (1 << GAPM_PRIV_CFG_PRIV_ADDR_POS)

GAPM privacy configuration identity address private.

Location: ble_gap.h:39

## GAPM_CFG_HOST_PRIVACY

#define GAPM_CFG_HOST_PRIVACY (0 << GAPM_PRIV_CFG_PRIV_EN_POS)

GAPM privacy configuration set to host privacy.

Location: ble_gap.h:42

## GAPM_CFG_CONTROLLER_PRIVACY

#define GAPM_CFG_CONTROLLER_PRIVACY (1 << GAPM_PRIV_CFG_PRIV_EN_POS)

GAPM privacy configuration set to controller privacy.

Location: ble_gap.h:45

## GAPM_DEFAULT_ROLE

#define GAPM_DEFAULT_ROLE GAP_ROLE_ALL

GAPM default device configuration (used in GAPM_SET_DEV_CONFIG_CMD)

Default device role is both peripheral and central

Location: ble_gap.h:52

## GAPM_DEFAULT_RENEW_DUR

#define GAPM_DEFAULT_RENEW_DUR 60

Default duration for regenerating device address when privacy is enabled (in seconds)

Location: ble_gap.h:55

## GAPM_DEFAULT_GAP_START_HDL

#define GAPM_DEFAULT_GAP_START_HDL 0

Default start handle for GAP service (dynamically allocated)

Location: ble_gap.h:57

## GAPM_DEFAULT_GATT_START_HDL

#define GAPM_DEFAULT_GATT_START_HDL 0

Default start handle for GATT service (dynamically allocated)

Location: ble_gap.h:59

## GAPM_DEFAULT_ATT_CFG

#define GAPM_DEFAULT_ATT_CFG 0

Default attribute database configuration.

Location: ble_gap.h:60

## GAPM_DEFAULT_TX_OCT_MAX

#define GAPM_DEFAULT_TX_OCT_MAX 0xfb

Default value for the controller's maximum transmitted number of payload octets to be used.

Location: ble_gap.h:63

## GAPM_DEFAULT_TX_TIME_MAX

#define GAPM_DEFAULT_TX_TIME_MAX (14 * 8 \ + \ GAPM_DEFAULT_TX_OCT_MAX \ * 8)

Suggested value for the controller's maximum packet transmission time to be used.

Location: ble_gap.h:66

## GAPM_DEFAULT_MTU_MAX

#define GAPM_DEFAULT_MTU_MAX 0x200

Default maximum MTU acceptable for device (L2CAP)

Location: ble_gap.h:71

## GAPM_DEFAULT_MPS_MAX

#define GAPM_DEFAULT_MPS_MAX 0x200

Default maximum MPS (L2CAP)

Location: ble_gap.h:72

## GAPM_DEFAULT_MAX_NB_LECB

#define GAPM_DEFAULT_MAX_NB_LECB 0

Default maximum number of LE Credit based connection that can be established (L2CAP)

Location: ble_gap.h:75

## GAPM_DEFAULT_AUDIO_CFG

#define GAPM_DEFAULT_AUDIO_CFG 0

Default LE Audio Mode Configuration.

Location: ble_gap.h:76

## GAP_ROLE_MASTER

#define GAP_ROLE_MASTER 0

GAP master.

Location: ble_gap.h:77

## GAP_ROLE_SLAVE

#define GAP_ROLE_SLAVE 1

GAP slave.

Location: ble_gap.h:78

## GAPM_DEFAULT_ADV_DATA

#define GAPM_DEFAULT_ADV_DATA { 7, GAP_AD_TYPE_COMPLETE_NAME, \ 'O', 'N', ' ', 'B', 'L', 'E', \ 3, GAP_AD_TYPE_MANU_SPECIFIC_DATA, \ 0x62, 0x3 }

Default advertisement data (length, data)

Location: ble_gap.h:80

## GAPM_DEFAULT_ADV_DATA_LEN

#define GAPM_DEFAULT_ADV_DATA_LEN 12

Default length of advertisement data.

Location: ble_gap.h:84

## GAPM_DEFAULT_SCANRSP_DATA

#define GAPM_DEFAULT_SCANRSP_DATA GAPM_DEFAULT_ADV_DATA

Default scan response data.

Location: ble_gap.h:85

## GAPM_DEFAULT_SCANRSP_DATA_LEN

#define GAPM_DEFAULT_SCANRSP_DATA_LEN GAPM_DEFAULT_ADV_DATA_LEN

Default length of scan response data.

Location: ble_gap.h:86

## GAPM_DEFAULT_SCAN_INTERVAL

#define GAPM_DEFAULT_SCAN_INTERVAL 100

GAPM default StartConnectionCmd configuration (GAPM_START_CONNECTION_CMD)

Default scan interval 62.5ms

Location: ble_gap.h:89

## GAPM_DEFAULT_SCAN_WINDOW

#define GAPM_DEFAULT_SCAN_WINDOW 50

Scan window to 50% of the interval.

Location: ble_gap.h:90

## GAPM_DEFAULT_CON_INTV_MIN

#define GAPM_DEFAULT_CON_INTV_MIN 20

Default connection interval and slave latency.

25 ms (units of 1.25ms)

Location: ble_gap.h:93

## GAPM_DEFAULT_CON_INTV_MAX

#define GAPM_DEFAULT_CON_INTV_MAX 20

25 ms (units of 1.25ms)

Location: ble_gap.h:94

## GAPM_DEFAULT_CON_LATENCY

#define GAPM_DEFAULT_CON_LATENCY 0

Slave latency: number of events that can be missed while maintaining a connection.

Location: ble_gap.h:96

## GAPM_DEFAULT_SUPERV_TO

#define GAPM_DEFAULT_SUPERV_TO 300

Default supervisory timeout.

3 seconds

Location: ble_gap.h:99

## GAPM_DEFAULT_CE_LEN_MIN

#define GAPM_DEFAULT_CE_LEN_MIN 2 * GAPM_DEFAULT_CON_INTV_MIN

Recommended minimum duration of connection events 40 ms.

Location: ble_gap.h:101

## GAPM_DEFAULT_CE_LEN_MAX

#define GAPM_DEFAULT_CE_LEN_MAX 2 * GAPM_DEFAULT_CON_INTV_MAX

Recommended maximum duration of connection events 40 ms.

Location: ble_gap.h:103

## GAPM_DEFAULT_ADV_INTV_MIN

#define GAPM_DEFAULT_ADV_INTV_MIN 64

Advertising minimum and maximum interval.

40ms (64*0.625ms)

Location: ble_gap.h:106

## GAPM_DEFAULT_ADV_INTV_MAX

#define GAPM_DEFAULT_ADV_INTV_MAX 64

40ms (64*0.625ms)

Location: ble_gap.h:107

## GAPM_DEFAULT_ADV_CHMAP

#define GAPM_DEFAULT_ADV_CHMAP 0x07

Advertising channel map - 37, 38, 39.

Location: ble_gap.h:110

## GATTC_DEFAULT_START_HDL

#define GATTC_DEFAULT_START_HDL 0x0001

Default GATTC handles.

GATTC default start handle

Location: ble_gatt.h:35

## GATTC_DEFAULT_END_HDL

#define GATTC_DEFAULT_END_HDL 0xFFFF

GATTC default end handle.

Location: ble_gatt.h:36

## CS_SERVICE_UUID_16

#define CS_SERVICE_UUID_16 { srvidx, { uuid, PERM(SVC_UUID_LEN, UUID_16), 0, 0 }, true, 0, NULL, NULL }

Macros to declare a (custom) service with 16, 32 and 128 bit UUID srvidx Service index uuid Service UUID.

Custom service with 16 bit UUID

Location: ble_gatt.h:42

## CS_SERVICE_UUID_32

#define CS_SERVICE_UUID_32 { srvidx, { uuid, PERM(SVC_UUID_LEN, UUID_32), 0, 0 }, true, 0, NULL, NULL }

Custom service with 32 bit UUID.

Location: ble_gatt.h:45

## CS_SERVICE_UUID_128

#define CS_SERVICE_UUID_128 { srvidx, { uuid, PERM(SVC_UUID_LEN, UUID_128), 0, 0 }, true, 0, NULL, NULL }

Custom service with 128 bit UUID.

Location: ble_gatt.h:48

## CS_ATT_SERVICE_128

#define CS_ATT_SERVICE_128 { 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00 }

Standard declaration/description UUIDs in 16-byte format.

Custom service attribute

Location: ble_gatt.h:52

## CS_ATT_CHARACTERISTIC_128

#define CS_ATT_CHARACTERISTIC_128 { 0x03, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00 }

Custom service characteristic.

Location: ble_gatt.h:55

## CS_ATT_CLIENT_CHAR_CFG_128

#define CS_ATT_CLIENT_CHAR_CFG_128 { 0x02, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00 }

Custom service attribute for client characteristic configuration.

Location: ble_gatt.h:59

## CS_ATT_CHAR_USER_DESC_128

#define CS_ATT_CHAR_USER_DESC_128 { 0x01, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00 }

Custom service attribute characteristic user description.

Location: ble_gatt.h:63

## CS_CHAR_UUID_16

#define CS_CHAR_UUID_16 { attidx_char, { CS_ATT_CHARACTERISTIC_128, PERM(RD, ENABLE), 0, 0 }, false, 0, NULL, NULL }, \ { attidx_val, { uuid, perm, length, PERM(RI, ENABLE) | PERM(UUID_LEN, UUID_16) }, false, length, data, callback }

Macros to define characteristics with 16, 32 and 128 bit UUID attidx_char: Characteristic attribute index attidx_val: Value attribute index uuid UUID perm Permissions (see gattm_att_desc) length Maximum length value (in bytes) data Pointer to the data structure in the application callback Function to transfer the data between the application and the GATTM.

Custom service characteristic with 16 bit UUID

Location: ble_gatt.h:83

## CS_CHAR_UUID_32

#define CS_CHAR_UUID_32 { attidx_char, { CS_ATT_CHARACTERISTIC_128, PERM(RD, ENABLE), 0, 0 }, false, 0, NULL, NULL }, \ { attidx_val, { uuid, perm, length, PERM(RI, ENABLE) | PERM(UUID_LEN, UUID_32) }, false, length, data, callback }

Custom service characteristic with 32 bit UUID.

Location: ble_gatt.h:95

## CS_CHAR_UUID_128

#define CS_CHAR_UUID_128 { attidx_char, { CS_ATT_CHARACTERISTIC_128, PERM(RD, ENABLE), 0, 0 }, false, 0, NULL, NULL }, \ { attidx_val, { uuid, perm, length, PERM(RI, ENABLE) | PERM(UUID_LEN, UUID_128) }, false, length, data, callback }

Custom service characteristic with 128 bit UUID.

Location: ble_gatt.h:106

## CS_CHAR_CCC

#define CS_CHAR_CCC { attidx, { CS_ATT_CLIENT_CHAR_CFG_128, PERM(RD, ENABLE) | PERM(WRITE_REQ, ENABLE), 0, PERM(RI, ENABLE) }, false, 2, \ data, \ callback }

Macro to add to the characteristic a CCC attidx CCC attribute index data Pointer to the 2-byte CCC data value in the application callback Function to transfer the CCC data between the application and the GATTM.

Location: ble_gatt.h:114

## CS_CHAR_USER_DESC

#define CS_CHAR_USER_DESC { attidx, { CS_ATT_CHAR_USER_DESC_128, PERM(RD, ENABLE), length, PERM(RI, ENABLE) }, false, length, data, callback }

Macro to add to the characteristic a user description attidx Description attribute index length Description length (in bytes) data Pointer to the description string (constant) callback Function to transfer the description string to the GATTM.

Location: ble_gatt.h:124

## MIN

#define MIN (((a) < (b)) ? (a) : (b))

Macro to Find Minimum.

Location: ble_gatt.h:128

## HCI_VS_RF_CW_ENABLE_CMD_CODE

#define HCI_VS_RF_CW_ENABLE_CMD_CODE 0x01

Vendor specific to enable CW (RX or TX)

Location: ble_protocol_support.h:33

## HCI_VS_RF_CW_DISABLE_CMD_CODE

#define HCI_VS_RF_CW_DISABLE_CMD_CODE 0x02

Vendor specific to enable CW (RX or TX)

Location: ble_protocol_support.h:36

## HCI_VS_RF_OUTPUT_PWR_CMD_CODE

#define HCI_VS_RF_OUTPUT_PWR_CMD_CODE 0x03

Vendor specific to set desired output power.

Location: ble_protocol_support.h:39