What is the BD address that the device is advertising? If you are not using random BD address, the device will advertise with the BD address that is set in your application code. Can you please share more inputs for what you have accomplish? What is the type of the BD address?
不,它将为每个设备和BD地址是唯一的ss of device will change at least every 150s. But if you set address type is PRIVATE_RANDOM_NONRESOLVABLE_ADDRESS, as PM_Dialog said, you will be not able to connect. Nonresolvable address is for beacons or non-connectable devices.
Let me explain how the BD address in handled in our SDK. When the device boots, the BLE adapter will access the NVMS_PARAM_PART partition and check if a valid BD address is placed in this partition. The first entry of that partition, is the NVPARAM_BLE_PATFORM_BD_ADDRESS and it has 7 bytes length:
- BD地址的6个字节
- 1 byte that designates the validity of the written BD address.
When no device address is provided by the developer the Bluetooth public address is used. The default value of the public address is declared in sdk/ble/config/ble_config.h file. If a new value is required to be defined then the new macro definition should take place in config/custom_config_xxx.h file where all custom definitions should be declared.
2. Write a BD address in the NVMS_PARAM_PART flash partition. The SDK will overwrite the public address defined in defaultBLE_STATIC_ADDRESS macro definition.
Hi There,
您使用的是什么样的BD地址?它是静态吗?您能否分享更多的输入?
谢谢,PM_DIALOG.
嗨,
我在谈论蓝牙MAC地址。我在谈论什么是蓝牙MAC地址。问题是下载相同的程序将具有相同的蓝牙MAC地址
Hi There,
What is the BD address that the device is advertising? If you are not using random BD address, the device will advertise with the BD address that is set in your application code. Can you please share more inputs for what you have accomplish? What is the type of the BD address?
谢谢,PM_DIALOG.
嗨,
是的,它是广告BD地址。在一个随机蓝牙地址保证每个BD地址都有不同?如何使用随机蓝牙地址,请指导我。
Hi There,
为了用静态随机BD地址进行宣传,您应该将user_add_src结构的.addr_src属性更改为gapm_gen_static_rnd_addr。此结构位于User_Config.h文件下。请查看app_easy_gap_undircated_advertise_start_create_msg()函数,为可连接的无向事件创建广告消息。如果user_adv_conf.addr_src配置为Gapm_gen_static_rnd_addr,则将触发生成_static_random_address(),它会生成48位静态随机地址。
谢谢,PM_DIALOG.
嗨,
I can't find the app_easy_gap_undirected_advertise_start_create_msg () function? Please explain the location of that function.
Hi There,
它是低于5.0.4 \ sdk \ app_modules \ src \ app_common \ app.c sdk路径。您使用的是哪个SDK版本?您已标记DA14580产品,因此推荐SDK为5.0.4版。
谢谢,PM_DIALOG.
嗨,您好,
对不起,我标记的产品和SDK是错误的,我使用DA14695,并使用最新的SDK版本
Hi There,
默认情况下,该设备启动静态公共BD地址的广告。公共地址的默认值在SDK / BLE / CONFIG / BLE_CONFIG.H文件中声明。如果需要确定新值,则新的宏定义应在Config / Custom_config_xxx.h文件中进行,其中应声明所有自定义定义。例如 :
如果设置随机BD地址,则应执行以下操作:
The .addr will be ignored.
谢谢,PM_DIALOG.
嗨,您好,
如果您遵循您的示例,那么在大规模生产中,每个产品的蓝牙MAC地址将是相同的。这绝对不起作用,有更好的方法吗?
不,它将为每个设备和BD地址是唯一的ss of device will change at least every 150s. But if you set address type is PRIVATE_RANDOM_NONRESOLVABLE_ADDRESS, as PM_Dialog said, you will be not able to connect. Nonresolvable address is for beacons or non-connectable devices.
我以这种方式设置了我的唯一地址:
您可以更改地址续订期间。
Unfortunately, there is no private static BD address burned at production, like at nRF52 MCUs.
嗨,您好,
我使用ble_gap_address_set(&user_bd_address,0x00ff)来设置BD地址。为什么可以通过Android手机扫描此设备,但不是由Apple手机扫描?我的数据如下:
/ *初始化与BD地址相关的BLE结构* /
static own_address_t user_bd_address = {
.ddr_type = private_static_address,
.addr = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06}
};
Hi There,
Let me explain how the BD address in handled in our SDK. When the device boots, the BLE adapter will access the NVMS_PARAM_PART partition and check if a valid BD address is placed in this partition. The first entry of that partition, is the NVPARAM_BLE_PATFORM_BD_ADDRESS and it has 7 bytes length:
- BD地址的6个字节
- 1 byte that designates the validity of the written BD address.
您还可以使用SmartSnippets Toolbox来读取NVMS_PARAM_PART。
如果用户在该分区中没有写入任何BD地址,或者如果标志无效(禁用),则应用程序将采用默认的公共BD地址。请在BLE适配器(AD_BLE.C文件)中查看READ_PUBLIC_ADDRESS()函数。
When no device address is provided by the developer the Bluetooth public address is used. The default value of the public address is declared in sdk/ble/config/ble_config.h file. If a new value is required to be defined then the new macro definition should take place in config/custom_config_xxx.h file where all custom definitions should be declared.
update_bd_address()函数旨在基于Trng(真式随机数生成器)引擎生成BD地址,并通过调用BLE_GAP_ADDRESS_SET()来设置它。然后,将将先前生成的地址写入NVMS_PARAM_PART。因此,在发生冷启动(重置)后,设备将使用闪光灯中写入的BD地址。请在附件中找到源代码。您还将找到验证的代码片段。
通常,配置BD地址有三种(3)种方法:
1.定义唯一的公共地址。因此,youdwle_static_address宏应在custom_config_xxxx.h中定义
2. Write a BD address in the NVMS_PARAM_PART flash partition. The SDK will overwrite the public address defined in defaultBLE_STATIC_ADDRESS macro definition.
3.通过调用BLE_GAP_ADDRESS_SET()API来定义唯一的BD地址。可以随时调用此API以更改设备的BD地址。
谢谢,PM_DIALOG.