LCOV - code coverage report
Current view: top level - zephyr/bluetooth - gap.h Hit Total Coverage
Test: new.info Lines: 402 428 93.9 %
Date: 2024-12-22 00:14:23

          Line data    Source code
       1           1 : /** @file
       2             :  *  @brief Bluetooth Generic Access Profile defines and Assigned Numbers.
       3             :  */
       4             : 
       5             : /*
       6             :  * Copyright (c) 2019 Nordic Semiconductor ASA
       7             :  *
       8             :  * SPDX-License-Identifier: Apache-2.0
       9             :  */
      10             : 
      11             : #ifndef ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_
      12             : #define ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_
      13             : 
      14             : #include <zephyr/sys/util_macro.h>
      15             : #include <zephyr/bluetooth/byteorder.h>
      16             : 
      17             : #ifdef __cplusplus
      18             : extern "C" {
      19             : #endif
      20             : 
      21             : /**
      22             :  * @brief Bluetooth Generic Access Profile defines and Assigned Numbers.
      23             :  * @defgroup bt_gap_defines Defines and Assigned Numbers
      24             :  * @ingroup bt_gap
      25             :  * @{
      26             :  */
      27             : 
      28             : /**
      29             :  * @name Company Identifiers (see Bluetooth Assigned Numbers)
      30             :  * @{
      31             :  */
      32           1 : #define BT_COMP_ID_LF           0x05f1 /**< The Linux Foundation */
      33             : /**
      34             :  * @}
      35             :  */
      36             : 
      37             : /**
      38             :  * @name EIR/AD data type definitions
      39             :  * @{
      40             :  */
      41           1 : #define BT_DATA_FLAGS                    0x01 /**< AD flags */
      42           1 : #define BT_DATA_UUID16_SOME              0x02 /**< 16-bit UUID, more available */
      43           1 : #define BT_DATA_UUID16_ALL               0x03 /**< 16-bit UUID, all listed */
      44           1 : #define BT_DATA_UUID32_SOME              0x04 /**< 32-bit UUID, more available */
      45           1 : #define BT_DATA_UUID32_ALL               0x05 /**< 32-bit UUID, all listed */
      46           1 : #define BT_DATA_UUID128_SOME             0x06 /**< 128-bit UUID, more available */
      47           1 : #define BT_DATA_UUID128_ALL              0x07 /**< 128-bit UUID, all listed */
      48           1 : #define BT_DATA_NAME_SHORTENED           0x08 /**< Shortened name */
      49           1 : #define BT_DATA_NAME_COMPLETE            0x09 /**< Complete name */
      50           1 : #define BT_DATA_TX_POWER                 0x0a /**< Tx Power */
      51           1 : #define BT_DATA_DEVICE_CLASS             0x0d /**< Class of Device */
      52           1 : #define BT_DATA_SIMPLE_PAIRING_HASH_C192 0x0e /**< Simple Pairing Hash C-192 */
      53           1 : #define BT_DATA_SIMPLE_PAIRING_RAND_C192 0x0f /**< Simple Pairing Randomizer R-192 */
      54           1 : #define BT_DATA_DEVICE_ID                0x10 /**< Device ID (Profile) */
      55           1 : #define BT_DATA_SM_TK_VALUE              0x10 /**< Security Manager TK Value */
      56           1 : #define BT_DATA_SM_OOB_FLAGS             0x11 /**< Security Manager OOB Flags */
      57           1 : #define BT_DATA_PERIPHERAL_INT_RANGE     0x12 /**< Peripheral Connection Interval Range */
      58           1 : #define BT_DATA_SOLICIT16                0x14 /**< Solicit UUIDs, 16-bit */
      59           1 : #define BT_DATA_SOLICIT128               0x15 /**< Solicit UUIDs, 128-bit */
      60           1 : #define BT_DATA_SVC_DATA16               0x16 /**< Service data, 16-bit UUID */
      61           1 : #define BT_DATA_PUB_TARGET_ADDR          0x17 /**< Public Target Address */
      62           1 : #define BT_DATA_RAND_TARGET_ADDR         0x18 /**< Random Target Address */
      63           1 : #define BT_DATA_GAP_APPEARANCE           0x19 /**< GAP appearance */
      64           1 : #define BT_DATA_ADV_INT                  0x1a /**< Advertising Interval */
      65           1 : #define BT_DATA_LE_BT_DEVICE_ADDRESS     0x1b /**< LE Bluetooth Device Address */
      66           1 : #define BT_DATA_LE_ROLE                  0x1c /**< LE Role */
      67           1 : #define BT_DATA_SIMPLE_PAIRING_HASH      0x1d /**< Simple Pairing Hash C256 */
      68           1 : #define BT_DATA_SIMPLE_PAIRING_RAND      0x1e /**< Simple Pairing Randomizer R256 */
      69           1 : #define BT_DATA_SOLICIT32                0x1f /**< Solicit UUIDs, 32-bit */
      70           1 : #define BT_DATA_SVC_DATA32               0x20 /**< Service data, 32-bit UUID */
      71           1 : #define BT_DATA_SVC_DATA128              0x21 /**< Service data, 128-bit UUID */
      72           1 : #define BT_DATA_LE_SC_CONFIRM_VALUE      0x22 /**< LE SC Confirmation Value */
      73           1 : #define BT_DATA_LE_SC_RANDOM_VALUE       0x23 /**< LE SC Random Value */
      74           1 : #define BT_DATA_URI                      0x24 /**< URI */
      75           1 : #define BT_DATA_INDOOR_POS               0x25 /**< Indoor Positioning */
      76           1 : #define BT_DATA_TRANS_DISCOVER_DATA      0x26 /**< Transport Discovery Data */
      77           1 : #define BT_DATA_LE_SUPPORTED_FEATURES    0x27 /**< LE Supported Features */
      78           1 : #define BT_DATA_CHANNEL_MAP_UPDATE_IND   0x28 /**< Channel Map Update Indication */
      79           1 : #define BT_DATA_MESH_PROV                0x29 /**< Mesh Provisioning PDU */
      80           1 : #define BT_DATA_MESH_MESSAGE             0x2a /**< Mesh Networking PDU */
      81           1 : #define BT_DATA_MESH_BEACON              0x2b /**< Mesh Beacon */
      82           1 : #define BT_DATA_BIG_INFO                 0x2c /**< BIGInfo */
      83           1 : #define BT_DATA_BROADCAST_CODE           0x2d /**< Broadcast Code */
      84           1 : #define BT_DATA_CSIS_RSI                 0x2e /**< CSIS Random Set ID type */
      85           1 : #define BT_DATA_ADV_INT_LONG             0x2f /**< Advertising Interval long */
      86           1 : #define BT_DATA_BROADCAST_NAME           0x30 /**< Broadcast Name */
      87           1 : #define BT_DATA_ENCRYPTED_AD_DATA        0x31 /**< Encrypted Advertising Data */
      88           1 : #define BT_DATA_PAWR_TIMING_INFO         0x32 /**< Periodic Advertising Response Timing Info */
      89           1 : #define BT_DATA_ESL                      0x34 /**< Electronic Shelf Label Profile */
      90           1 : #define BT_DATA_3D_INFO                  0x3D /**< 3D Information Data */
      91             : 
      92           1 : #define BT_DATA_MANUFACTURER_DATA        0xff /**< Manufacturer Specific Data */
      93             : 
      94           1 : #define BT_LE_AD_LIMITED                 0x01 /**< Limited Discoverable */
      95           1 : #define BT_LE_AD_GENERAL                 0x02 /**< General Discoverable */
      96           1 : #define BT_LE_AD_NO_BREDR                0x04 /**< BR/EDR not supported */
      97             : /**
      98             :  * @}
      99             :  */
     100             : 
     101             : /**
     102             :  * @name Appearance Values
     103             :  *
     104             :  * Last Modified on 2023-01-05
     105             :  * @{
     106             :  */
     107             : /** Generic Unknown */
     108           1 : #define BT_APPEARANCE_UNKNOWN                               0x0000
     109             : /** Generic Phone */
     110           1 : #define BT_APPEARANCE_GENERIC_PHONE                         0x0040
     111             : /** Generic Computer */
     112           1 : #define BT_APPEARANCE_GENERIC_COMPUTER                      0x0080
     113             : /** Desktop Workstation */
     114           1 : #define BT_APPEARANCE_COMPUTER_DESKTOP_WORKSTATION          0x0081
     115             : /** Server-class Computer */
     116           1 : #define BT_APPEARANCE_COMPUTER_SERVER_CLASS                 0x0082
     117             : /** Laptop */
     118           1 : #define BT_APPEARANCE_COMPUTER_LAPTOP                       0x0083
     119             : /** Handheld PC/PDA (clamshell) */
     120           1 : #define BT_APPEARANCE_COMPUTER_HANDHELD_PCPDA               0x0084
     121             : /** PalmĀ­size PC/PDA */
     122           1 : #define BT_APPEARANCE_COMPUTER_PALMSIZE_PCPDA               0x0085
     123             : /** Wearable computer (watch size) */
     124           1 : #define BT_APPEARANCE_COMPUTER_WEARABLE_COMPUTER            0x0086
     125             : /** Tablet */
     126           1 : #define BT_APPEARANCE_COMPUTER_TABLET                       0x0087
     127             : /** Docking Station */
     128           1 : #define BT_APPEARANCE_COMPUTER_DOCKING_STATION              0x0088
     129             : /** All in One */
     130           1 : #define BT_APPEARANCE_COMPUTER_ALL_IN_ONE                   0x0089
     131             : /** Blade Server */
     132           1 : #define BT_APPEARANCE_COMPUTER_BLADE_SERVER                 0x008A
     133             : /** Convertible */
     134           1 : #define BT_APPEARANCE_COMPUTER_CONVERTIBLE                  0x008B
     135             : /** Detachable */
     136           1 : #define BT_APPEARANCE_COMPUTER_DETACHABLE                   0x008C
     137             : /** IoT Gateway */
     138           1 : #define BT_APPEARANCE_COMPUTER_IOT_GATEWAY                  0x008D
     139             : /** Mini PC */
     140           1 : #define BT_APPEARANCE_COMPUTER_MINI_PC                      0x008E
     141             : /** Stick PC */
     142           1 : #define BT_APPEARANCE_COMPUTER_STICK_PC                     0x008F
     143             : /** Generic Watch */
     144           1 : #define BT_APPEARANCE_GENERIC_WATCH                         0x00C0
     145             : /** Sports Watch */
     146           1 : #define BT_APPEARANCE_SPORTS_WATCH                          0x00C1
     147             : /** Smartwatch */
     148           1 : #define BT_APPEARANCE_SMARTWATCH                            0x00C2
     149             : /** Generic Clock */
     150           1 : #define BT_APPEARANCE_GENERIC_CLOCK                         0x0100
     151             : /** Generic Display */
     152           1 : #define BT_APPEARANCE_GENERIC_DISPLAY                       0x0140
     153             : /** Generic Remote Control */
     154           1 : #define BT_APPEARANCE_GENERIC_REMOTE                        0x0180
     155             : /** Generic Eye-glasses */
     156           1 : #define BT_APPEARANCE_GENERIC_EYEGLASSES                    0x01C0
     157             : /** Generic Tag */
     158           1 : #define BT_APPEARANCE_GENERIC_TAG                           0x0200
     159             : /** Generic Keyring */
     160           1 : #define BT_APPEARANCE_GENERIC_KEYRING                       0x0240
     161             : /** Generic Media Player */
     162           1 : #define BT_APPEARANCE_GENERIC_MEDIA_PLAYER                  0x0280
     163             : /** Generic Barcode Scanner */
     164           1 : #define BT_APPEARANCE_GENERIC_BARCODE_SCANNER               0x02C0
     165             : /** Generic Thermometer */
     166           1 : #define BT_APPEARANCE_GENERIC_THERMOMETER                   0x0300
     167             : /** Ear Thermometer */
     168           1 : #define BT_APPEARANCE_THERMOMETER_EAR                       0x0301
     169             : /** Generic Heart Rate Sensor */
     170           1 : #define BT_APPEARANCE_GENERIC_HEART_RATE                    0x0340
     171             : /** Heart Rate Belt */
     172           1 : #define BT_APPEARANCE_HEART_RATE_BELT                       0x0341
     173             : /** Generic Blood Pressure */
     174           1 : #define BT_APPEARANCE_GENERIC_BLOOD_PRESSURE                0x0380
     175             : /** Arm Blood Pressure */
     176           1 : #define BT_APPEARANCE_BLOOD_PRESSURE_ARM                    0x0381
     177             : /** Wrist Blood Pressure */
     178           1 : #define BT_APPEARANCE_BLOOD_PRESSURE_WRIST                  0x0382
     179             : /** Generic Human Interface Device */
     180           1 : #define BT_APPEARANCE_GENERIC_HID                           0x03C0
     181             : /** Keyboard */
     182           1 : #define BT_APPEARANCE_HID_KEYBOARD                          0x03C1
     183             : /** Mouse */
     184           1 : #define BT_APPEARANCE_HID_MOUSE                             0x03C2
     185             : /** Joystick */
     186           1 : #define BT_APPEARANCE_HID_JOYSTICK                          0x03C3
     187             : /** Gamepad */
     188           1 : #define BT_APPEARANCE_HID_GAMEPAD                           0x03C4
     189             : /** Digitizer Tablet */
     190           1 : #define BT_APPEARANCE_HID_DIGITIZER_TABLET                  0x03C5
     191             : /** Card Reader */
     192           1 : #define BT_APPEARANCE_HID_CARD_READER                       0x03C6
     193             : /** Digital Pen */
     194           1 : #define BT_APPEARANCE_HID_DIGITAL_PEN                       0x03C7
     195             : /** Barcode Scanner */
     196           1 : #define BT_APPEARANCE_HID_BARCODE_SCANNER                   0x03C8
     197             : /** Touchpad */
     198           1 : #define BT_APPEARANCE_HID_TOUCHPAD                          0x03C9
     199             : /** Presentation Remote */
     200           1 : #define BT_APPEARANCE_HID_PRESENTATION_REMOTE               0x03CA
     201             : /** Generic Glucose Meter */
     202           1 : #define BT_APPEARANCE_GENERIC_GLUCOSE                       0x0400
     203             : /** Generic Running Walking Sensor */
     204           1 : #define BT_APPEARANCE_GENERIC_WALKING                       0x0440
     205             : /** In-Shoe Running Walking Sensor */
     206           1 : #define BT_APPEARANCE_WALKING_IN_SHOE                       0x0441
     207             : /** On-Shoe Running Walking Sensor */
     208           1 : #define BT_APPEARANCE_WALKING_ON_SHOE                       0x0442
     209             : /** On-Hip Running Walking Sensor */
     210           1 : #define BT_APPEARANCE_WALKING_ON_HIP                        0x0443
     211             : /** Generic Cycling */
     212           1 : #define BT_APPEARANCE_GENERIC_CYCLING                       0x0480
     213             : /** Cycling Computer */
     214           1 : #define BT_APPEARANCE_CYCLING_COMPUTER                      0x0481
     215             : /** Speed Sensor */
     216           1 : #define BT_APPEARANCE_CYCLING_SPEED                         0x0482
     217             : /** Cadence Sensor */
     218           1 : #define BT_APPEARANCE_CYCLING_CADENCE                       0x0483
     219             : /** Power Sensor */
     220           1 : #define BT_APPEARANCE_CYCLING_POWER                         0x0484
     221             : /** Speed and Cadence Sensor */
     222           1 : #define BT_APPEARANCE_CYCLING_SPEED_CADENCE                 0x0485
     223             : /** Generic Control Device */
     224           1 : #define BT_APPEARANCE_GENERIC_CONTROL_DEVICE                0x04C0
     225             : /** Switch */
     226           1 : #define BT_APPEARANCE_CONTROL_SWITCH                        0x04C1
     227             : /** Multi-switch */
     228           1 : #define BT_APPEARANCE_CONTROL_MULTI_SWITCH                  0x04C2
     229             : /** Button */
     230           1 : #define BT_APPEARANCE_CONTROL_BUTTON                        0x04C3
     231             : /** Slider */
     232           1 : #define BT_APPEARANCE_CONTROL_SLIDER                        0x04C4
     233             : /** Rotary Switch */
     234           1 : #define BT_APPEARANCE_CONTROL_ROTARY_SWITCH                 0x04C5
     235             : /** Touch Panel */
     236           1 : #define BT_APPEARANCE_CONTROL_TOUCH_PANEL                   0x04C6
     237             : /** Single Switch */
     238           1 : #define BT_APPEARANCE_CONTROL_SINGLE_SWITCH                 0x04C7
     239             : /** Double Switch */
     240           1 : #define BT_APPEARANCE_CONTROL_DOUBLE_SWITCH                 0x04C8
     241             : /** Triple Switch */
     242           1 : #define BT_APPEARANCE_CONTROL_TRIPLE_SWITCH                 0x04C9
     243             : /** Battery Switch */
     244           1 : #define BT_APPEARANCE_CONTROL_BATTERY_SWITCH                0x04CA
     245             : /** Energy Harvesting Switch */
     246           1 : #define BT_APPEARANCE_CONTROL_ENERGY_HARVESTING_SWITCH      0x04CB
     247             : /** Push Button */
     248           1 : #define BT_APPEARANCE_CONTROL_PUSH_BUTTON                   0x04CC
     249             : /** Generic Network Device */
     250           1 : #define BT_APPEARANCE_GENERIC_NETWORK_DEVICE                0x0500
     251             : /** Access Point */
     252           1 : #define BT_APPEARANCE_NETWORK_ACCESS_POINT                  0x0501
     253             : /** Mesh Device */
     254           1 : #define BT_APPEARANCE_NETWORK_MESH_DEVICE                   0x0502
     255             : /** Mesh Network Proxy */
     256           1 : #define BT_APPEARANCE_NETWORK_MESH_PROXY                    0x0503
     257             : /** Generic Sensor */
     258           1 : #define BT_APPEARANCE_GENERIC_SENSOR                        0x0540
     259             : /** Motion Sensor */
     260           1 : #define BT_APPEARANCE_SENSOR_MOTION                         0x0541
     261             : /** Air quality Sensor */
     262           1 : #define BT_APPEARANCE_SENSOR_AIR_QUALITY                    0x0542
     263             : /** Temperature Sensor */
     264           1 : #define BT_APPEARANCE_SENSOR_TEMPERATURE                    0x0543
     265             : /** Humidity Sensor */
     266           1 : #define BT_APPEARANCE_SENSOR_HUMIDITY                       0x0544
     267             : /** Leak Sensor */
     268           1 : #define BT_APPEARANCE_SENSOR_LEAK                           0x0545
     269             : /** Smoke Sensor */
     270           1 : #define BT_APPEARANCE_SENSOR_SMOKE                          0x0546
     271             : /** Occupancy Sensor */
     272           1 : #define BT_APPEARANCE_SENSOR_OCCUPANCY                      0x0547
     273             : /** Contact Sensor */
     274           1 : #define BT_APPEARANCE_SENSOR_CONTACT                        0x0548
     275             : /** Carbon Monoxide Sensor */
     276           1 : #define BT_APPEARANCE_SENSOR_CARBON_MONOXIDE                0x0549
     277             : /** Carbon Dioxide Sensor */
     278           1 : #define BT_APPEARANCE_SENSOR_CARBON_DIOXIDE                 0x054A
     279             : /** Ambient Light Sensor */
     280           1 : #define BT_APPEARANCE_SENSOR_AMBIENT_LIGHT                  0x054B
     281             : /** Energy Sensor */
     282           1 : #define BT_APPEARANCE_SENSOR_ENERGY                         0x054C
     283             : /** Color Light Sensor */
     284           1 : #define BT_APPEARANCE_SENSOR_COLOR_LIGHT                    0x054D
     285             : /** Rain Sensor */
     286           1 : #define BT_APPEARANCE_SENSOR_RAIN                           0x054E
     287             : /** Fire Sensor */
     288           1 : #define BT_APPEARANCE_SENSOR_FIRE                           0x054F
     289             : /** Wind Sensor */
     290           1 : #define BT_APPEARANCE_SENSOR_WIND                           0x0550
     291             : /** Proximity Sensor */
     292           1 : #define BT_APPEARANCE_SENSOR_PROXIMITY                      0x0551
     293             : /** Multi-Sensor */
     294           1 : #define BT_APPEARANCE_SENSOR_MULTI                          0x0552
     295             : /** Flush Mounted Sensor */
     296           1 : #define BT_APPEARANCE_SENSOR_FLUSH_MOUNTED                  0x0553
     297             : /** Ceiling Mounted Sensor */
     298           1 : #define BT_APPEARANCE_SENSOR_CEILING_MOUNTED                0x0554
     299             : /** Wall Mounted Sensor */
     300           1 : #define BT_APPEARANCE_SENSOR_WALL_MOUNTED                   0x0555
     301             : /** Multisensor */
     302           1 : #define BT_APPEARANCE_MULTISENSOR                           0x0556
     303             : /** Energy Meter */
     304           1 : #define BT_APPEARANCE_SENSOR_ENERGY_METER                   0x0557
     305             : /** Flame Detector */
     306           1 : #define BT_APPEARANCE_SENSOR_FLAME_DETECTOR                 0x0558
     307             : /** Vehicle Tire Pressure Sensor */
     308           1 : #define BT_APPEARANCE_SENSOR_VEHICLE_TIRE_PRESSURE          0x0559
     309             : /** Generic Light Fixtures */
     310           1 : #define BT_APPEARANCE_GENERIC_LIGHT_FIXTURES                0x0580
     311             : /** Wall Light */
     312           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_WALL                   0x0581
     313             : /** Ceiling Light */
     314           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_CEILING                0x0582
     315             : /** Floor Light */
     316           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_FLOOR                  0x0583
     317             : /** Cabinet Light */
     318           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_CABINET                0x0584
     319             : /** Desk Light */
     320           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_DESK                   0x0585
     321             : /** Troffer Light */
     322           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_TROFFER                0x0586
     323             : /** Pendant Light */
     324           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_PENDANT                0x0587
     325             : /** In-ground Light */
     326           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_IN_GROUND              0x0588
     327             : /** Flood Light */
     328           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_FLOOD                  0x0589
     329             : /** Underwater Light */
     330           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_UNDERWATER             0x058A
     331             : /** Bollard with Light */
     332           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_BOLLARD_WITH           0x058B
     333             : /** Pathway Light */
     334           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_PATHWAY                0x058C
     335             : /** Garden Light */
     336           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_GARDEN                 0x058D
     337             : /** Pole-top Light */
     338           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_POLE_TOP               0x058E
     339             : /** Spotlight */
     340           1 : #define BT_APPEARANCE_SPOT_LIGHT                            0x058F
     341             : /** Linear Light */
     342           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_LINEAR                 0x0590
     343             : /** Street Light */
     344           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_STREET                 0x0591
     345             : /** Shelves Light */
     346           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_SHELVES                0x0592
     347             : /** Bay Light */
     348           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_BAY                    0x0593
     349             : /** Emergency Exit Light */
     350           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_EMERGENCY_EXIT         0x0594
     351             : /** Light Controller */
     352           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_CONTROLLER             0x0595
     353             : /** Light Driver */
     354           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_DRIVER                 0x0596
     355             : /** Bulb */
     356           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_BULB                   0x0597
     357             : /** Low-bay Light */
     358           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_LOW_BAY                0x0598
     359             : /** High-bay Light */
     360           1 : #define BT_APPEARANCE_LIGHT_FIXTURES_HIGH_BAY               0x0599
     361             : /** Generic Fan */
     362           1 : #define BT_APPEARANCE_GENERIC_FAN                           0x05C0
     363             : /** Ceiling Fan */
     364           1 : #define BT_APPEARANCE_FAN_CEILING                           0x05C1
     365             : /** Axial Fan */
     366           1 : #define BT_APPEARANCE_FAN_AXIAL                             0x05C2
     367             : /** Exhaust Fan */
     368           1 : #define BT_APPEARANCE_FAN_EXHAUST                           0x05C3
     369             : /** Pedestal Fan */
     370           1 : #define BT_APPEARANCE_FAN_PEDESTAL                          0x05C4
     371             : /** Desk Fan */
     372           1 : #define BT_APPEARANCE_FAN_DESK                              0x05C5
     373             : /** Wall Fan */
     374           1 : #define BT_APPEARANCE_FAN_WALL                              0x05C6
     375             : /** Generic HVAC */
     376           1 : #define BT_APPEARANCE_GENERIC_HVAC                          0x0600
     377             : /** Thermostat */
     378           1 : #define BT_APPEARANCE_HVAC_THERMOSTAT                       0x0601
     379             : /** Humidifier */
     380           1 : #define BT_APPEARANCE_HVAC_HUMIDIFIER                       0x0602
     381             : /** De-humidifier */
     382           1 : #define BT_APPEARANCE_HVAC_DEHUMIDIFIER                     0x0603
     383             : /** Heater */
     384           1 : #define BT_APPEARANCE_HVAC_HEATER                           0x0604
     385             : /** Radiator */
     386           1 : #define BT_APPEARANCE_HVAC_RADIATOR                         0x0605
     387             : /** Boiler */
     388           1 : #define BT_APPEARANCE_HVAC_BOILER                           0x0606
     389             : /** Heat Pump */
     390           1 : #define BT_APPEARANCE_HVAC_HEAT_PUMP                        0x0607
     391             : /** Infrared Heater */
     392           1 : #define BT_APPEARANCE_HVAC_INFRARED_HEATER                  0x0608
     393             : /** Radiant Panel Heater */
     394           1 : #define BT_APPEARANCE_HVAC_RADIANT_PANEL_HEATER             0x0609
     395             : /** Fan Heater */
     396           1 : #define BT_APPEARANCE_HVAC_FAN_HEATER                       0x060A
     397             : /** Air Curtain */
     398           1 : #define BT_APPEARANCE_HVAC_AIR_CURTAIN                      0x060B
     399             : /** Generic Air Conditioning */
     400           1 : #define BT_APPEARANCE_GENERIC_AIR_CONDITIONING              0x0640
     401             : /** Generic Humidifier */
     402           1 : #define BT_APPEARANCE_GENERIC_HUMIDIFIER                    0x0680
     403             : /** Generic Heating */
     404           1 : #define BT_APPEARANCE_GENERIC_HEATING                       0x06C0
     405             : /** Radiator */
     406           1 : #define BT_APPEARANCE_HEATING_RADIATOR                      0x06C1
     407             : /** Boiler */
     408           1 : #define BT_APPEARANCE_HEATING_BOILER                        0x06C2
     409             : /** Heat Pump */
     410           1 : #define BT_APPEARANCE_HEATING_HEAT_PUMP                     0x06C3
     411             : /** Infrared Heater */
     412           1 : #define BT_APPEARANCE_HEATING_INFRARED_HEATER               0x06C4
     413             : /** Radiant Panel Heater */
     414           1 : #define BT_APPEARANCE_HEATING_RADIANT_PANEL_HEATER          0x06C5
     415             : /** Fan Heater */
     416           1 : #define BT_APPEARANCE_HEATING_FAN_HEATER                    0x06C6
     417             : /** Air Curtain */
     418           1 : #define BT_APPEARANCE_HEATING_AIR_CURTAIN                   0x06C7
     419             : /** Generic Access Control */
     420           1 : #define BT_APPEARANCE_GENERIC_ACCESS_CONTROL                0x0700
     421             : /** Access Door */
     422           1 : #define BT_APPEARANCE_CONTROL_ACCESS_DOOR                   0x0701
     423             : /** Garage Door */
     424           1 : #define BT_APPEARANCE_CONTROL_GARAGE_DOOR                   0x0702
     425             : /** Emergency Exit Door */
     426           1 : #define BT_APPEARANCE_CONTROL_EMERGENCY_EXIT_DOOR           0x0703
     427             : /** Access Lock */
     428           1 : #define BT_APPEARANCE_CONTROL_ACCESS_LOCK                   0x0704
     429             : /** Elevator */
     430           1 : #define BT_APPEARANCE_CONTROL_ELEVATOR                      0x0705
     431             : /** Window */
     432           1 : #define BT_APPEARANCE_CONTROL_WINDOW                        0x0706
     433             : /** Entrance Gate */
     434           1 : #define BT_APPEARANCE_CONTROL_ENTRANCE_GATE                 0x0707
     435             : /** Door Lock */
     436           1 : #define BT_APPEARANCE_CONTROL_DOOR_LOCK                     0x0708
     437             : /** Locker */
     438           1 : #define BT_APPEARANCE_CONTROL_LOCKER                        0x0709
     439             : /** Generic Motorized Device */
     440           1 : #define BT_APPEARANCE_GENERIC_MOTORIZED_DEVICE              0x0740
     441             : /** Motorized Gate */
     442           1 : #define BT_APPEARANCE_MOTORIZED_GATE                        0x0741
     443             : /** Awning */
     444           1 : #define BT_APPEARANCE_MOTORIZED_AWNING                      0x0742
     445             : /** Blinds or Shades */
     446           1 : #define BT_APPEARANCE_MOTORIZED_BLINDS_OR_SHADES            0x0743
     447             : /** Curtains */
     448           1 : #define BT_APPEARANCE_MOTORIZED_CURTAINS                    0x0744
     449             : /** Screen */
     450           1 : #define BT_APPEARANCE_MOTORIZED_SCREEN                      0x0745
     451             : /** Generic Power Device */
     452           1 : #define BT_APPEARANCE_GENERIC_POWER_DEVICE                  0x0780
     453             : /** Power Outlet */
     454           1 : #define BT_APPEARANCE_POWER_OUTLET                          0x0781
     455             : /** Power Strip */
     456           1 : #define BT_APPEARANCE_POWER_STRIP                           0x0782
     457             : /** Plug */
     458           1 : #define BT_APPEARANCE_POWER_PLUG                            0x0783
     459             : /** Power Supply */
     460           1 : #define BT_APPEARANCE_POWER_SUPPLY                          0x0784
     461             : /** LED Driver */
     462           1 : #define BT_APPEARANCE_POWER_LED_DRIVER                      0x0785
     463             : /** Fluorescent Lamp Gear */
     464           1 : #define BT_APPEARANCE_POWER_FLUORESCENT_LAMP_GEAR           0x0786
     465             : /** HID Lamp Gear */
     466           1 : #define BT_APPEARANCE_POWER_HID_LAMP_GEAR                   0x0787
     467             : /** Charge Case */
     468           1 : #define BT_APPEARANCE_POWER_CHARGE_CASE                     0x0788
     469             : /** Power Bank */
     470           1 : #define BT_APPEARANCE_POWER_POWER_BANK                      0x0789
     471             : /** Generic Light Source */
     472           1 : #define BT_APPEARANCE_GENERIC_LIGHT_SOURCE                  0x07C0
     473             : /** Incandescent Light Bulb */
     474           1 : #define BT_APPEARANCE_LIGHT_SOURCE_INCANDESCENT_BULB        0x07C1
     475             : /** LED Lamp */
     476           1 : #define BT_APPEARANCE_LIGHT_SOURCE_LED_LAMP                 0x07C2
     477             : /** HID Lamp */
     478           1 : #define BT_APPEARANCE_LIGHT_SOURCE_HID_LAMP                 0x07C3
     479             : /** Fluorescent Lamp */
     480           1 : #define BT_APPEARANCE_LIGHT_SOURCE_FLUORESCENT_LAMP         0x07C4
     481             : /** LED Array */
     482           1 : #define BT_APPEARANCE_LIGHT_SOURCE_LED_ARRAY                0x07C5
     483             : /** Multi-Color LED Array */
     484           1 : #define BT_APPEARANCE_LIGHT_SOURCE_MULTICOLOR_LED_ARRAY     0x07C6
     485             : /** Low voltage halogen */
     486           1 : #define BT_APPEARANCE_LIGHT_SOURCE_LOW_VOLTAGE_HALOGEN      0x07C7
     487             : /** Organic light emitting diode */
     488           1 : #define BT_APPEARANCE_LIGHT_SOURCE_OLED                     0x07C8
     489             : /** Generic Window Covering */
     490           1 : #define BT_APPEARANCE_GENERIC_WINDOW_COVERING               0x0800
     491             : /** Window Shades */
     492           1 : #define BT_APPEARANCE_WINDOW_SHADES                         0x0801
     493             : /** Window Blinds */
     494           1 : #define BT_APPEARANCE_WINDOW_BLINDS                         0x0802
     495             : /** Window Awning */
     496           1 : #define BT_APPEARANCE_WINDOW_AWNING                         0x0803
     497             : /** Window Curtain */
     498           1 : #define BT_APPEARANCE_WINDOW_CURTAIN                        0x0804
     499             : /** Exterior Shutter */
     500           1 : #define BT_APPEARANCE_WINDOW_EXTERIOR_SHUTTER               0x0805
     501             : /** Exterior Screen */
     502           1 : #define BT_APPEARANCE_WINDOW_EXTERIOR_SCREEN                0x0806
     503             : /** Generic Audio Sink */
     504           1 : #define BT_APPEARANCE_GENERIC_AUDIO_SINK                    0x0840
     505             : /** Standalone Speaker */
     506           1 : #define BT_APPEARANCE_AUDIO_SINK_STANDALONE_SPEAKER         0x0841
     507             : /** Soundbar */
     508           1 : #define BT_APPEARANCE_AUDIO_SINK_SOUNDBAR                   0x0842
     509             : /** Bookshelf Speaker */
     510           1 : #define BT_APPEARANCE_AUDIO_SINK_BOOKSHELF_SPEAKER          0x0843
     511             : /** Standmounted Speaker */
     512           1 : #define BT_APPEARANCE_AUDIO_SINK_STANDMOUNTED_SPEAKER       0x0844
     513             : /** Speakerphone */
     514           1 : #define BT_APPEARANCE_AUDIO_SINK_SPEAKERPHONE               0x0845
     515             : /** Generic Audio Source */
     516           1 : #define BT_APPEARANCE_GENERIC_AUDIO_SOURCE                  0x0880
     517             : /** Microphone */
     518           1 : #define BT_APPEARANCE_AUDIO_SOURCE_MICROPHONE               0x0881
     519             : /** Alarm */
     520           1 : #define BT_APPEARANCE_AUDIO_SOURCE_ALARM                    0x0882
     521             : /** Bell */
     522           1 : #define BT_APPEARANCE_AUDIO_SOURCE_BELL                     0x0883
     523             : /** Horn */
     524           1 : #define BT_APPEARANCE_AUDIO_SOURCE_HORN                     0x0884
     525             : /** Broadcasting Device */
     526           1 : #define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_DEVICE      0x0885
     527             : /** Service Desk */
     528           1 : #define BT_APPEARANCE_AUDIO_SOURCE_SERVICE_DESK             0x0886
     529             : /** Kiosk */
     530           1 : #define BT_APPEARANCE_AUDIO_SOURCE_KIOSK                    0x0887
     531             : /** Broadcasting Room */
     532           1 : #define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_ROOM        0x0888
     533             : /** Auditorium */
     534           1 : #define BT_APPEARANCE_AUDIO_SOURCE_AUDITORIUM               0x0889
     535             : /** Generic Motorized Vehicle */
     536           1 : #define BT_APPEARANCE_GENERIC_MOTORIZED_VEHICLE             0x08C0
     537             : /** Car */
     538           1 : #define BT_APPEARANCE_VEHICLE_CAR                           0x08C1
     539             : /** Large Goods Vehicle */
     540           1 : #define BT_APPEARANCE_VEHICLE_LARGE_GOODS                   0x08C2
     541             : /** 2-Wheeled Vehicle */
     542           1 : #define BT_APPEARANCE_VEHICLE_TWO_WHEELED                   0x08C3
     543             : /** Motorbike */
     544           1 : #define BT_APPEARANCE_VEHICLE_MOTORBIKE                     0x08C4
     545             : /** Scooter */
     546           1 : #define BT_APPEARANCE_VEHICLE_SCOOTER                       0x08C5
     547             : /** Moped */
     548           1 : #define BT_APPEARANCE_VEHICLE_MOPED                         0x08C6
     549             : /** 3-Wheeled Vehicle */
     550           1 : #define BT_APPEARANCE_VEHICLE_THREE_WHEELED                 0x08C7
     551             : /** Light Vehicle */
     552           1 : #define BT_APPEARANCE_VEHICLE_LIGHT                         0x08C8
     553             : /** Quad Bike */
     554           1 : #define BT_APPEARANCE_VEHICLE_QUAD_BIKE                     0x08C9
     555             : /** Minibus */
     556           1 : #define BT_APPEARANCE_VEHICLE_MINIBUS                       0x08CA
     557             : /** Bus */
     558           1 : #define BT_APPEARANCE_VEHICLE_BUS                           0x08CB
     559             : /** Trolley */
     560           1 : #define BT_APPEARANCE_VEHICLE_TROLLEY                       0x08CC
     561             : /** Agricultural Vehicle */
     562           1 : #define BT_APPEARANCE_VEHICLE_AGRICULTURAL                  0x08CD
     563             : /** Camper/Caravan */
     564           1 : #define BT_APPEARANCE_VEHICLE_CAMPER_OR_CARAVAN             0x08CE
     565             : /** Recreational Vehicle/Motor Home */
     566           1 : #define BT_APPEARANCE_VEHICLE_RECREATIONAL                  0x08CF
     567             : /** Generic Domestic Appliance */
     568           1 : #define BT_APPEARANCE_GENERIC_DOMESTIC_APPLIANCE            0x0900
     569             : /** Refrigerator */
     570           1 : #define BT_APPEARANCE_APPLIANCE_REFRIGERATOR                0x0901
     571             : /** Freezer */
     572           1 : #define BT_APPEARANCE_APPLIANCE_FREEZER                     0x0902
     573             : /** Oven */
     574           1 : #define BT_APPEARANCE_APPLIANCE_OVEN                        0x0903
     575             : /** Microwave */
     576           1 : #define BT_APPEARANCE_APPLIANCE_MICROWAVE                   0x0904
     577             : /** Toaster */
     578           1 : #define BT_APPEARANCE_APPLIANCE_TOASTER                     0x0905
     579             : /** Washing Machine */
     580           1 : #define BT_APPEARANCE_APPLIANCE_WASHING_MACHINE             0x0906
     581             : /** Dryer */
     582           1 : #define BT_APPEARANCE_APPLIANCE_DRYER                       0x0907
     583             : /** Coffee maker */
     584           1 : #define BT_APPEARANCE_APPLIANCE_COFFEE_MAKER                0x0908
     585             : /** Clothes iron */
     586           1 : #define BT_APPEARANCE_APPLIANCE_CLOTHES_IRON                0x0909
     587             : /** Curling iron */
     588           1 : #define BT_APPEARANCE_APPLIANCE_CURLING_IRON                0x090A
     589             : /** Hair dryer */
     590           1 : #define BT_APPEARANCE_APPLIANCE_HAIR_DRYER                  0x090B
     591             : /** Vacuum cleaner */
     592           1 : #define BT_APPEARANCE_APPLIANCE_VACUUM_CLEANER              0x090C
     593             : /** Robotic vacuum cleaner */
     594           1 : #define BT_APPEARANCE_APPLIANCE_ROBOTIC_VACUUM_CLEANER      0x090D
     595             : /** Rice cooker */
     596           1 : #define BT_APPEARANCE_APPLIANCE_RICE_COOKER                 0x090E
     597             : /** Clothes steamer */
     598           1 : #define BT_APPEARANCE_APPLIANCE_CLOTHES_STEAMER             0x090F
     599             : /** Generic Wearable Audio Device */
     600           1 : #define BT_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE         0x0940
     601             : /** Earbud */
     602           1 : #define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD          0x0941
     603             : /** Headset */
     604           1 : #define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET         0x0942
     605             : /** Headphones */
     606           1 : #define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES      0x0943
     607             : /** Neck Band */
     608           1 : #define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND       0x0944
     609             : /** Generic Aircraft */
     610           1 : #define BT_APPEARANCE_GENERIC_AIRCRAFT                      0x0980
     611             : /** Light Aircraft */
     612           1 : #define BT_APPEARANCE_AIRCRAFT_LIGHT                        0x0981
     613             : /** Microlight */
     614           1 : #define BT_APPEARANCE_AIRCRAFT_MICROLIGHT                   0x0982
     615             : /** Paraglider */
     616           1 : #define BT_APPEARANCE_AIRCRAFT_PARAGLIDER                   0x0983
     617             : /** Large Passenger Aircraft */
     618           1 : #define BT_APPEARANCE_AIRCRAFT_LARGE_PASSENGER              0x0984
     619             : /** Generic AV Equipment */
     620           1 : #define BT_APPEARANCE_GENERIC_AV_EQUIPMENT                  0x09C0
     621             : /** Amplifier */
     622           1 : #define BT_APPEARANCE_AV_EQUIPMENT_AMPLIFIER                0x09C1
     623             : /** Receiver */
     624           1 : #define BT_APPEARANCE_AV_EQUIPMENT_RECEIVER                 0x09C2
     625             : /** Radio */
     626           1 : #define BT_APPEARANCE_AV_EQUIPMENT_RADIO                    0x09C3
     627             : /** Tuner */
     628           1 : #define BT_APPEARANCE_AV_EQUIPMENT_TUNER                    0x09C4
     629             : /** Turntable */
     630           1 : #define BT_APPEARANCE_AV_EQUIPMENT_TURNTABLE                0x09C5
     631             : /** CD Player */
     632           1 : #define BT_APPEARANCE_AV_EQUIPMENT_CD_PLAYER                0x09C6
     633             : /** DVD Player */
     634           1 : #define BT_APPEARANCE_AV_EQUIPMENT_DVD_PLAYER               0x09C7
     635             : /** Bluray Player */
     636           1 : #define BT_APPEARANCE_AV_EQUIPMENT_BLURAY_PLAYER            0x09C8
     637             : /** Optical Disc Player */
     638           1 : #define BT_APPEARANCE_AV_EQUIPMENT_OPTICAL_DISC_PLAYER      0x09C9
     639             : /** Set-Top Box */
     640           1 : #define BT_APPEARANCE_AV_EQUIPMENT_SET_TOP_BOX              0x09CA
     641             : /** Generic Display Equipment */
     642           1 : #define BT_APPEARANCE_GENERIC_DISPLAY_EQUIPMENT             0x0A00
     643             : /** Television */
     644           1 : #define BT_APPEARANCE_DISPLAY_EQUIPMENT_TELEVISION          0x0A01
     645             : /** Monitor */
     646           1 : #define BT_APPEARANCE_DISPLAY_EQUIPMENT_MONITOR             0x0A02
     647             : /** Projector */
     648           1 : #define BT_APPEARANCE_DISPLAY_EQUIPMENT_PROJECTOR           0x0A03
     649             : /** Generic Hearing aid */
     650           1 : #define BT_APPEARANCE_GENERIC_HEARING_AID                   0x0A40
     651             : /** In-ear hearing aid */
     652           1 : #define BT_APPEARANCE_HEARING_AID_IN_EAR                    0x0A41
     653             : /** Behind-ear hearing aid */
     654           1 : #define BT_APPEARANCE_HEARING_AID_BEHIND_EAR                0x0A42
     655             : /** Cochlear Implant */
     656           1 : #define BT_APPEARANCE_HEARING_AID_COCHLEAR_IMPLANT          0x0A43
     657             : /** Generic Gaming */
     658           1 : #define BT_APPEARANCE_GENERIC_GAMING                        0x0A80
     659             : /** Home Video Game Console */
     660           1 : #define BT_APPEARANCE_HOME_VIDEO_GAME_CONSOLE               0x0A81
     661             : /** Portable handheld console */
     662           1 : #define BT_APPEARANCE_PORTABLE_HANDHELD_CONSOLE             0x0A82
     663             : /** Generic Signage */
     664           1 : #define BT_APPEARANCE_GENERIC_SIGNAGE                       0x0AC0
     665             : /** Digital Signage */
     666           1 : #define BT_APPEARANCE_SIGNAGE_DIGITAL                       0x0AC1
     667             : /** Electronic Label */
     668           1 : #define BT_APPEARANCE_SIGNAGE_ELECTRONIC_LABEL              0x0AC2
     669             : /** Generic Pulse Oximeter */
     670           1 : #define BT_APPEARANCE_GENERIC_PULSE_OXIMETER                0x0C40
     671             : /** Fingertip Pulse Oximeter */
     672           1 : #define BT_APPEARANCE_PULSE_OXIMETER_FINGERTIP              0x0C41
     673             : /** Wrist Worn Pulse Oximeter */
     674           1 : #define BT_APPEARANCE_PULSE_OXIMETER_WRIST                  0x0C42
     675             : /** Generic Weight Scale */
     676           1 : #define BT_APPEARANCE_GENERIC_WEIGHT_SCALE                  0x0C80
     677             : /** Generic Personal Mobility Device */
     678           1 : #define BT_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE      0x0CC0
     679             : /** Powered Wheelchair */
     680           1 : #define BT_APPEARANCE_MOBILITY_POWERED_WHEELCHAIR           0x0CC1
     681             : /** Mobility Scooter */
     682           1 : #define BT_APPEARANCE_MOBILITY_SCOOTER                      0x0CC2
     683             : /** Continuous Glucose Monitor */
     684           1 : #define BT_APPEARANCE_CONTINUOUS_GLUCOSE_MONITOR            0x0D00
     685             : /** Generic Insulin Pump */
     686           1 : #define BT_APPEARANCE_GENERIC_INSULIN_PUMP                  0x0D40
     687             : /** Insulin Pump, durable pump */
     688           1 : #define BT_APPEARANCE_INSULIN_PUMP_DURABLE                  0x0D41
     689             : /** Insulin Pump, patch pump */
     690           1 : #define BT_APPEARANCE_INSULIN_PUMP_PATCH                    0x0D44
     691             : /** Insulin Pen */
     692           1 : #define BT_APPEARANCE_INSULIN_PEN                           0x0D48
     693             : /** Generic Medication Delivery */
     694           1 : #define BT_APPEARANCE_GENERIC_MEDICATION_DELIVERY           0x0D80
     695             : /** Generic Spirometer */
     696           1 : #define BT_APPEARANCE_GENERIC_SPIROMETER                    0x0DC0
     697             : /** Handheld Spirometer */
     698           1 : #define BT_APPEARANCE_SPIROMETER_HANDHELD                   0x0DC1
     699             : /** Generic Outdoor Sports Activity */
     700           1 : #define BT_APPEARANCE_GENERIC_OUTDOOR_SPORTS                0x1440
     701             : /** Location Display */
     702           1 : #define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION               0x1441
     703             : /** Location and Navigation Display */
     704           1 : #define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV       0x1442
     705             : /** Location Pod */
     706           1 : #define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD           0x1443
     707             : /** Location and Navigation Pod */
     708           1 : #define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV   0x1444
     709             : /**
     710             :  * @}
     711             :  */
     712             : 
     713             : /**
     714             :  * @name Defined GAP timers
     715             :  * @{
     716             :  */
     717           0 : #define BT_GAP_SCAN_FAST_INTERVAL_MIN           0x0030  /* 30 ms    */
     718           0 : #define BT_GAP_SCAN_FAST_INTERVAL               0x0060  /* 60 ms    */
     719           0 : #define BT_GAP_SCAN_FAST_WINDOW                 0x0030  /* 30 ms    */
     720           0 : #define BT_GAP_SCAN_SLOW_INTERVAL_1             0x0800  /* 1.28 s   */
     721           0 : #define BT_GAP_SCAN_SLOW_WINDOW_1               0x0012  /* 11.25 ms */
     722           0 : #define BT_GAP_SCAN_SLOW_INTERVAL_2             0x1000  /* 2.56 s   */
     723           0 : #define BT_GAP_SCAN_SLOW_WINDOW_2               0x0012  /* 11.25 ms */
     724           0 : #define BT_GAP_ADV_FAST_INT_MIN_1               0x0030  /* 30 ms    */
     725           0 : #define BT_GAP_ADV_FAST_INT_MAX_1               0x0060  /* 60 ms    */
     726           0 : #define BT_GAP_ADV_FAST_INT_MIN_2               0x00a0  /* 100 ms   */
     727           0 : #define BT_GAP_ADV_FAST_INT_MAX_2               0x00f0  /* 150 ms   */
     728           0 : #define BT_GAP_ADV_SLOW_INT_MIN                 0x0640  /* 1 s      */
     729           0 : #define BT_GAP_ADV_SLOW_INT_MAX                 0x0780  /* 1.2 s    */
     730           0 : #define BT_GAP_PER_ADV_FAST_INT_MIN_1           0x0018  /* 30 ms    */
     731           0 : #define BT_GAP_PER_ADV_FAST_INT_MAX_1           0x0030  /* 60 ms    */
     732           0 : #define BT_GAP_PER_ADV_FAST_INT_MIN_2           0x0050  /* 100 ms   */
     733           0 : #define BT_GAP_PER_ADV_FAST_INT_MAX_2           0x0078  /* 150 ms   */
     734           0 : #define BT_GAP_PER_ADV_SLOW_INT_MIN             0x0320  /* 1 s      */
     735           0 : #define BT_GAP_PER_ADV_SLOW_INT_MAX             0x03C0  /* 1.2 s    */
     736           0 : #define BT_GAP_INIT_CONN_INT_MIN                0x0018  /* 30 ms    */
     737           0 : #define BT_GAP_INIT_CONN_INT_MAX                0x0028  /* 50 ms    */
     738             : /**
     739             :  * @}
     740             :  */
     741             : 
     742             : /** LE PHY types */
     743           1 : enum {
     744             :         /** Convenience macro for when no PHY is set. */
     745             :         BT_GAP_LE_PHY_NONE                    = 0,
     746             :         /** LE 1M PHY */
     747             :         BT_GAP_LE_PHY_1M                      = BIT(0),
     748             :          /** LE 2M PHY */
     749             :         BT_GAP_LE_PHY_2M                      = BIT(1),
     750             :         /** LE Coded PHY */
     751             :         BT_GAP_LE_PHY_CODED                   = BIT(2),
     752             : };
     753             : 
     754             : /** Advertising PDU types */
     755           1 : enum {
     756             :         /** Scannable and connectable advertising. */
     757             :         BT_GAP_ADV_TYPE_ADV_IND               = 0x00,
     758             :         /** Directed connectable advertising. */
     759             :         BT_GAP_ADV_TYPE_ADV_DIRECT_IND        = 0x01,
     760             :         /** Non-connectable and scannable advertising. */
     761             :         BT_GAP_ADV_TYPE_ADV_SCAN_IND          = 0x02,
     762             :         /** Non-connectable and non-scannable advertising. */
     763             :         BT_GAP_ADV_TYPE_ADV_NONCONN_IND       = 0x03,
     764             :         /** Additional advertising data requested by an active scanner. */
     765             :         BT_GAP_ADV_TYPE_SCAN_RSP              = 0x04,
     766             :         /** Extended advertising, see advertising properties. */
     767             :         BT_GAP_ADV_TYPE_EXT_ADV               = 0x05,
     768             : };
     769             : 
     770             : /** Advertising PDU properties */
     771           1 : enum {
     772             :         /** Connectable advertising. */
     773             :         BT_GAP_ADV_PROP_CONNECTABLE           = BIT(0),
     774             :         /** Scannable advertising. */
     775             :         BT_GAP_ADV_PROP_SCANNABLE             = BIT(1),
     776             :         /** Directed advertising. */
     777             :         BT_GAP_ADV_PROP_DIRECTED              = BIT(2),
     778             :         /** Additional advertising data requested by an active scanner. */
     779             :         BT_GAP_ADV_PROP_SCAN_RESPONSE         = BIT(3),
     780             :         /** Extended advertising. */
     781             :         BT_GAP_ADV_PROP_EXT_ADV               = BIT(4),
     782             : };
     783             : 
     784             : /** Maximum advertising data length. */
     785           1 : #define BT_GAP_ADV_MAX_ADV_DATA_LEN             31
     786             : /** Maximum extended advertising data length.
     787             :  *
     788             :  *  @note The maximum advertising data length that can be sent by an extended
     789             :  *        advertiser is defined by the controller.
     790             :  */
     791           1 : #define BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN         1650
     792             : 
     793           0 : #define BT_GAP_TX_POWER_INVALID                 0x7f
     794           0 : #define BT_GAP_RSSI_INVALID                     0x7f
     795           0 : #define BT_GAP_SID_INVALID                      0xff
     796           0 : #define BT_GAP_NO_TIMEOUT                       0x0000
     797             : 
     798             : /* The maximum allowed high duty cycle directed advertising timeout, 1.28
     799             :  * seconds in 10 ms unit.
     800             :  */
     801           0 : #define BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT  128
     802             : 
     803             : /** Default data length */
     804           1 : #define BT_GAP_DATA_LEN_DEFAULT                 0x001b /* 27 bytes */
     805             : /** Maximum data length */
     806           1 : #define BT_GAP_DATA_LEN_MAX                     0x00fb /* 251 bytes */
     807             : 
     808             : /** Default data time */
     809           1 : #define BT_GAP_DATA_TIME_DEFAULT                0x0148 /* 328 us */
     810             : /** Maximum data time */
     811           1 : #define BT_GAP_DATA_TIME_MAX                    0x4290 /* 17040 us */
     812             : 
     813             : /** Maximum advertising set number */
     814           1 : #define BT_GAP_SID_MAX                          0x0F
     815             : /** Maximum number of consecutive periodic advertisement events that can be
     816             :  *  skipped after a successful receive.
     817             :  */
     818           1 : #define BT_GAP_PER_ADV_MAX_SKIP                 0x01F3
     819             : /** Minimum Periodic Advertising Timeout (N * 10 ms) */
     820           1 : #define BT_GAP_PER_ADV_MIN_TIMEOUT              0x000A /* 100 ms */
     821             : /** Maximum Periodic Advertising Timeout (N * 10 ms) */
     822           1 : #define BT_GAP_PER_ADV_MAX_TIMEOUT              0x4000 /* 163.84 s */
     823             : /** Minimum Periodic Advertising Interval (N * 1.25 ms) */
     824           1 : #define BT_GAP_PER_ADV_MIN_INTERVAL             0x0006 /* 7.5 ms */
     825             : /** Maximum Periodic Advertising Interval (N * 1.25 ms) */
     826           1 : #define BT_GAP_PER_ADV_MAX_INTERVAL             0xFFFF /* 81.91875 s */
     827             : 
     828             : /**
     829             :  * @brief Convert periodic advertising interval (N * 0.625 ms) to microseconds
     830             :  *
     831             :  * Value range of @p _interval is @ref BT_LE_ADV_INTERVAL_MIN to @ref BT_LE_ADV_INTERVAL_MAX
     832             :  */
     833           1 : #define BT_GAP_ADV_INTERVAL_TO_US(_interval) ((uint32_t)((_interval) * 625U))
     834             : 
     835             : /**
     836             :  * @brief Convert periodic advertising interval (N * 0.625 ms) to milliseconds
     837             :  *
     838             :  * Value range of @p _interval is @ref BT_LE_ADV_INTERVAL_MIN to @ref BT_LE_ADV_INTERVAL_MAX
     839             :  *
     840             :  * @note When intervals cannot be represented in milliseconds, this will round down.
     841             :  * For example BT_GAP_ADV_INTERVAL_TO_MS(0x0021) will become 20 ms instead of 20.625 ms
     842             :  */
     843           1 : #define BT_GAP_ADV_INTERVAL_TO_MS(_interval) (BT_GAP_ADV_INTERVAL_TO_US(_interval) / USEC_PER_MSEC)
     844             : 
     845             : /**
     846             :  * @brief Convert isochronous interval (N * 1.25 ms) to microseconds
     847             :  *
     848             :  * Value range of @p _interval is @ref BT_HCI_ISO_INTERVAL_MIN to @ref BT_HCI_ISO_INTERVAL_MAX
     849             :  */
     850           1 : #define BT_GAP_ISO_INTERVAL_TO_US(_interval) ((uint32_t)((_interval) * 1250U))
     851             : 
     852             : /**
     853             :  * @brief Convert isochronous interval (N * 1.25 ms) to milliseconds
     854             :  *
     855             :  * Value range of @p _interval is @ref BT_HCI_ISO_INTERVAL_MIN to @ref BT_HCI_ISO_INTERVAL_MAX
     856             :  *
     857             :  * @note When intervals cannot be represented in milliseconds, this will round down.
     858             :  * For example BT_GAP_ISO_INTERVAL_TO_MS(0x0005) will become 6 ms instead of 6.25 ms
     859             :  */
     860           1 : #define BT_GAP_ISO_INTERVAL_TO_MS(_interval) (BT_GAP_ISO_INTERVAL_TO_US(_interval) / USEC_PER_MSEC)
     861             : 
     862             : /** @brief Convert periodic advertising interval (N * 1.25 ms) to microseconds *
     863             :  *
     864             :  * Value range of @p _interval is @ref BT_HCI_LE_PER_ADV_INTERVAL_MIN to @ref
     865             :  * BT_HCI_LE_PER_ADV_INTERVAL_MAX
     866             :  */
     867           1 : #define BT_GAP_PER_ADV_INTERVAL_TO_US(_interval) ((uint32_t)((_interval) * 1250U))
     868             : 
     869             : /**
     870             :  * @brief Convert periodic advertising interval (N * 1.25 ms) to milliseconds
     871             :  *
     872             :  * @note When intervals cannot be represented in milliseconds, this will round down.
     873             :  * For example BT_GAP_PER_ADV_INTERVAL_TO_MS(0x0009) will become 11 ms instead of 11.25 ms
     874             :  */
     875           1 : #define BT_GAP_PER_ADV_INTERVAL_TO_MS(_interval)                                                   \
     876             :         (BT_GAP_PER_ADV_INTERVAL_TO_US(_interval) / USEC_PER_MSEC)
     877             : 
     878             : /**
     879             :  * @brief Convert microseconds to advertising interval units (0.625 ms)
     880             :  *
     881             :  * Value range of @p _interval is 20000 to 1024000
     882             :  *
     883             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     884             :  * For example BT_GAP_US_TO_ADV_INTERVAL(21000) will become 20625 microseconds
     885             :  */
     886           1 : #define BT_GAP_US_TO_ADV_INTERVAL(_interval) ((uint16_t)((_interval) / 625U))
     887             : 
     888             : /**
     889             :  * @brief Convert milliseconds to advertising interval units (0.625 ms)
     890             :  *
     891             :  * Value range of @p _interval is 20 to 1024
     892             :  *
     893             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     894             :  * For example BT_GAP_MS_TO_ADV_INTERVAL(21) will become 20.625 milliseconds
     895             :  */
     896           1 : #define BT_GAP_MS_TO_ADV_INTERVAL(_interval)                                                       \
     897             :         (BT_GAP_US_TO_ADV_INTERVAL((_interval) * USEC_PER_MSEC))
     898             : 
     899             : /**
     900             :  * @brief Convert microseconds to periodic advertising interval units (1.25 ms)
     901             :  *
     902             :  * Value range of @p _interval is 7500 to 81918750
     903             :  *
     904             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     905             :  * For example BT_GAP_US_TO_PER_ADV_INTERVAL(11000) will become 10000 microseconds
     906             :  */
     907           1 : #define BT_GAP_US_TO_PER_ADV_INTERVAL(_interval) ((uint16_t)((_interval) / 1250U))
     908             : 
     909             : /**
     910             :  * @brief Convert milliseconds to periodic advertising interval units (1.25 ms)
     911             :  *
     912             :  * Value range of @p _interval is 7.5 to 81918.75
     913             :  *
     914             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     915             :  * For example BT_GAP_MS_TO_PER_ADV_INTERVAL(11) will become 10 milliseconds
     916             :  */
     917           1 : #define BT_GAP_MS_TO_PER_ADV_INTERVAL(_interval)                                                   \
     918             :         (BT_GAP_US_TO_PER_ADV_INTERVAL((_interval) * USEC_PER_MSEC))
     919             : 
     920             : /**
     921             :  * @brief Convert milliseconds to periodic advertising sync timeout units (10 ms)
     922             :  *
     923             :  * Value range of @p _timeout is 100 to 163840
     924             :  *
     925             :  * @note If @p _timeout is not a multiple of the unit, it will round down to nearest.
     926             :  * For example BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(4005) will become 4000 milliseconds
     927             :  */
     928           1 : #define BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(_timeout) ((uint16_t)((_timeout) / 10U))
     929             : 
     930             : /**
     931             :  * @brief Convert microseconds to periodic advertising sync timeout units (10 ms)
     932             :  *
     933             :  * Value range of @p _timeout is 100000 to 163840000
     934             :  *
     935             :  * @note If @p _timeout is not a multiple of the unit, it will round down to nearest.
     936             :  * For example BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(4005000) will become 4000000 microseconds
     937             :  */
     938           1 : #define BT_GAP_US_TO_PER_ADV_SYNC_TIMEOUT(_timeout)                                                \
     939             :         (BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT((_timeout) / USEC_PER_MSEC))
     940             : 
     941             : /**
     942             :  * @brief Convert microseconds to scan interval units (0.625 ms)
     943             :  *
     944             :  * Value range of @p _interval is 2500 to 40959375 if @kconfig{CONFIG_BT_EXT_ADV} else
     945             :  * 2500 to 10240000
     946             :  *
     947             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     948             :  * For example BT_GAP_US_TO_SCAN_INTERVAL(21000) will become 20625 microseconds
     949             :  */
     950           1 : #define BT_GAP_US_TO_SCAN_INTERVAL(_interval) ((uint16_t)((_interval) / 625U))
     951             : 
     952             : /**
     953             :  * @brief Convert milliseconds to scan interval units (0.625 ms)
     954             :  *
     955             :  * Value range of @p _interval is 2.5 to 40959.375 if @kconfig{CONFIG_BT_EXT_ADV} else
     956             :  * 2500 to 10240
     957             :  *
     958             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     959             :  * For example BT_GAP_MS_TO_SCAN_INTERVAL(21) will become 20.625 milliseconds
     960             :  */
     961           1 : #define BT_GAP_MS_TO_SCAN_INTERVAL(_interval)                                                      \
     962             :         (BT_GAP_US_TO_SCAN_INTERVAL((_interval) * USEC_PER_MSEC))
     963             : 
     964             : /**
     965             :  * @brief Convert microseconds to scan window units (0.625 ms)
     966             :  *
     967             :  * Value range of @p _window is 2500 to 40959375 if @kconfig{CONFIG_BT_EXT_ADV} else
     968             :  * 2500 to 10240000
     969             :  *
     970             :  * @note If @p _window is not a multiple of the unit, it will round down to nearest.
     971             :  * For example BT_GAP_US_TO_SCAN_WINDOW(21000) will become 20625 microseconds
     972             :  */
     973           1 : #define BT_GAP_US_TO_SCAN_WINDOW(_window) ((uint16_t)((_window) / 625U))
     974             : 
     975             : /**
     976             :  * @brief Convert milliseconds to scan window units (0.625 ms)
     977             :  *
     978             :  * Value range of @p _window is 2.5 to 40959.375 if @kconfig{CONFIG_BT_EXT_ADV} else
     979             :  * 2500 to 10240
     980             :  *
     981             :  * @note If @p _window is not a multiple of the unit, it will round down to nearest.
     982             :  * For example BT_GAP_MS_TO_SCAN_WINDOW(21) will become 20.625 milliseconds
     983             :  */
     984           1 : #define BT_GAP_MS_TO_SCAN_WINDOW(_window) (BT_GAP_US_TO_SCAN_WINDOW((_window) * USEC_PER_MSEC))
     985             : 
     986             : /**
     987             :  * @brief Convert microseconds to connection interval units (1.25 ms)
     988             :  *
     989             :  * Value range of @p _interval is 7500 to 4000000
     990             :  *
     991             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
     992             :  * For example BT_GAP_US_TO_CONN_INTERVAL(21000) will become 20000 microseconds
     993             :  */
     994           1 : #define BT_GAP_US_TO_CONN_INTERVAL(_interval) ((uint16_t)((_interval) / 1250U))
     995             : 
     996             : /**
     997             :  * @brief Convert milliseconds to connection interval units (1.25 ms)
     998             :  *
     999             :  * Value range of @p _interval is 7.5 to 4000
    1000             :  *
    1001             :  * @note If @p _interval is not a multiple of the unit, it will round down to nearest.
    1002             :  * For example BT_GAP_MS_TO_CONN_INTERVAL(21) will become 20 milliseconds
    1003             :  */
    1004           1 : #define BT_GAP_MS_TO_CONN_INTERVAL(_interval)                                                      \
    1005             :         (BT_GAP_US_TO_CONN_INTERVAL((_interval) * USEC_PER_MSEC))
    1006             : 
    1007             : /**
    1008             :  * @brief Convert milliseconds to connection supervision timeout units (10 ms)
    1009             :  *
    1010             :  * Value range of @p _timeout is 100 to 32000
    1011             :  *
    1012             :  * @note If @p _timeout is not a multiple of the unit, it will round down to nearest.
    1013             :  * For example BT_GAP_MS_TO_CONN_TIMEOUT(4005) will become 4000 milliseconds
    1014             :  */
    1015           1 : #define BT_GAP_MS_TO_CONN_TIMEOUT(_timeout) ((uint16_t)((_timeout) / 10U))
    1016             : 
    1017             : /**
    1018             :  * @brief Convert microseconds to connection supervision timeout units (10 ms)
    1019             : 
    1020             :  * Value range of @p _timeout is 100000 to 32000000
    1021             :  *
    1022             :  * @note If @p _timeout is not a multiple of the unit, it will round down to nearest.
    1023             :  * For example BT_GAP_MS_TO_CONN_TIMEOUT(4005000) will become 4000000 microseconds
    1024             :  */
    1025           1 : #define BT_GAP_US_TO_CONN_TIMEOUT(_timeout) (BT_GAP_MS_TO_CONN_TIMEOUT((_timeout) / USEC_PER_MSEC))
    1026             : 
    1027             : /**
    1028             :  * @brief Convert milliseconds to connection event length units (0.625)
    1029             :  *
    1030             :  * Value range of @p _event_len is 0 to 40959375
    1031             :  *
    1032             :  * @note If @p _event_len is not a multiple of the unit, it will round down to nearest.
    1033             :  * For example BT_GAP_US_TO_CONN_EVENT_LEN(21000) will become 20625 milliseconds
    1034             :  */
    1035           1 : #define BT_GAP_US_TO_CONN_EVENT_LEN(_event_len) ((uint16_t)((_event_len) / 625U))
    1036             : 
    1037             : /**
    1038             :  * @brief Convert milliseconds to connection event length units (0.625)
    1039             :  *
    1040             :  * Value range of @p _event_len is 0 to 40959.375
    1041             :  *
    1042             :  * @note If @p _event_len is not a multiple of the unit, it will round down to nearest.
    1043             :  * For example BT_GAP_MS_TO_CONN_EVENT_LEN(21) will become 20.625 milliseconds
    1044             :  */
    1045           1 : #define BT_GAP_MS_TO_CONN_EVENT_LEN(_event_len)                                                    \
    1046             :         (BT_GAP_US_TO_CONN_EVENT_LEN((_event_len) * USEC_PER_MSEC))
    1047             : 
    1048             : /** Constant Tone Extension (CTE) types */
    1049           1 : enum {
    1050             :         /** Angle of Arrival */
    1051             :         BT_GAP_CTE_AOA = 0x00,
    1052             :         /** Angle of Departure with 1 us slots */
    1053             :         BT_GAP_CTE_AOD_1US = 0x01,
    1054             :         /** Angle of Departure with 2 us slots */
    1055             :         BT_GAP_CTE_AOD_2US = 0x02,
    1056             :         /** No extensions */
    1057             :         BT_GAP_CTE_NONE = 0xFF,
    1058             : };
    1059             : 
    1060             : /** @brief Peripheral sleep clock accuracy (SCA) in ppm (parts per million) */
    1061           1 : enum {
    1062             :         BT_GAP_SCA_UNKNOWN = 0,   /**< Unknown */
    1063             :         BT_GAP_SCA_251_500 = 0,   /**< 251 ppm to 500 ppm */
    1064             :         BT_GAP_SCA_151_250 = 1,   /**< 151 ppm to 250 ppm */
    1065             :         BT_GAP_SCA_101_150 = 2,   /**< 101 ppm to 150 ppm */
    1066             :         BT_GAP_SCA_76_100 = 3,    /**< 76 ppm to 100 ppm */
    1067             :         BT_GAP_SCA_51_75 = 4,     /**< 51 ppm to 75 ppm */
    1068             :         BT_GAP_SCA_31_50 = 5,     /**< 31 ppm to 50 ppm */
    1069             :         BT_GAP_SCA_21_30 = 6,     /**< 21 ppm to 30 ppm */
    1070             :         BT_GAP_SCA_0_20 = 7,      /**< 0 ppm to 20 ppm */
    1071             : };
    1072             : 
    1073             : /**
    1074             :  * @brief Encode 40 least significant bits of 64-bit LE Supported Features into array values
    1075             :  *        in little-endian format.
    1076             :  *
    1077             :  * Helper macro to encode 40 least significant bits of 64-bit LE Supported Features value into
    1078             :  * advertising data. The number of bits that are encoded is a number of LE Supported Features
    1079             :  * defined by BT 5.3 Core specification.
    1080             :  *
    1081             :  * Example of how to encode the `0x000000DFF00DF00D` into advertising data.
    1082             :  *
    1083             :  * @code
    1084             :  * BT_DATA_BYTES(BT_DATA_LE_SUPPORTED_FEATURES, BT_LE_SUPP_FEAT_40_ENCODE(0x000000DFF00DF00D))
    1085             :  * @endcode
    1086             :  *
    1087             :  * @param w64 LE Supported Features value (64-bits)
    1088             :  *
    1089             :  * @return The comma separated values for LE Supported Features value that
    1090             :  *         may be used directly as an argument for @ref BT_DATA_BYTES.
    1091             :  */
    1092           1 : #define BT_LE_SUPP_FEAT_40_ENCODE(w64) BT_BYTES_LIST_LE40(w64)
    1093             : 
    1094             : /** @brief Encode 4 least significant bytes of 64-bit LE Supported Features into
    1095             :  *         4 bytes long array of values in little-endian format.
    1096             :  *
    1097             :  *  Helper macro to encode 64-bit LE Supported Features value into advertising
    1098             :  *  data. The macro encodes 4 least significant bytes into advertising data.
    1099             :  *  Other 4 bytes are not encoded.
    1100             :  *
    1101             :  *  Example of how to encode the `0x000000DFF00DF00D` into advertising data.
    1102             :  *
    1103             :  *  @code
    1104             :  *  BT_DATA_BYTES(BT_DATA_LE_SUPPORTED_FEATURES, BT_LE_SUPP_FEAT_32_ENCODE(0x000000DFF00DF00D))
    1105             :  *  @endcode
    1106             :  *
    1107             :  * @param w64 LE Supported Features value (64-bits)
    1108             :  *
    1109             :  * @return The comma separated values for LE Supported Features value that
    1110             :  *         may be used directly as an argument for @ref BT_DATA_BYTES.
    1111             :  */
    1112           1 : #define BT_LE_SUPP_FEAT_32_ENCODE(w64) BT_BYTES_LIST_LE32(w64)
    1113             : 
    1114             : /**
    1115             :  * @brief Encode 3 least significant bytes of 64-bit LE Supported Features into
    1116             :  *        3 bytes long array of values in little-endian format.
    1117             :  *
    1118             :  * Helper macro to encode 64-bit LE Supported Features value into advertising
    1119             :  * data. The macro encodes 3 least significant bytes into advertising data.
    1120             :  * Other 5 bytes are not encoded.
    1121             :  *
    1122             :  * Example of how to encode the `0x000000DFF00DF00D` into advertising data.
    1123             :  *
    1124             :  * @code
    1125             :  * BT_DATA_BYTES(BT_DATA_LE_SUPPORTED_FEATURES, BT_LE_SUPP_FEAT_24_ENCODE(0x000000DFF00DF00D))
    1126             :  * @endcode
    1127             :  *
    1128             :  * @param w64 LE Supported Features value (64-bits)
    1129             :  *
    1130             :  * @return The comma separated values for LE Supported Features value that
    1131             :  *         may be used directly as an argument for @ref BT_DATA_BYTES.
    1132             :  */
    1133           1 : #define BT_LE_SUPP_FEAT_24_ENCODE(w64) BT_BYTES_LIST_LE24(w64)
    1134             : 
    1135             : /**
    1136             :  * @brief Encode 2 least significant bytes of 64-bit LE Supported Features into
    1137             :  *        2 bytes long array of values in little-endian format.
    1138             :  *
    1139             :  * Helper macro to encode 64-bit LE Supported Features value into advertising
    1140             :  * data. The macro encodes 3 least significant bytes into advertising data.
    1141             :  * Other 6 bytes are not encoded.
    1142             :  *
    1143             :  * Example of how to encode the `0x000000DFF00DF00D` into advertising data.
    1144             :  *
    1145             :  * @code
    1146             :  * BT_DATA_BYTES(BT_DATA_LE_SUPPORTED_FEATURES, BT_LE_SUPP_FEAT_16_ENCODE(0x000000DFF00DF00D))
    1147             :  * @endcode
    1148             :  *
    1149             :  * @param w64 LE Supported Features value (64-bits)
    1150             :  *
    1151             :  * @return The comma separated values for LE Supported Features value that
    1152             :  *         may be used directly as an argument for @ref BT_DATA_BYTES.
    1153             :  */
    1154           1 : #define BT_LE_SUPP_FEAT_16_ENCODE(w64) BT_BYTES_LIST_LE16(w64)
    1155             : 
    1156             : /**
    1157             :  * @brief Encode the least significant byte of 64-bit LE Supported Features into
    1158             :  *        single byte long array.
    1159             :  *
    1160             :  * Helper macro to encode 64-bit LE Supported Features value into advertising
    1161             :  * data. The macro encodes the least significant byte into advertising data.
    1162             :  * Other 7 bytes are not encoded.
    1163             :  *
    1164             :  * Example of how to encode the `0x000000DFF00DF00D` into advertising data.
    1165             :  *
    1166             :  * @code
    1167             :  * BT_DATA_BYTES(BT_DATA_LE_SUPPORTED_FEATURES, BT_LE_SUPP_FEAT_8_ENCODE(0x000000DFF00DF00D))
    1168             :  * @endcode
    1169             :  *
    1170             :  * @param w64 LE Supported Features value (64-bits)
    1171             :  *
    1172             :  * @return The value of least significant byte of LE Supported Features value
    1173             :  *         that may be used directly as an argument for @ref BT_DATA_BYTES.
    1174             :  */
    1175           1 : #define BT_LE_SUPP_FEAT_8_ENCODE(w64) \
    1176             :         (((w64) >> 0) & 0xFF)
    1177             : 
    1178             : /**
    1179             :  * @brief Validate whether LE Supported Features value does not use bits that are reserved for
    1180             :  *        future use.
    1181             :  *
    1182             :  * Helper macro to check if @p w64 has zeros as bits 40-63. The macro is compliant with BT 5.3
    1183             :  * Core Specification where bits 0-40 has assigned values. In case of invalid value, build time
    1184             :  * error is reported.
    1185             :  */
    1186           1 : #define BT_LE_SUPP_FEAT_VALIDATE(w64) \
    1187             :         BUILD_ASSERT(!((w64) & (~BIT64_MASK(40))), \
    1188             :                      "RFU bit in LE Supported Features are not zeros.")
    1189             : 
    1190             : /**
    1191             :  * @}
    1192             :  */
    1193             : 
    1194             : #ifdef __cplusplus
    1195             : }
    1196             : #endif
    1197             : 
    1198             : #endif /* ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ */

Generated by: LCOV version 1.14