@@ -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
@@ -312,7 +312,7 @@ int bt_enable(bt_ready_cb_t cb);
312
312
*
313
313
* Disable Bluetooth. Can't be called before bt_enable has completed.
314
314
*
315
- * This API will clear all configured identities and keys that are not persistently
315
+ * This API will clear all configured identity addresses and keys that are not persistently
316
316
* stored with @kconfig{CONFIG_BT_SETTINGS}. These can be restored
317
317
* with settings_load() before reenabling the stack.
318
318
*
@@ -392,36 +392,35 @@ uint16_t bt_get_appearance(void);
392
392
int bt_set_appearance (uint16_t new_appearance );
393
393
394
394
/**
395
- * @brief Get the currently configured identities .
395
+ * @brief Get the currently configured identity addresses .
396
396
*
397
397
* Returns an array of the currently configured identity addresses. To
398
- * make sure all available identities can be retrieved, the number of
398
+ * make sure all available identity addresses can be retrieved, the number of
399
399
* elements in the @a addrs array should be CONFIG_BT_ID_MAX. The identity
400
- * identifier that some APIs expect (such as advertising parameters ) is
401
- * simply the index of the identity in the @a addrs array.
400
+ * handle that some APIs expect (such as @ref bt_le_adv_param ) is
401
+ * simply the index of the identity address in the @a addrs array.
402
402
*
403
- * If @a addrs is passed as NULL, then returned @a count contains the
404
- * count of all available identities that can be retrieved with a
403
+ * If @a addrs is passed as NULL, then the returned @a count contains the
404
+ * count of all available identity addresses that can be retrieved with a
405
405
* subsequent call to this function with non-NULL @a addrs parameter.
406
406
*
407
- * @note Deleted identities may show up as @ref BT_ADDR_LE_ANY in the returned
408
- * array.
407
+ * @note Deleted identity addresses may show up as @ref BT_ADDR_LE_ANY in the returned array.
409
408
*
410
- * @param addrs Array where to store the configured identities .
411
- * @param count Should be initialized to the array size. Once the function
412
- * returns it will contain the number of returned identities .
409
+ * @param addrs Array where to store the configured identity addresses .
410
+ * @param count Should be initialized to the array size. Once the function returns
411
+ * it will contain the number of returned identity addresses .
413
412
*/
414
413
void bt_id_get (bt_addr_le_t * addrs , size_t * count );
415
414
416
415
/**
417
- * @brief Create a new identity.
416
+ * @brief Create a new identity address .
418
417
*
419
- * Create a new identity using the given address and IRK. This function can be
420
- * called before calling bt_enable(). However, the new identity will only be
418
+ * Create a new identity address using the given address and IRK. This function can be
419
+ * called before calling bt_enable(). However, the new identity address will only be
421
420
* stored persistently in flash when this API is used after bt_enable(). The
422
421
* reason is that the persistent settings are loaded after bt_enable() and would
423
422
* therefore cause potential conflicts with the stack blindly overwriting what's
424
- * stored in flash. The identity will also not be written to flash in case a
423
+ * stored in flash. The identity address will also not be written to flash in case a
425
424
* pre-defined address is provided, since in such a situation the app clearly
426
425
* has some place it got the address from and will be able to repeat the
427
426
* procedure on every power cycle, i.e. it would be redundant to also store the
@@ -430,11 +429,11 @@ void bt_id_get(bt_addr_le_t *addrs, size_t *count);
430
429
* Generating random static address or random IRK is not supported when calling
431
430
* this function before bt_enable().
432
431
*
433
- * If the application wants to have the stack randomly generate identities
432
+ * If the application wants to have the stack randomly generate identity addresses
434
433
* and store them in flash for later recovery, the way to do it would be
435
434
* to first initialize the stack (using bt_enable), then call settings_load(),
436
- * and after that check with bt_id_get() how many identities were recovered.
437
- * If an insufficient amount of identities were recovered the app may then
435
+ * and after that check with bt_id_get() how many identity addresses were recovered.
436
+ * If an insufficient amount of identity addresses were recovered the app may then
438
437
* call bt_id_create() to create new ones.
439
438
*
440
439
* If supported by the HCI driver (indicated by setting
@@ -443,71 +442,66 @@ void bt_id_get(bt_addr_le_t *addrs, size_t *count);
443
442
* before calling bt_enable(). Subsequent calls always add/generate random
444
443
* static addresses.
445
444
*
446
- * @param addr Address to use for the new identity. If NULL or initialized
447
- * to BT_ADDR_LE_ANY the stack will generate a new random
448
- * static address for the identity and copy it to the given
449
- * parameter upon return from this function (in case the
450
- * parameter was non-NULL).
445
+ * @param addr Address to use for the new identity address. If NULL or initialized
446
+ * to BT_ADDR_LE_ANY the stack will generate a new random static address
447
+ * for the identity address and copy it to the given parameter upon return
448
+ * from this function (in case the parameter was non-NULL).
451
449
* @param irk Identity Resolving Key (16 bytes) to be used with this
452
- * identity. If set to all zeroes or NULL, the stack will
453
- * generate a random IRK for the identity and copy it back
450
+ * identity address . If set to all zeroes or NULL, the stack will
451
+ * generate a random IRK for the identity address and copy it back
454
452
* to the parameter upon return from this function (in case
455
453
* the parameter was non-NULL). If privacy
456
454
* @kconfig{CONFIG_BT_PRIVACY} is not enabled this parameter must
457
455
* be NULL.
458
456
*
459
- * @return Identity identifier (>= 0) in case of success, or a negative
460
- * error code on failure.
457
+ * @return Identity handle (>= 0) in case of success, or a negative error code on failure.
461
458
*/
462
459
int bt_id_create (bt_addr_le_t * addr , uint8_t * irk );
463
460
464
461
/**
465
- * @brief Reset/reclaim an identity for reuse.
462
+ * @brief Reset/reclaim an identity address for reuse.
466
463
*
467
464
* The semantics of the @a addr and @a irk parameters of this function
468
465
* are the same as with bt_id_create(). The difference is the first
469
- * @a id parameter that needs to be an existing identity (if it doesn't
470
- * exist this function will return an error). When given an existing
471
- * identity this function will disconnect any connections created using it,
472
- * remove any pairing keys or other data associated with it, and then create
473
- * a new identity in the same slot, based on the @a addr and @a irk
474
- * parameters.
475
- *
476
- * @note the default identity (BT_ID_DEFAULT) cannot be reset, i.e. this
466
+ * @a id parameter that needs to be an existing identity handle (if it doesn't
467
+ * exist this function will return an error). When given an existing identity handle
468
+ * this function will disconnect any connections (to the corresponding identity address)
469
+ * created using it, remove any pairing keys or other data associated with it, and then
470
+ * create a new identity address in the same slot, based on the @a addr and @a irk parameters.
471
+ *
472
+ * @note The default identity address (corresponding to BT_ID_DEFAULT) cannot be reset, and this
477
473
* API will return an error if asked to do that.
478
474
*
479
- * @param id Existing identity identifier.
480
- * @param addr Address to use for the new identity. If NULL or initialized
481
- * to BT_ADDR_LE_ANY the stack will generate a new static
482
- * random address for the identity and copy it to the given
483
- * parameter upon return from this function (in case the
484
- * parameter was non-NULL).
475
+ * @param id Existing identity handle.
476
+ * @param addr Address to use for the new identity address. If NULL or initialized
477
+ * to BT_ADDR_LE_ANY the stack will generate a new static random
478
+ * address for the identity address and copy it to the given
479
+ * parameter upon return from this function.
485
480
* @param irk Identity Resolving Key (16 bytes) to be used with this
486
- * identity. If set to all zeroes or NULL, the stack will
487
- * generate a random IRK for the identity and copy it back
481
+ * identity address . If set to all zeroes or NULL, the stack will
482
+ * generate a random IRK for the identity address and copy it back
488
483
* to the parameter upon return from this function (in case
489
484
* the parameter was non-NULL). If privacy
490
485
* @kconfig{CONFIG_BT_PRIVACY} is not enabled this parameter must
491
486
* be NULL.
492
487
*
493
- * @return Identity identifier (>= 0) in case of success, or a negative
494
- * error code on failure.
488
+ * @return Identity handle (>= 0) in case of success, or a negative error code on failure.
495
489
*/
496
490
int bt_id_reset (uint8_t id , bt_addr_le_t * addr , uint8_t * irk );
497
491
498
492
/**
499
- * @brief Delete an identity.
493
+ * @brief Delete an identity address .
500
494
*
501
- * When given a valid identity this function will disconnect any connections
502
- * created using it, remove any pairing keys or other data associated with
503
- * it, and then flag is as deleted, so that it can not be used for any
504
- * operations. To take back into use the slot the identity was occupying the
505
- * bt_id_reset() API needs to be used.
495
+ * When given a valid identity handle this function will disconnect any connections
496
+ * (to the corresponding identity address) created using it, remove any pairing keys
497
+ * or other data associated with it, and then flag is as deleted, so that it can not
498
+ * be used for any operations. To take back into use the slot the identity address was
499
+ * occupying, the bt_id_reset() API needs to be used.
506
500
*
507
- * @note the default identity ( BT_ID_DEFAULT) cannot be deleted, i.e. this
501
+ * @note The default identity address (corresponding to BT_ID_DEFAULT) cannot be deleted, and this
508
502
* API will return an error if asked to do that.
509
503
*
510
- * @param id Existing identity identifier .
504
+ * @param id Existing identity handle .
511
505
*
512
506
* @return 0 in case of success, or a negative error code on failure.
513
507
*/
@@ -904,7 +898,7 @@ enum advertising_options {
904
898
BT_LE_ADV_OPT_CODED = BIT (12 ),
905
899
906
900
/**
907
- * @brief Advertise without a device address (identity or RPA).
901
+ * @brief Advertise without a device address (identity address or RPA).
908
902
*
909
903
* @note Requires @ref BT_LE_ADV_OPT_EXT_ADV bit (see @ref advertising_options field) to be
910
904
* set as @ref bt_le_adv_param.options.
@@ -993,7 +987,9 @@ enum advertising_options {
993
987
/** LE Advertising Parameters. */
994
988
struct bt_le_adv_param {
995
989
/**
996
- * @brief Local identity.
990
+ * @brief Local identity handle.
991
+ *
992
+ * The index of the identity address in the local Bluetooth controller.
997
993
*
998
994
* @note When extended advertising @kconfig{CONFIG_BT_EXT_ADV} is not
999
995
* enabled or not supported by the controller it is not possible
@@ -1686,7 +1682,7 @@ uint8_t bt_le_ext_adv_get_index(struct bt_le_ext_adv *adv);
1686
1682
1687
1683
/** @brief Advertising set info structure. */
1688
1684
struct bt_le_ext_adv_info {
1689
- /* Local identity */
1685
+ /** Local identity handle. */
1690
1686
uint8_t id ;
1691
1687
1692
1688
/** Currently selected Transmit Power (dBM). */
@@ -2720,7 +2716,7 @@ BUILD_ASSERT(BT_GAP_SCAN_FAST_WINDOW == BT_GAP_SCAN_FAST_INTERVAL_MIN,
2720
2716
*
2721
2717
* @note The LE scanner by default does not use the Identity Address of the
2722
2718
* local device when @kconfig{CONFIG_BT_PRIVACY} is disabled. This is to
2723
- * prevent the active scanner from disclosing the identity information
2719
+ * prevent the active scanner from disclosing the identity address information
2724
2720
* when requesting additional information from advertisers.
2725
2721
* In order to enable directed advertiser reports then
2726
2722
* @kconfig{CONFIG_BT_SCAN_WITH_IDENTITY} must be enabled.
@@ -2909,12 +2905,12 @@ struct bt_le_oob {
2909
2905
* - Creating a connection in progress, wait for the connected callback.
2910
2906
* In addition when extended advertising @kconfig{CONFIG_BT_EXT_ADV} is
2911
2907
* not enabled or not supported by the controller:
2912
- * - Advertiser is enabled using a Random Static Identity Address for a
2913
- * different local identity.
2914
- * - The local identity conflicts with the local identity used by other
2908
+ * - Advertiser is enabled using a Random Static Identity Address as a
2909
+ * different local identity address .
2910
+ * - The local identity address conflicts with the local identity address used by other
2915
2911
* roles.
2916
2912
*
2917
- * @param[in] id Local identity, in most cases BT_ID_DEFAULT.
2913
+ * @param[in] id Local identity handle , in most cases BT_ID_DEFAULT.
2918
2914
* @param[out] oob LE OOB information
2919
2915
*
2920
2916
* @return Zero on success or error code otherwise, positive in case of
@@ -2952,7 +2948,7 @@ int bt_le_ext_adv_oob_get_local(struct bt_le_ext_adv *adv,
2952
2948
/**
2953
2949
* @brief Clear pairing information.
2954
2950
*
2955
- * @param id Local identity (mostly just BT_ID_DEFAULT).
2951
+ * @param id Local identity handle (mostly just BT_ID_DEFAULT).
2956
2952
* @param addr Remote address, NULL or BT_ADDR_LE_ANY to clear all remote
2957
2953
* devices.
2958
2954
*
@@ -2969,7 +2965,7 @@ struct bt_bond_info {
2969
2965
/**
2970
2966
* @brief Iterate through all existing bonds.
2971
2967
*
2972
- * @param id Local identity (mostly just BT_ID_DEFAULT).
2968
+ * @param id Local identity handle (mostly just BT_ID_DEFAULT).
2973
2969
* @param func Function to call for each bond.
2974
2970
* @param user_data Data to pass to the callback function.
2975
2971
*/
@@ -3093,7 +3089,7 @@ int bt_le_per_adv_set_response_data(struct bt_le_per_adv_sync *per_adv_sync,
3093
3089
* @details Valid Bluetooth LE identity addresses are either public address or random static
3094
3090
* address.
3095
3091
*
3096
- * @param id Local identity (typically @ref BT_ID_DEFAULT).
3092
+ * @param id Local identity handle (typically @ref BT_ID_DEFAULT).
3097
3093
* @param addr Bluetooth LE device address.
3098
3094
*
3099
3095
* @return true if @p addr is bonded with local @p id
0 commit comments