@@ -61,9 +61,9 @@ extern "C" {
61
61
*/
62
62
63
63
/**
64
- * Convenience macro for specifying the default identity. This helps
65
- * make the code more readable, especially when only one identity is
66
- * supported.
64
+ * Identity handle referring to the first identity address . This is a convenience macro for
65
+ * specifying the default identity address. This helps make the code more readable, especially when
66
+ * only one identity address is supported.
67
67
*/
68
68
#define BT_ID_DEFAULT 0
69
69
@@ -316,7 +316,7 @@ int bt_enable(bt_ready_cb_t cb);
316
316
*
317
317
* Disable Bluetooth. Can't be called before bt_enable has completed.
318
318
*
319
- * This API will clear all configured identities and keys that are not persistently
319
+ * This API will clear all configured identity addresses and keys that are not persistently
320
320
* stored with @kconfig{CONFIG_BT_SETTINGS}. These can be restored
321
321
* with settings_load() before reenabling the stack.
322
322
*
@@ -396,36 +396,35 @@ uint16_t bt_get_appearance(void);
396
396
int bt_set_appearance (uint16_t new_appearance );
397
397
398
398
/**
399
- * @brief Get the currently configured identities .
399
+ * @brief Get the currently configured identity addresses .
400
400
*
401
401
* Returns an array of the currently configured identity addresses. To
402
- * make sure all available identities can be retrieved, the number of
402
+ * make sure all available identity addresses can be retrieved, the number of
403
403
* elements in the @a addrs array should be CONFIG_BT_ID_MAX. The identity
404
- * identifier that some APIs expect (such as advertising parameters ) is
405
- * simply the index of the identity in the @a addrs array.
404
+ * handle that some APIs expect (such as @ref bt_le_adv_param ) is
405
+ * simply the index of the identity address in the @a addrs array.
406
406
*
407
- * If @a addrs is passed as NULL, then returned @a count contains the
408
- * count of all available identities that can be retrieved with a
407
+ * If @a addrs is passed as NULL, then the returned @a count contains the
408
+ * count of all available identity addresses that can be retrieved with a
409
409
* subsequent call to this function with non-NULL @a addrs parameter.
410
410
*
411
- * @note Deleted identities may show up as @ref BT_ADDR_LE_ANY in the returned
412
- * array.
411
+ * @note Deleted identity addresses may show up as @ref BT_ADDR_LE_ANY in the returned array.
413
412
*
414
- * @param addrs Array where to store the configured identities .
415
- * @param count Should be initialized to the array size. Once the function
416
- * returns it will contain the number of returned identities .
413
+ * @param addrs Array where to store the configured identity addresses .
414
+ * @param count Should be initialized to the array size. Once the function returns
415
+ * it will contain the number of returned identity addresses .
417
416
*/
418
417
void bt_id_get (bt_addr_le_t * addrs , size_t * count );
419
418
420
419
/**
421
- * @brief Create a new identity.
420
+ * @brief Create a new identity address .
422
421
*
423
- * Create a new identity using the given address and IRK. This function can be
424
- * called before calling bt_enable(). However, the new identity will only be
422
+ * Create a new identity address using the given address and IRK. This function can be
423
+ * called before calling bt_enable(). However, the new identity address will only be
425
424
* stored persistently in flash when this API is used after bt_enable(). The
426
425
* reason is that the persistent settings are loaded after bt_enable() and would
427
426
* therefore cause potential conflicts with the stack blindly overwriting what's
428
- * stored in flash. The identity will also not be written to flash in case a
427
+ * stored in flash. The identity address will also not be written to flash in case a
429
428
* pre-defined address is provided, since in such a situation the app clearly
430
429
* has some place it got the address from and will be able to repeat the
431
430
* procedure on every power cycle, i.e. it would be redundant to also store the
@@ -434,11 +433,11 @@ void bt_id_get(bt_addr_le_t *addrs, size_t *count);
434
433
* Generating random static address or random IRK is not supported when calling
435
434
* this function before bt_enable().
436
435
*
437
- * If the application wants to have the stack randomly generate identities
436
+ * If the application wants to have the stack randomly generate identity addresses
438
437
* and store them in flash for later recovery, the way to do it would be
439
438
* to first initialize the stack (using bt_enable), then call settings_load(),
440
- * and after that check with bt_id_get() how many identities were recovered.
441
- * If an insufficient amount of identities were recovered the app may then
439
+ * and after that check with bt_id_get() how many identity addresses were recovered.
440
+ * If an insufficient amount of identity addresses were recovered the app may then
442
441
* call bt_id_create() to create new ones.
443
442
*
444
443
* If supported by the HCI driver (indicated by setting
@@ -447,71 +446,66 @@ void bt_id_get(bt_addr_le_t *addrs, size_t *count);
447
446
* before calling bt_enable(). Subsequent calls always add/generate random
448
447
* static addresses.
449
448
*
450
- * @param addr Address to use for the new identity. If NULL or initialized
451
- * to BT_ADDR_LE_ANY the stack will generate a new random
452
- * static address for the identity and copy it to the given
453
- * parameter upon return from this function (in case the
454
- * parameter was non-NULL).
449
+ * @param addr Address to use for the new identity address. If NULL or initialized
450
+ * to BT_ADDR_LE_ANY the stack will generate a new random static address
451
+ * for the identity address and copy it to the given parameter upon return
452
+ * from this function (in case the parameter was non-NULL).
455
453
* @param irk Identity Resolving Key (16 bytes) to be used with this
456
- * identity. If set to all zeroes or NULL, the stack will
457
- * generate a random IRK for the identity and copy it back
454
+ * identity address . If set to all zeroes or NULL, the stack will
455
+ * generate a random IRK for the identity address and copy it back
458
456
* to the parameter upon return from this function (in case
459
457
* the parameter was non-NULL). If privacy
460
458
* @kconfig{CONFIG_BT_PRIVACY} is not enabled this parameter must
461
459
* be NULL.
462
460
*
463
- * @return Identity identifier (>= 0) in case of success, or a negative
464
- * error code on failure.
461
+ * @return Identity handle (>= 0) in case of success, or a negative error code on failure.
465
462
*/
466
463
int bt_id_create (bt_addr_le_t * addr , uint8_t * irk );
467
464
468
465
/**
469
- * @brief Reset/reclaim an identity for reuse.
466
+ * @brief Reset/reclaim an identity address for reuse.
470
467
*
471
468
* The semantics of the @a addr and @a irk parameters of this function
472
469
* are the same as with bt_id_create(). The difference is the first
473
- * @a id parameter that needs to be an existing identity (if it doesn't
474
- * exist this function will return an error). When given an existing
475
- * identity this function will disconnect any connections created using it,
476
- * remove any pairing keys or other data associated with it, and then create
477
- * a new identity in the same slot, based on the @a addr and @a irk
478
- * parameters.
479
- *
480
- * @note the default identity (BT_ID_DEFAULT) cannot be reset, i.e. this
470
+ * @a id parameter that needs to be an existing identity handle (if it doesn't
471
+ * exist this function will return an error). When given an existing identity handle
472
+ * this function will disconnect any connections (to the corresponding identity address)
473
+ * created using it, remove any pairing keys or other data associated with it, and then
474
+ * create a new identity address in the same slot, based on the @a addr and @a irk parameters.
475
+ *
476
+ * @note The default identity address (corresponding to BT_ID_DEFAULT) cannot be reset, and this
481
477
* API will return an error if asked to do that.
482
478
*
483
- * @param id Existing identity identifier.
484
- * @param addr Address to use for the new identity. If NULL or initialized
485
- * to BT_ADDR_LE_ANY the stack will generate a new static
486
- * random address for the identity and copy it to the given
487
- * parameter upon return from this function (in case the
488
- * parameter was non-NULL).
479
+ * @param id Existing identity handle.
480
+ * @param addr Address to use for the new identity address. If NULL or initialized
481
+ * to BT_ADDR_LE_ANY the stack will generate a new static random
482
+ * address for the identity address and copy it to the given
483
+ * parameter upon return from this function.
489
484
* @param irk Identity Resolving Key (16 bytes) to be used with this
490
- * identity. If set to all zeroes or NULL, the stack will
491
- * generate a random IRK for the identity and copy it back
485
+ * identity address . If set to all zeroes or NULL, the stack will
486
+ * generate a random IRK for the identity address and copy it back
492
487
* to the parameter upon return from this function (in case
493
488
* the parameter was non-NULL). If privacy
494
489
* @kconfig{CONFIG_BT_PRIVACY} is not enabled this parameter must
495
490
* be NULL.
496
491
*
497
- * @return Identity identifier (>= 0) in case of success, or a negative
498
- * error code on failure.
492
+ * @return Identity handle (>= 0) in case of success, or a negative error code on failure.
499
493
*/
500
494
int bt_id_reset (uint8_t id , bt_addr_le_t * addr , uint8_t * irk );
501
495
502
496
/**
503
- * @brief Delete an identity.
497
+ * @brief Delete an identity address .
504
498
*
505
- * When given a valid identity this function will disconnect any connections
506
- * created using it, remove any pairing keys or other data associated with
507
- * it, and then flag is as deleted, so that it can not be used for any
508
- * operations. To take back into use the slot the identity was occupying the
509
- * bt_id_reset() API needs to be used.
499
+ * When given a valid identity handle this function will disconnect any connections
500
+ * (to the corresponding identity address) created using it, remove any pairing keys
501
+ * or other data associated with it, and then flag is as deleted, so that it can not
502
+ * be used for any operations. To take back into use the slot the identity address was
503
+ * occupying, the bt_id_reset() API needs to be used.
510
504
*
511
- * @note the default identity ( BT_ID_DEFAULT) cannot be deleted, i.e. this
505
+ * @note The default identity address (corresponding to BT_ID_DEFAULT) cannot be deleted, and this
512
506
* API will return an error if asked to do that.
513
507
*
514
- * @param id Existing identity identifier .
508
+ * @param id Existing identity handle .
515
509
*
516
510
* @return 0 in case of success, or a negative error code on failure.
517
511
*/
@@ -908,7 +902,7 @@ enum advertising_options {
908
902
BT_LE_ADV_OPT_CODED = BIT (12 ),
909
903
910
904
/**
911
- * @brief Advertise without a device address (identity or RPA).
905
+ * @brief Advertise without a device address (identity address or RPA).
912
906
*
913
907
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
914
908
* set as @ref bt_le_adv_param.options.
@@ -997,7 +991,9 @@ enum advertising_options {
997
991
/** LE Advertising Parameters. */
998
992
struct bt_le_adv_param {
999
993
/**
1000
- * @brief Local identity.
994
+ * @brief Local identity handle.
995
+ *
996
+ * The index of the identity address in the local Bluetooth controller.
1001
997
*
1002
998
* @note When extended advertising @kconfig{CONFIG_BT_EXT_ADV} is not
1003
999
* enabled or not supported by the controller it is not possible
@@ -1714,7 +1710,7 @@ uint8_t bt_le_ext_adv_get_index(struct bt_le_ext_adv *adv);
1714
1710
1715
1711
/** @brief Advertising set info structure. */
1716
1712
struct bt_le_ext_adv_info {
1717
- /* Local identity */
1713
+ /** Local identity handle. */
1718
1714
uint8_t id ;
1719
1715
1720
1716
/** Currently selected Transmit Power (dBM). */
@@ -2748,7 +2744,7 @@ BUILD_ASSERT(BT_GAP_SCAN_FAST_WINDOW == BT_GAP_SCAN_FAST_INTERVAL_MIN,
2748
2744
*
2749
2745
* @note The LE scanner by default does not use the Identity Address of the
2750
2746
* local device when @kconfig{CONFIG_BT_PRIVACY} is disabled. This is to
2751
- * prevent the active scanner from disclosing the identity information
2747
+ * prevent the active scanner from disclosing the identity address information
2752
2748
* when requesting additional information from advertisers.
2753
2749
* In order to enable directed advertiser reports then
2754
2750
* @kconfig{CONFIG_BT_SCAN_WITH_IDENTITY} must be enabled.
@@ -2937,12 +2933,12 @@ struct bt_le_oob {
2937
2933
* - Creating a connection in progress, wait for the connected callback.
2938
2934
* In addition when extended advertising @kconfig{CONFIG_BT_EXT_ADV} is
2939
2935
* not enabled or not supported by the controller:
2940
- * - Advertiser is enabled using a Random Static Identity Address for a
2941
- * different local identity.
2942
- * - The local identity conflicts with the local identity used by other
2936
+ * - Advertiser is enabled using a Random Static Identity Address as a
2937
+ * different local identity address .
2938
+ * - The local identity address conflicts with the local identity address used by other
2943
2939
* roles.
2944
2940
*
2945
- * @param[in] id Local identity, in most cases BT_ID_DEFAULT.
2941
+ * @param[in] id Local identity handle , in most cases BT_ID_DEFAULT.
2946
2942
* @param[out] oob LE OOB information
2947
2943
*
2948
2944
* @return Zero on success or error code otherwise, positive in case of
@@ -2980,7 +2976,7 @@ int bt_le_ext_adv_oob_get_local(struct bt_le_ext_adv *adv,
2980
2976
/**
2981
2977
* @brief Clear pairing information.
2982
2978
*
2983
- * @param id Local identity (mostly just BT_ID_DEFAULT).
2979
+ * @param id Local identity handle (mostly just BT_ID_DEFAULT).
2984
2980
* @param addr Remote address, NULL or BT_ADDR_LE_ANY to clear all remote
2985
2981
* devices.
2986
2982
*
@@ -2997,7 +2993,7 @@ struct bt_bond_info {
2997
2993
/**
2998
2994
* @brief Iterate through all existing bonds.
2999
2995
*
3000
- * @param id Local identity (mostly just BT_ID_DEFAULT).
2996
+ * @param id Local identity handle (mostly just BT_ID_DEFAULT).
3001
2997
* @param func Function to call for each bond.
3002
2998
* @param user_data Data to pass to the callback function.
3003
2999
*/
@@ -3121,7 +3117,7 @@ int bt_le_per_adv_set_response_data(struct bt_le_per_adv_sync *per_adv_sync,
3121
3117
* @details Valid Bluetooth LE identity addresses are either public address or random static
3122
3118
* address.
3123
3119
*
3124
- * @param id Local identity (typically @ref BT_ID_DEFAULT).
3120
+ * @param id Local identity handle (typically @ref BT_ID_DEFAULT).
3125
3121
* @param addr Bluetooth LE device address.
3126
3122
*
3127
3123
* @return true if @p addr is bonded with local @p id
0 commit comments