Resolvable private address issues

16个帖子/ 0新
Last post
summer20100514
Offline
Last seen:4 years 3 months ago
格鲁鲁
加入:2014-12-30 05:01
Resolvable private address issues

在那里,我跟随文档AN-B-022 DA14580可解析的私人地址指南来实现随机地址,并且每件事都进展顺利,地址根据我的配置定期更改。但是,我发现每次我改变了调用app_adv_func()的广告数据,也改变了地址。
What can I do to prevent the address from changing after I call the function app_adv_func()?

设备:
summer20100514
Offline
Last seen:4 years 3 months ago
格鲁鲁
加入:2014-12-30 05:01
As far as I am concerned, it

据我所知,才能实现这一点,是不可能的吗?

JE_Dialog
Offline
Last seen:2 weeks 3 hours ago
Staff
加入:2013-12-05 14:02
Yes Summer, i beleive you are

是的夏天,我相信你是对的。BR JE_DIALOG.

summer20100514
Offline
Last seen:4 years 3 months ago
格鲁鲁
加入:2014-12-30 05:01
谢谢.

谢谢.

Mahesh
Offline
Last seen:3 years 2 months ago
加入:2016-01-04 14:03
Hi,

Hi,
I am using SDK 5.0.3 software on DA14583DEVKT-B board.
I have taken the "ble_app_peripheral" (BLE example projects given).

I have changed "address_src" to "GAPM_GEN_STATIC_RND_ADDR".
I am facing issue while scanning for Bluetooth device. While scanning the Bluetooth device address is changing without any power cycle (of DA14583). As per Bluetooth core spec, if we have selected Static Random address then the Bluetooth address has to change on each power cycle.

My requirement is Bluetooth device address need to be changed on each power cycle.
Please guide me to resolve the issue.

问候,
Mahesh Chandana.

MT_dialog
Offline
Last seen:4 weeks 1 day ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

这是一个已知的问题,并且有一个问题,您可以使用Gapm_gen_rand_addr_cmd与Gap_static_addr类型一起使用,并将生成的地址存储在Gapm_dev_bdaddr_ind消息中返回。然后,应将GAPM_START_ADVERTESE_CMD设置为CAPM_PROVIDE_RND_ADDR并在地址字段中提供存储的随机地址,有关命令的更多信息,请检查RW-BLE-GAP-IS。这个想法是在设备的初始化期间调用上述进程,例如,当数据库的设置已经完成,然后,在水中使用BD_Address后,您可以启动广告。

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 2 months ago
加入:2016-01-04 14:03
Hi,

Hi,
In which function and in which file we need to do these sequence of changes.

"GAPM_PROVIDED_RND_ADDR" I have changed directly in "user_config.h".

问候,
Mahesh Chandana.

MT_dialog
Offline
Last seen:4 weeks 1 day ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

There is no special file to implement this, just create a function that sends the command GAPM_GEN_RAND_ADDR_CMD, retrieve the command via the catch_rest mechanism (catch the GAPM_DEV_BDADDR_IND) and set the db address that you got from that indication when you are preparing the advertising command in the gapm_start_advertise_cmd struct in the op->addr member. Check the document mentioned above for any details regarding the structs.

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 2 months ago
加入:2016-01-04 14:03
Hi

Hi

I am able to retrieve the catch_rest mechanism (catch the GAPM_DEV_BDADDR_IND) after sending the command "GAPM_GEN_RAND_ADDR_CMD". Able to read the Random address.

我打电话app_gapm_gen_rand_addr_msg_create() inside "default_app_on_db_init_complete() as shown in below

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);
return;
}

After receiving the generated random bd address, where I need to update.
As you told we can update it in gapm_start_advertise_cmd struct in the op->addr member (as shown in below)

__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 = RetrieveAddress;
return(cmd);
}

But we are receiving the random address in user level, same way we need to pass the random address from user level.
There is any provision to access the "op->addr " from the user level. Please guide me which is the suitable place to update the op->addr.

问候,
Mahesh Chandana.

MT_dialog
Offline
Last seen:4 weeks 1 day ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

You can make a custom start advertising function without using the app_easy functions, allocate thegapm_start_advertise_cmd.message, fill it with the proper parameters and send it or, you can just change in the user_config.h the .address_src member to GAPM_PROVIDED_RND_ADDR and when start advertising invoke the app_easy_gap_undirected_advertise_get_active() then copy the generated address to the cmd->op.addr member and finally invoke the app_easy_gap_undirected_advertise_start().

Thanks MT_dialog

Sprhawk.
Offline
Last seen:3 years 3 days ago
加入:2016-03-03 17:25
Hi I have figured these

Hi I have figured these commands, but I'm not aware where to put the sequences.

我想我应该援引GAPM_GEN_RND_ADDRbefore starting advertising, but I found if I put the command in user_app_init(), theGAPM_BD_ADDR_IND没有退回。

只有在我把命令置于时user_app_adv_start它将工作。

但它应该只开始广告只有随机地址。

So How should I do with it ?

thank you

Mahesh
Offline
Last seen:3 years 2 months ago
加入:2016-01-04 14:03
Hi,

Hi,
按照“default_app_on_db_init_complete(void)”功能进行以下更改
void default_app_on_db_init_complete( void )
{

struct gapm_gen_rand_addr_cmd* cmd;

//Create and send the command for generate the bd random address
cmd = app_gapm_gen_rand_addr_msg_create();
app_gapm_gen_rand_addr_msg_send(cmd);

// execute_default_operation_void(default_operation_adv);
return;
}

and then put the following case in "user_catch_rest_hndl ()" function
CASE GAPM_DEV_BDADDR_IND:
{
// Cast the void pointer to the appropriate message structure
struct gapm_dev_bdaddr_ind const *msg_param = (struct gapm_dev_bdaddr_ind const *)(param);

//Copying generated random address in a global array
Memcpy(UAP_GENRANDADDR_MDA,MSG_PARAM-> ADDR.ADDR.ADDR,BD_ADDR_LEN);

user_app_adv_start();

} break;

then update the "cmd->op.addr.addr" inside the "user_app_adv_start()" function.

It is working for me.

问候,
Mahesh Chandana

Sprhawk.
Offline
Last seen:3 years 3 days ago
加入:2016-03-03 17:25
Hi

Hi

大帮助,我会尝试。谢谢

Mahesh
Offline
Last seen:3 years 2 months ago
加入:2016-01-04 14:03
Hi,

Hi,
非常感谢您的支持。

问候,
Mahesh Chandana.

MT_dialog
Offline
Last seen:4 weeks 1 day ago
Staff
加入:2015-06-08 11:34
Hi sprhawk, Mahesh

Hi sprhawk, Mahesh

由于在上一篇文章中所示,在user_app_init期间发布了每条消息,因为堆栈在调用函数后堆栈被重置。在第6篇文章中,想法是在设备的初始化期间调用上述进程,例如,当数据库的设置已经完成时,然后在水中的BD_Address后,您可以启动广告。“因此,您可以在数据库初始化后生成bd_address(在app_on_db_init_complete中发送命令)或者如果在设备配置完成时没有任何数据库(在app_on_set_dev_config_complete()时发送生成地址命令)。在您将BD_Address(意思是处理程序中的PACMM_DEV_BDADDR_IND中的处理程序中)进行了解之后,您可以在变量中复制地址并分配您的广告命令填写正确的结构并发送消息(正如Mahesh建议的)。或者您可以等待GAPM_CMP_EVT(表示命令已完成)并从该回调开始广告。这将确保消息序列将是合适的。

Also check this posthttp://support.dialog-semiconductor.com/question-about-generation-static...

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 2 months ago
加入:2016-01-04 14:03
Hi,

Hi,
It worked for me.

谢谢very much...

问候,
Mahesh Chandana.

Topic locked