<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96457/bt_le_ext_adv_update_param-cannot-change-bdaddr</link><description>I am using the nrf connect SDK. I want to switch multiple BDADDRs in one AdvertiseSet. BDADDR does not change even if bt_le_adv_param.id is changed in bt_le_ext_adv_update_param(). 
 Is there any way?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Mar 2023 11:02:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96457/bt_le_ext_adv_update_param-cannot-change-bdaddr" /><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/414590?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 11:02:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a5d17ca-0796-4438-93f9-4a598f887d29</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I suggest you do as initially suggested:&lt;/p&gt;
[quote user="loquat"]I can achieve this by using multiple AdvertiseSets, but I would like to avoid this as it requires additional memory.[/quote]
&lt;p&gt;Alternatively, you can stop, update and start advertising also if you want too like on the old nRF5 SDK.&lt;/p&gt;
&lt;p&gt;But if you are using connectable advertisment then we need to follow the BT spec.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/414532?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 08:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:167ee95d-148f-4290-8e18-23be546d4979</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;No, that&amp;#39;s not what I want to know.&lt;br /&gt;&lt;br /&gt;Did you forget to set param-&amp;gt;id to adv-&amp;gt;id in the process of bt_le_ext_adv_update_param()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/413886?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 14:25:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0efbc12-d3df-4585-adf9-b46ce96d98eb</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;It is not allowed for most types of advertising.&lt;/p&gt;
&lt;p&gt;When using legacy advertising commands the address that is used is the one set through &amp;quot;HCI LE Set Random Address command&amp;quot;.&amp;nbsp;In Core_v5.4, Vol 4, Part E, Section 7.8.4:&lt;/p&gt;
&lt;p&gt;If the Host issues this command when any of advertising (created using legacy advertising commands), scanning, or initiating are enabled, &lt;strong&gt;the Controller shall return the error code Command Disallowed (0x0C)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;When using extended advertising commands the address that is used is the one set through &amp;quot;LE Set Advertising Set Random Address command&amp;quot;.&amp;nbsp;In Core_v5.4, Vol 4, Part E, Section 7.8.52:&lt;/p&gt;
&lt;p&gt;However, if the Host issues this command while the advertising set identified by the Advertising_Handle parameter is using connectable advertising and is enabled, &lt;strong&gt;the Controller shall return the error code Command Disallowed (0x0C).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/413135?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 23:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28b14f76-3de1-405e-9963-0c39b2e92db3</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;Core spec v5.1&lt;br /&gt;LE Set Advertising Set Random Address command&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;&amp;nbsp;want to do the same thing.&lt;br /&gt;It seems that this command can be called even during Advertising.&lt;br /&gt;(It seems that the setting will be reflected at the next enable.)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;what should i do?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;I checked the source code.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;zephyr/subsys/bluetooth/host/adv.c&lt;br /&gt;int bt_le_ext_adv_update_param()&lt;br /&gt;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp; le_ext_adv_param_set()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ////////////////////////////////////&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; It looks like are setting BDADDR&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ////////////////////////////////////&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;err = bt_id_set_adv_own_addr(adv, param-&amp;gt;options, dir_adv,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;cp-&amp;gt;own_addr_type);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set which local identity address we&amp;#39;re advertising with */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///////////////////////////////////////////////&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BDADDR is not new addr but old(current) addr?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///////////////////////////////////////////////&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; id_addr = &amp;amp;bt_dev.id_addr[adv-&amp;gt;id];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (options &amp;amp; BT_LE_ADV_OPT_USE_IDENTITY) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (id_addr-&amp;gt;type == BT_ADDR_LE_RANDOM) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err = bt_id_set_adv_random_addr(adv, &amp;amp;id_addr-&amp;gt;a);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;is something wrong?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/412125?ContentTypeID=1</link><pubDate>Sun, 26 Feb 2023 23:45:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a84e878f-946f-4d94-bc0e-600c33b341c6</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;OK.Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/412111?ContentTypeID=1</link><pubDate>Sun, 26 Feb 2023 17:05:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc66af3b-74e4-4c75-8cfc-3d531ef6decc</guid><dc:creator>Kenneth</dc:creator><description>[quote user="loquat"]Is it possible during advertising?[/quote]
&lt;p&gt;No.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/412097?ContentTypeID=1</link><pubDate>Sun, 26 Feb 2023 04:43:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d0769d6-99e3-4535-9a53-a42232e97ca0</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;Is it possible to set a different addr for bt_id_reset?&lt;br /&gt;Is it possible during advertising?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/410808?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2023 08:44:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f15ab48a-678c-4ba4-af78-4390c8de0322</guid><dc:creator>Kenneth</dc:creator><description>[quote user="loquat"]Apparently, bt_id can only be set during adv_create and cannot be changed with update_param.[/quote]
&lt;p&gt;So it&amp;#39;s the same as old nRF5 SDK then.&lt;/p&gt;
[quote user="loquat"]What are the limitations of bt_id_reset()?[/quote]
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * @brief Reset/reclaim an identity for reuse.
 *
 * The semantics of the @a addr and @a irk parameters of this function
 * are the same as with bt_id_create(). The difference is the first
 * @a id parameter that needs to be an existing identity (if it doesn&amp;#39;t
 * exist this function will return an error). When given an existing
 * identity this function will disconnect any connections created using it,
 * remove any pairing keys or other data associated with it, and then create
 * a new identity in the same slot, based on the @a addr and @a irk
 * parameters.
 *
 * @note the default identity (BT_ID_DEFAULT) cannot be reset, i.e. this
 * API will return an error if asked to do that.
 *
 * @param id   Existing identity identifier.
 * @param addr Address to use for the new identity. If NULL or initialized
 *             to BT_ADDR_LE_ANY the stack will generate a new static
 *             random address for the identity and copy it to the given
 *             parameter upon return from this function (in case the
 *             parameter was non-NULL).
 * @param irk  Identity Resolving Key (16 bytes) to be used with this
 *             identity. If set to all zeroes or NULL, the stack will
 *             generate a random IRK for the identity and copy it back
 *             to the parameter upon return from this function (in case
 *             the parameter was non-NULL). If privacy
 *             @kconfig{CONFIG_BT_PRIVACY} is not enabled this parameter must
 *             be NULL.
 *
 * @return Identity identifier (&amp;gt;= 0) in case of success, or a negative
 *         error code on failure.
 */
int bt_id_reset(uint8_t id, bt_addr_le_t *addr, uint8_t *irk);&lt;/pre&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;From errno.h I can find that the new identity (addr) you are trying to create is the same as the old.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/410753?ContentTypeID=1</link><pubDate>Sun, 19 Feb 2023 06:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f9ce40b-93a4-4ddc-adc3-f7c0b68a0742</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;Apparently, bt_id can only be set during adv_create and cannot be changed with update_param.&lt;br /&gt;&lt;br /&gt;I would like to use bt_id_reset() instead.&lt;br /&gt;However, if the id is associated with adv_create(), calling bt_id_reset() will return an error (-120).&lt;br /&gt;What are the limitations of bt_id_reset()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/410229?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2023 07:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79c520f8-8eac-43d0-9677-8ad1cf224a65</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;If you are doing something wrong when calling bluetooth api&amp;#39;s you will get an error message. As long as there is no error message you are fine.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/410201?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2023 00:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11b673e1-f1a3-4ca7-ac6b-168bccf8f928</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;Inside the bt_le_ext_adv_cb.sent() callback function, we are calling bt_le_ext_adv_update_param().&lt;br /&gt;Is this a problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/409758?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 08:32:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cedeeb0-e8ff-494f-9238-b03cd2a7a27c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I would assume you need to do this similiar to the nRF5 SDK; set address before advertisement start. I do not expect changing the address on the fly while advertising will work, but I suggest you simply try it, if it works then it works, if it doesn&amp;#39;t then it doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/409716?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 23:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e550af3-3f49-4e10-9344-3e41bbd93900</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;On nRF5 SDK,&lt;/p&gt;
&lt;p&gt;call&amp;nbsp;sd_ble_gap_addr_set() before sd_ble_gap_adv_start().&lt;/p&gt;
&lt;p&gt;Example is not ExtendedAdvertising.&lt;/p&gt;
&lt;p&gt;In AdvertiseExtension,&lt;br /&gt;I&amp;#39;m thinking of using bt_le_ext_adv_update_param() and changing the id to change the BDADDR.&lt;br /&gt;Am I wrong?&lt;br /&gt;Please let me know if there is another way.&lt;/p&gt;
&lt;p&gt;Changing bt_le_adv_param.options seems possible.&lt;br /&gt;I was able to switch BDADDR between RandomStaticAddr and NonResolvablePrivateAddress by adding or removing BT_LE_ADV_OPT_USE_IDENTITY in bt_le_adv_param.options.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/409098?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2023 10:03:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:befa79cf-d1b6-4369-a643-37b4e4f86884</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;How did you do this in nRF5 SDK? I would think the address could not be changed on the fly there either?&lt;/p&gt;
&lt;p&gt;But to answer your question, the address can be changed&amp;nbsp;using the bt_id_get() and bt_id_create() api:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/gap.html#c.bt_id_create"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/gap.html#c.bt_id_create&lt;/a&gt;&amp;nbsp;&lt;br /&gt; &lt;br /&gt;Example usage:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1-snapshot1/samples/bluetooth/peripheral_identity/src/peripheral_identity.c#L44"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1-snapshot1/samples/bluetooth/peripheral_identity/src/peripheral_identity.c#L44&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/79563/is-there-a-way-to-update-the-mac-address-after-enabling-bluetooth/329797"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/79563/is-there-a-way-to-update-the-mac-address-after-enabling-bluetooth/329797&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/409009?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 22:50:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efa4a61a-30d1-497c-be9d-7b3c97c3f097</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;The purpose is to send multiple types of advertising.&lt;br /&gt;I can achieve this by using multiple AdvertiseSets, but I would like to avoid this as it requires additional memory.&lt;br /&gt;&lt;br /&gt;Also, I implemented&amp;nbsp; the processing for multiple types of advertising for the nRF5 SDK, so I would like to use that processing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_le_ext_adv_update_param() cannot change BDADDR</title><link>https://devzone.nordicsemi.com/thread/408956?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 15:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e8ed3b0-77b6-40d8-92b1-3953445b7ad8</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Can you elaborate what you are trying to do here? If you enable private resolveable address you can configure how frequently the address is updated by this kconfig option (you may need to update to ncs v2.2 for this to work):&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_BT_RPA_TIMEOUT"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_BT_RPA_TIMEOUT&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>