2019-10-16 18:00:16 +08:00
|
|
|
/** @file
|
|
|
|
* @brief Bluetooth Generic Access Profile defines and Assigned Numbers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_
|
|
|
|
#define ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-04-29 01:32:02 +08:00
|
|
|
/**
|
|
|
|
* @brief Bluetooth Generic Access Profile defines and Assigned Numbers.
|
|
|
|
* @defgroup bt_gap_defines Defines and Assigned Numbers
|
|
|
|
* @ingroup bluetooth
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2020-03-17 17:32:20 +08:00
|
|
|
/** Company Identifiers (see Bluetooth Assigned Numbers) */
|
2019-10-16 18:00:16 +08:00
|
|
|
#define BT_COMP_ID_LF 0x05f1 /* The Linux Foundation */
|
|
|
|
|
2020-03-17 17:32:20 +08:00
|
|
|
/** EIR/AD data type definitions */
|
2019-10-16 18:00:16 +08:00
|
|
|
#define BT_DATA_FLAGS 0x01 /* AD flags */
|
|
|
|
#define BT_DATA_UUID16_SOME 0x02 /* 16-bit UUID, more available */
|
|
|
|
#define BT_DATA_UUID16_ALL 0x03 /* 16-bit UUID, all listed */
|
|
|
|
#define BT_DATA_UUID32_SOME 0x04 /* 32-bit UUID, more available */
|
|
|
|
#define BT_DATA_UUID32_ALL 0x05 /* 32-bit UUID, all listed */
|
|
|
|
#define BT_DATA_UUID128_SOME 0x06 /* 128-bit UUID, more available */
|
|
|
|
#define BT_DATA_UUID128_ALL 0x07 /* 128-bit UUID, all listed */
|
|
|
|
#define BT_DATA_NAME_SHORTENED 0x08 /* Shortened name */
|
|
|
|
#define BT_DATA_NAME_COMPLETE 0x09 /* Complete name */
|
|
|
|
#define BT_DATA_TX_POWER 0x0a /* Tx Power */
|
|
|
|
#define BT_DATA_SM_TK_VALUE 0x10 /* Security Manager TK Value */
|
|
|
|
#define BT_DATA_SM_OOB_FLAGS 0x11 /* Security Manager OOB Flags */
|
|
|
|
#define BT_DATA_SOLICIT16 0x14 /* Solicit UUIDs, 16-bit */
|
|
|
|
#define BT_DATA_SOLICIT128 0x15 /* Solicit UUIDs, 128-bit */
|
|
|
|
#define BT_DATA_SVC_DATA16 0x16 /* Service data, 16-bit UUID */
|
|
|
|
#define BT_DATA_GAP_APPEARANCE 0x19 /* GAP appearance */
|
|
|
|
#define BT_DATA_LE_BT_DEVICE_ADDRESS 0x1b /* LE Bluetooth Device Address */
|
|
|
|
#define BT_DATA_LE_ROLE 0x1c /* LE Role */
|
|
|
|
#define BT_DATA_SOLICIT32 0x1f /* Solicit UUIDs, 32-bit */
|
|
|
|
#define BT_DATA_SVC_DATA32 0x20 /* Service data, 32-bit UUID */
|
|
|
|
#define BT_DATA_SVC_DATA128 0x21 /* Service data, 128-bit UUID */
|
|
|
|
#define BT_DATA_LE_SC_CONFIRM_VALUE 0x22 /* LE SC Confirmation Value */
|
|
|
|
#define BT_DATA_LE_SC_RANDOM_VALUE 0x23 /* LE SC Random Value */
|
|
|
|
#define BT_DATA_URI 0x24 /* URI */
|
|
|
|
#define BT_DATA_MESH_PROV 0x29 /* Mesh Provisioning PDU */
|
|
|
|
#define BT_DATA_MESH_MESSAGE 0x2a /* Mesh Networking PDU */
|
|
|
|
#define BT_DATA_MESH_BEACON 0x2b /* Mesh Beacon */
|
2021-01-06 12:40:22 +08:00
|
|
|
#define BT_DATA_BIG_INFO 0x2c /* BIGInfo */
|
|
|
|
#define BT_DATA_BROADCAST_CODE 0x2d /* Broadcast Code */
|
2019-10-16 18:00:16 +08:00
|
|
|
|
|
|
|
#define BT_DATA_MANUFACTURER_DATA 0xff /* Manufacturer Specific Data */
|
|
|
|
|
|
|
|
#define BT_LE_AD_LIMITED 0x01 /* Limited Discoverable */
|
|
|
|
#define BT_LE_AD_GENERAL 0x02 /* General Discoverable */
|
|
|
|
#define BT_LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
|
|
|
|
|
|
|
|
/* Defined GAP timers */
|
|
|
|
#define BT_GAP_SCAN_FAST_INTERVAL 0x0060 /* 60 ms */
|
|
|
|
#define BT_GAP_SCAN_FAST_WINDOW 0x0030 /* 30 ms */
|
|
|
|
#define BT_GAP_SCAN_SLOW_INTERVAL_1 0x0800 /* 1.28 s */
|
|
|
|
#define BT_GAP_SCAN_SLOW_WINDOW_1 0x0012 /* 11.25 ms */
|
|
|
|
#define BT_GAP_SCAN_SLOW_INTERVAL_2 0x1000 /* 2.56 s */
|
|
|
|
#define BT_GAP_SCAN_SLOW_WINDOW_2 0x0012 /* 11.25 ms */
|
|
|
|
#define BT_GAP_ADV_FAST_INT_MIN_1 0x0030 /* 30 ms */
|
|
|
|
#define BT_GAP_ADV_FAST_INT_MAX_1 0x0060 /* 60 ms */
|
|
|
|
#define BT_GAP_ADV_FAST_INT_MIN_2 0x00a0 /* 100 ms */
|
|
|
|
#define BT_GAP_ADV_FAST_INT_MAX_2 0x00f0 /* 150 ms */
|
|
|
|
#define BT_GAP_ADV_SLOW_INT_MIN 0x0640 /* 1 s */
|
|
|
|
#define BT_GAP_ADV_SLOW_INT_MAX 0x0780 /* 1.2 s */
|
|
|
|
#define BT_GAP_INIT_CONN_INT_MIN 0x0018 /* 30 ms */
|
|
|
|
#define BT_GAP_INIT_CONN_INT_MAX 0x0028 /* 50 ms */
|
|
|
|
|
2020-02-02 01:06:49 +08:00
|
|
|
/** LE PHY types */
|
|
|
|
enum {
|
2020-05-12 18:08:13 +08:00
|
|
|
/** Convenience macro for when no PHY is set. */
|
|
|
|
BT_GAP_LE_PHY_NONE = 0,
|
2020-02-02 01:06:49 +08:00
|
|
|
/** LE 1M PHY */
|
|
|
|
BT_GAP_LE_PHY_1M = BIT(0),
|
|
|
|
/** LE 2M PHY */
|
|
|
|
BT_GAP_LE_PHY_2M = BIT(1),
|
|
|
|
/** LE Coded PHY */
|
|
|
|
BT_GAP_LE_PHY_CODED = BIT(2),
|
|
|
|
};
|
|
|
|
|
2020-04-29 01:47:46 +08:00
|
|
|
/** Advertising PDU types */
|
2020-02-02 01:06:49 +08:00
|
|
|
enum {
|
|
|
|
/** Scannable and connectable advertising. */
|
|
|
|
BT_GAP_ADV_TYPE_ADV_IND = 0x00,
|
|
|
|
/** Directed connectable advertising. */
|
|
|
|
BT_GAP_ADV_TYPE_ADV_DIRECT_IND = 0x01,
|
|
|
|
/** Non-connectable and scannable advertising. */
|
|
|
|
BT_GAP_ADV_TYPE_ADV_SCAN_IND = 0x02,
|
|
|
|
/** Non-connectable and non-scannable advertising. */
|
|
|
|
BT_GAP_ADV_TYPE_ADV_NONCONN_IND = 0x03,
|
|
|
|
/** Additional advertising data requested by an active scanner. */
|
|
|
|
BT_GAP_ADV_TYPE_SCAN_RSP = 0x04,
|
|
|
|
/** Extended advertising, see advertising properties. */
|
|
|
|
BT_GAP_ADV_TYPE_EXT_ADV = 0x05,
|
|
|
|
};
|
|
|
|
|
2020-04-29 01:47:46 +08:00
|
|
|
/** Advertising PDU properties */
|
2020-02-02 01:06:49 +08:00
|
|
|
enum {
|
|
|
|
/** Connectable advertising. */
|
|
|
|
BT_GAP_ADV_PROP_CONNECTABLE = BIT(0),
|
|
|
|
/** Scannable advertising. */
|
|
|
|
BT_GAP_ADV_PROP_SCANNABLE = BIT(1),
|
|
|
|
/** Directed advertising. */
|
|
|
|
BT_GAP_ADV_PROP_DIRECTED = BIT(2),
|
|
|
|
/** Additional advertising data requested by an active scanner. */
|
|
|
|
BT_GAP_ADV_PROP_SCAN_RESPONSE = BIT(3),
|
|
|
|
/** Extended advertising. */
|
|
|
|
BT_GAP_ADV_PROP_EXT_ADV = BIT(4),
|
|
|
|
};
|
|
|
|
|
2020-02-02 01:27:39 +08:00
|
|
|
/** Maximum advertising data length. */
|
|
|
|
#define BT_GAP_ADV_MAX_ADV_DATA_LEN 31
|
2020-04-29 01:47:46 +08:00
|
|
|
/** Maximum extended advertising data length.
|
2020-02-02 01:27:39 +08:00
|
|
|
*
|
|
|
|
* @note The maximum advertising data length that can be sent by an extended
|
|
|
|
* advertiser is defined by the controller.
|
|
|
|
*/
|
|
|
|
#define BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN 1650
|
|
|
|
|
2020-02-02 01:06:49 +08:00
|
|
|
#define BT_GAP_TX_POWER_INVALID 0x7f
|
|
|
|
#define BT_GAP_RSSI_INVALID 0x7f
|
|
|
|
#define BT_GAP_SID_INVALID 0xff
|
|
|
|
#define BT_GAP_NO_TIMEOUT 0x0000
|
|
|
|
|
2020-04-10 02:06:02 +08:00
|
|
|
/* The maximum allowed high duty cycle directed advertising timeout, 1.28
|
|
|
|
* seconds in 10 ms unit.
|
|
|
|
*/
|
|
|
|
#define BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT 128
|
|
|
|
|
2020-04-23 02:28:48 +08:00
|
|
|
#define BT_GAP_DATA_LEN_DEFAULT 0x001b /* 27 bytes */
|
|
|
|
#define BT_GAP_DATA_LEN_MAX 0x00fb /* 251 bytes */
|
|
|
|
|
|
|
|
#define BT_GAP_DATA_TIME_DEFAULT 0x0148 /* 328 us */
|
|
|
|
#define BT_GAP_DATA_TIME_MAX 0x4290 /* 17040 us */
|
|
|
|
|
2020-05-07 04:38:23 +08:00
|
|
|
#define BT_GAP_SID_MAX 0x0F
|
2021-04-20 18:27:29 +08:00
|
|
|
#define BT_GAP_PER_ADV_MAX_SKIP 0x01F3
|
|
|
|
#define BT_GAP_PER_ADV_MIN_TIMEOUT 0x000A
|
|
|
|
#define BT_GAP_PER_ADV_MAX_TIMEOUT 0x4000
|
2021-04-22 18:32:42 +08:00
|
|
|
/** Minimum Periodic Advertising Interval (N * 1.25 ms) */
|
|
|
|
#define BT_GAP_PER_ADV_MIN_INTERVAL 0x0006
|
|
|
|
/** Maximum Periodic Advertising Interval (N * 1.25 ms) */
|
|
|
|
#define BT_GAP_PER_ADV_MAX_INTERVAL 0xFFFF
|
2020-05-07 04:38:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
/** Constant Tone Extension (CTE) types */
|
|
|
|
enum {
|
|
|
|
/** Angle of Arrival */
|
|
|
|
BT_GAP_CTE_AOA = 0x00,
|
|
|
|
/** Angle of Departure with 1 us slots */
|
|
|
|
BT_GAP_CTE_AOD_1US = 0x01,
|
|
|
|
/** Angle of Departure with 2 us slots */
|
|
|
|
BT_GAP_CTE_AOD_2US = 0x02,
|
|
|
|
/** No extensions */
|
|
|
|
BT_GAP_CTE_NONE = 0xFF,
|
|
|
|
};
|
|
|
|
|
2021-03-01 18:10:29 +08:00
|
|
|
|
|
|
|
/** @brief Peripheral sleep clock accuracy (SCA) in ppm (parts per million) */
|
|
|
|
enum {
|
|
|
|
BT_GAP_SCA_UNKNOWN = 0,
|
|
|
|
BT_GAP_SCA_251_500 = 0,
|
|
|
|
BT_GAP_SCA_151_250 = 1,
|
|
|
|
BT_GAP_SCA_101_150 = 2,
|
|
|
|
BT_GAP_SCA_76_100 = 3,
|
|
|
|
BT_GAP_SCA_51_75 = 4,
|
|
|
|
BT_GAP_SCA_31_50 = 5,
|
|
|
|
BT_GAP_SCA_21_30 = 6,
|
|
|
|
BT_GAP_SCA_0_20 = 7,
|
|
|
|
};
|
|
|
|
|
2020-04-29 01:32:02 +08:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2019-10-16 18:00:16 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ */
|