你好there, I followed the document AN-B-022 DA14580 Resolvable private address guidelines to achieve the random address, and every thing went well, the address changed periodically according to my configuration. But I found that each time I changed the advertisement data which would call app_adv_func(), the address changed as well.
在呼叫函数app_adv_func()后,我该怎么办法可以防止地址发生变化?
Device:
就我而言,它is impossible to achieve that, right?
是的,夏天,我相信你是correct. BR JE_Dialog
谢谢你。
你好,
我在DA14583DEVKT-B板上使用SDK 5.0.3软件。
我拍摄了“BLE_APP_PERITELAL”(给出了BLE示例项目)。
我已将“address_src”更改为“gapm_gen_static_rnd_addr”。
在扫描蓝牙设备时,我正面临问题。在扫描蓝牙设备地址时,没有任何电源周期(DA14583)正在发生变化。根据蓝牙核心规范,如果我们选择了静态随机地址,那么蓝牙地址必须在每个电源周期上更改。
我的要求是需要在每个电源周期上更改蓝牙设备地址。
请指导我解决这个问题。
Regards,
Mahesh Chandana。
嗨mahesh,
This is a known issue, and there is a work around for this, you can use the GAPM_GEN_RAND_ADDR_CMD with a GAP_STATIC_ADDR type and store the generated address returned in GAPM_DEV_BDADDR_IND message. Then a GAPM_START_ADVERTISE_CMD should be sent with address source set to GAPM_PROVIDED_RND_ADDR and providing the stored random address in the address field, for more info regarding the commands please check the RW-BLE-GAP-IS. The idea is to call the above process during initialization of the device, for example when the setup of your database has been completed and then, after aquiring the bd_address you can start advertising.
谢谢mt_dialog.
你好,
其中函数以及我们需要执行这些更改序列的文件。
“GAPM_PROVIDED_RND_ADDR”我直接在“user_config.h”中更改。
Regards,
Mahesh Chandana。
嗨mahesh,
没有特殊文件来实现这一点,只需创建一个发送命令Gapm_gen_rand_addr_cmd的函数,通过catch_rest机制(cathm_dev_bdaddr_ind检索命令,并在准备广告命令时设置您从该指示中获取的DB地址OP-> ADDR成员中的GAPM_START_ADVERTERS_CMD结构。检查上面提到的文件是否有关结构的任何细节。
谢谢mt_dialog.
你好
在发送命令“GAPM_GEN_RAND_ADDR_CMD”后,我能够检索CATCH_REST机制(捕获GAPM_DEV_BDDDR_IND)。能够读取随机地址。
我正在调用app_gapm_gen_rand_addr_msg_create()中的“default_app_on_db_init_complete()中,如下所示
void default_app_on_db_init_complete(void)
{
struct gapm_gen_rand_addr_cmd * cmd;
cmd = app_gapm_gen_rand_addr_msg_create();
app_gapm_gen_rand_addr_msg_send(cmd);
Execute_default_operation_void(default_operation_adv);
返回;
}
收到生成的随机BD地址后,我需要更新。
如您所说,我们可以在Op-> Addr成员中的GapM_Start_Advertise_cmd Struct中更新它(如下所示)
__inline struct gapm_start_advertise_cmd * app_advertise_start_msg_create(void)
{
struct gapm_start_advertise_cmd* cmd = KE_MSG_ALLOC(GAPM_START_ADVERTISE_CMD,
task_gapm,task_app,
gapm_start_advertise_cmd);
CMD-> OP-> ADDR = RERETIEGEADDRESS;
返回(cmd);
}
但我们正在接收用户级别的随机地址,相同的方式从用户级别传递随机地址。
有任何规定可以从用户级别访问“Op-> Addr”。请指导我是更新OP-> ADDR的合适位置。
Regards,
Mahesh Chandana。
嗨mahesh,
您可以在不使用App_easy函数的情况下进行自定义启动广告功能,分配GAPM_START_ADVERTISE_CMD消息,用正确的参数填充它并发送它,或者,您只能在user_config.h中更改为gapm_provide_rnd_addr以及启动广告调用app_easy_gap_undircted_advertise_get_active()然后将生成的地址复制到cmd-> op.addr成员并最终调用app_easy_gap_undircated_advertise_start()。
谢谢mt_dialog.
嗨,我已经想到了这些命令,但我不知道将序列放在哪里。
I think I should invokegapm_gen_rnd_addr.在启动广告之前,但我找到了我在user_app_init()中的命令,gapm_bd_addr_ind.is not returned.
only when I put the command inuser_app_adv_start.它将起作用。
But It should start advertising only I got the random address.
那我该怎么办?
谢谢你
你好,
do the following change as in "default_app_on_db_init_complete( void )" function
void default_app_on_db_init_complete(void)
{
struct gapm_gen_rand_addr_cmd * cmd;
//创建并发送命令以生成BD随机地址
cmd = app_gapm_gen_rand_addr_msg_create();
app_gapm_gen_rand_addr_msg_send(cmd);
//EXECUTE_DEFAULT_OPERATION_VOID(default_operation_adv);
返回;
}
然后在“user_catch_rest_hndl()”函数中放置以下案例
case GAPM_DEV_BDADDR_IND:
{
//将void指针投入相应的消息结构
struct gapm_dev_bdaddr_ind const * msg_param =(struct gapm_dev_bdaddr_ind const *)(param);
//在全局数组中复制生成的随机地址
memcpy(UAP_genRandAddr_mda, msg_param->addr.addr.addr, BD_ADDR_LEN);
user_app_adv_start();
} 休息;
然后更新“user_app_adv_start()”函数内的“cmd-> op.addr.addr”。
它为我工作。
Regards,
Mahesh.Chandana
你好
Big help, I'll try. Thank you
你好,
Thank you very much for your support.
Regards,
Mahesh Chandana。
嗨Sprhawk,Mahesh
我已经表示在前vious post you ve posted every message during the user_app_init() is discarded since the stack gets reseted after the invokation of the function. In the post #6 "The idea is to call the above process during initialization of the device, for example when the setup of your database has been completed and then, after aquiring the bd_address you can start advertising." So you can generate the bd_address after your database gets initialized (send the command in the app_on_db_init_complete) or if dont have any database when the device configuration is complete (send the generate address command when app_on_set_dev_config_complete()). After you have aquired the bd_address (meaning in the handler that handler the GAPM_DEV_BDADDR_IND) you can copy the address in a variable and allocate your advertising command fill in the proper structures and send the message (as Mahesh suggested). Or you can wait for the GAPM_CMP_EVT (that indicates that the command has completed) and start advertising from that callback. This will ensure that the sequence of messages will be proper.
还要检查这篇文章http://support.dialog-semicondiondiond.com/question-about-generation-tatic ...
谢谢mt_dialog.
你好,
它为我工作。
非常感谢你...
Regards,
Mahesh Chandana。