Skip to content

Commit 47f5d1b

Browse files
HaavardReikartben
authored andcommitted
Bluetooth: docs: Add enum names to bt.h and gatt.h
Adds enum names to `bluetooth.h` and `gatt.h` to make them easier to reference. Adds Doxygen references where relevant. Signed-off-by: Håvard Reierstad <[email protected]>
1 parent 4fe9e01 commit 47f5d1b

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

include/zephyr/bluetooth/bluetooth.h

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ struct bt_le_local_features {
682682
int bt_le_get_local_features(struct bt_le_local_features *local_features);
683683

684684
/** Advertising options */
685-
enum advertising_options {
685+
enum bt_le_adv_opt {
686686
/** Convenience value when no options are specified. */
687687
BT_LE_ADV_OPT_NONE = 0,
688688

@@ -883,7 +883,7 @@ enum advertising_options {
883883
*
884884
* @note Cannot be set if BT_LE_ADV_OPT_CODED is set.
885885
*
886-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
886+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
887887
* set as @ref bt_le_adv_param.options.
888888
*/
889889
BT_LE_ADV_OPT_NO_2M = BIT(11),
@@ -896,23 +896,23 @@ enum advertising_options {
896896
* the trade-off of lower data rate and higher power consumption.
897897
* Connections will be established on LE Coded PHY.
898898
*
899-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
899+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
900900
* set as @ref bt_le_adv_param.options.
901901
*/
902902
BT_LE_ADV_OPT_CODED = BIT(12),
903903

904904
/**
905905
* @brief Advertise without a device address (identity address or RPA).
906906
*
907-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
907+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
908908
* set as @ref bt_le_adv_param.options.
909909
*/
910910
BT_LE_ADV_OPT_ANONYMOUS = BIT(13),
911911

912912
/**
913913
* @brief Advertise with transmit power.
914914
*
915-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
915+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
916916
* set as @ref bt_le_adv_param.options.
917917
*/
918918
BT_LE_ADV_OPT_USE_TX_POWER = BIT(14),
@@ -1005,7 +1005,7 @@ struct bt_le_adv_param {
10051005
/**
10061006
* @brief Advertising Set Identifier, valid range 0x00 - 0x0f.
10071007
*
1008-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
1008+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
10091009
*set as @ref bt_le_adv_param.options.
10101010
**/
10111011
uint8_t sid;
@@ -1016,12 +1016,12 @@ struct bt_le_adv_param {
10161016
* Maximum advertising events the advertiser can skip before it must
10171017
* send advertising data on the secondary advertising channel.
10181018
*
1019-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
1019+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
10201020
* set as @ref bt_le_adv_param.options.
10211021
*/
10221022
uint8_t secondary_max_skip;
10231023

1024-
/** @brief Bit-field of advertising options, see the @ref advertising_options field. */
1024+
/** @brief Bit-field of advertising options, see the @ref bt_le_adv_opt field. */
10251025
uint32_t options;
10261026

10271027
/**
@@ -1068,22 +1068,22 @@ struct bt_le_adv_param {
10681068

10691069

10701070
/** Periodic Advertising options */
1071-
enum {
1071+
enum bt_le_per_adv_opt {
10721072
/** Convenience value when no options are specified. */
10731073
BT_LE_PER_ADV_OPT_NONE = 0,
10741074

10751075
/**
10761076
* @brief Advertise with transmit power.
10771077
*
1078-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
1078+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
10791079
* set as @ref bt_le_adv_param.options.
10801080
*/
10811081
BT_LE_PER_ADV_OPT_USE_TX_POWER = BIT(1),
10821082

10831083
/**
10841084
* @brief Advertise with included AdvDataInfo (ADI).
10851085
*
1086-
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
1086+
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref bt_le_adv_opt field) to be
10871087
* set as @ref bt_le_adv_param.options.
10881088
*/
10891089
BT_LE_PER_ADV_OPT_INCLUDE_ADI = BIT(2),
@@ -1119,7 +1119,7 @@ struct bt_le_per_adv_param {
11191119
*/
11201120
uint16_t interval_max;
11211121

1122-
/** Bit-field of periodic advertising options, see the @ref advertising_options field. */
1122+
/** Bit-field of periodic advertising options, see the @ref bt_le_adv_opt field. */
11231123
uint32_t options;
11241124

11251125
#if defined(CONFIG_BT_PER_ADV_RSP)
@@ -1436,7 +1436,7 @@ struct bt_le_per_adv_param {
14361436
*
14371437
* @param _int_min Minimum periodic advertising interval, N * 0.625 milliseconds
14381438
* @param _int_max Maximum periodic advertising interval, N * 0.625 milliseconds
1439-
* @param _options Periodic advertising properties bitfield, see @ref advertising_options
1439+
* @param _options Periodic advertising properties bitfield, see @ref bt_le_adv_opt
14401440
* field.
14411441
*/
14421442
#define BT_LE_PER_ADV_PARAM_INIT(_int_min, _int_max, _options) \
@@ -1451,7 +1451,7 @@ struct bt_le_per_adv_param {
14511451
*
14521452
* @param _int_min Minimum periodic advertising interval, N * 0.625 milliseconds
14531453
* @param _int_max Maximum periodic advertising interval, N * 0.625 milliseconds
1454-
* @param _options Periodic advertising properties bitfield, see @ref advertising_options
1454+
* @param _options Periodic advertising properties bitfield, see @ref bt_le_adv_opt
14551455
* field.
14561456
*/
14571457
#define BT_LE_PER_ADV_PARAM(_int_min, _int_max, _options) \
@@ -2071,7 +2071,7 @@ struct bt_le_per_adv_sync_cb {
20712071
};
20722072

20732073
/** Periodic advertising sync options */
2074-
enum {
2074+
enum bt_le_per_adv_sync_opt {
20752075
/** Convenience value when no options are specified. */
20762076
BT_LE_PER_ADV_SYNC_OPT_NONE = 0,
20772077

@@ -2295,7 +2295,7 @@ int bt_le_per_adv_sync_recv_enable(struct bt_le_per_adv_sync *per_adv_sync);
22952295
int bt_le_per_adv_sync_recv_disable(struct bt_le_per_adv_sync *per_adv_sync);
22962296

22972297
/** Periodic Advertising Sync Transfer options */
2298-
enum {
2298+
enum bt_le_per_adv_sync_transfer_opt {
22992299
/** Convenience value when no options are specified. */
23002300
BT_LE_PER_ADV_SYNC_TRANSFER_OPT_NONE = 0,
23012301

@@ -2476,7 +2476,7 @@ int bt_le_per_adv_list_remove(const bt_addr_le_t *addr, uint8_t sid);
24762476
int bt_le_per_adv_list_clear(void);
24772477

24782478

2479-
enum {
2479+
enum bt_le_scan_opt {
24802480
/** Convenience value when no options are specified. */
24812481
BT_LE_SCAN_OPT_NONE = 0,
24822482

@@ -2497,7 +2497,7 @@ enum {
24972497
BT_LE_SCAN_OPT_NO_1M = BIT(3),
24982498
};
24992499

2500-
enum {
2500+
enum bt_le_scan_type {
25012501
/** Scan without requesting additional information from advertisers. */
25022502
BT_LE_SCAN_TYPE_PASSIVE = 0x00,
25032503

@@ -2513,7 +2513,7 @@ enum {
25132513

25142514
/** LE scan parameters */
25152515
struct bt_le_scan_param {
2516-
/** Scan type (BT_LE_SCAN_TYPE_ACTIVE or BT_LE_SCAN_TYPE_PASSIVE) */
2516+
/** Scan type. @ref BT_LE_SCAN_TYPE_ACTIVE or @ref BT_LE_SCAN_TYPE_PASSIVE. */
25172517
uint8_t type;
25182518

25192519
/** Bit-field of scanning options. */
@@ -2636,8 +2636,7 @@ struct bt_le_scan_cb {
26362636
/**
26372637
* @brief Initialize scan parameters
26382638
*
2639-
* @param _type Scan Type, BT_LE_SCAN_TYPE_ACTIVE or
2640-
* BT_LE_SCAN_TYPE_PASSIVE.
2639+
* @param _type Scan Type, @ref BT_LE_SCAN_TYPE_ACTIVE or @ref BT_LE_SCAN_TYPE_PASSIVE.
26412640
* @param _options Scan options
26422641
* @param _interval Scan Interval (N * 0.625 ms)
26432642
* @param _window Scan Window (N * 0.625 ms)
@@ -2656,8 +2655,7 @@ struct bt_le_scan_cb {
26562655
/**
26572656
* @brief Helper to declare scan parameters inline
26582657
*
2659-
* @param _type Scan Type, BT_LE_SCAN_TYPE_ACTIVE or
2660-
* BT_LE_SCAN_TYPE_PASSIVE.
2658+
* @param _type Scan Type, @ref BT_LE_SCAN_TYPE_ACTIVE or @ref BT_LE_SCAN_TYPE_PASSIVE.
26612659
* @param _options Scan options
26622660
* @param _interval Scan Interval (N * 0.625 ms)
26632661
* @param _window Scan Window (N * 0.625 ms)

include/zephyr/bluetooth/gatt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ bool bt_gatt_service_is_registered(const struct bt_gatt_service *svc);
683683
/** @brief to be used as return values for @ref bt_gatt_attr_func_t and @ref bt_gatt_read_func_t
684684
* type callbacks.
685685
*/
686-
enum {
686+
enum bt_gatt_iter {
687687
BT_GATT_ITER_STOP = 0,
688688
BT_GATT_ITER_CONTINUE,
689689
};

0 commit comments

Comments
 (0)