Question About Generation Static Address

2 posts / 0 new
Last post
sprhawk
Offline
Last seen:3 years 1 month ago
加入:2016-03-03 17:25
Question About Generation Static Address

I want to use Static Address, but when I set the

user_undirected_advertise_conf.address_src = GAPM_GEN_STATIC_RND_ADDR

each time the advertise command is sent, the address will be changed, which is not my intention. I want it to be like the bluetooth specification : only change the static random address in each power cycle.

So I need to first to generate random address usingGAPM_GEN_RAND_ADDR_CMD

So the first question:

when I using this commandGAPM_GEN_RAND_ADDR_CMDin user_app_adv_start(), theGAPM_DEV_BDADDR_INDreceived, but when the command is used in user_app_init, the indication is not responded.

the second question, whether I use that command in which function, theGAPM_CMP_EVT没有回应,我不能处理它。

the third question, If I want to use the generated bd_addr, I think I need to useGAPM_PROVIDED_RND_ADDRas address_src, and fill the bdaddr struct in gapm_air_operation, but do I need to set_dev_info to update device address manually ?

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi sprhawk,

Hi sprhawk,

You wont be able to get the indication in the user_app_init() because after the user_app_init() the stack resets and whatever message you ve send its discarded.

I dont understand the second question. The response to the GAPM_GEN_RAND_ADDR_CMD is the GAPM_DEV_BDADDR_IND after that is received you will get a GAPM_CMP_EVT in the gapm_cmp_evt_handler() with operation parameter set to GAPM_GEN_RAND_ADDR, you can catch this at the user_catch_rest_hndl() function.

Regarding the set_dev_info, you will have to use that struct if you want your advertising messages to have advertising data, scan response data etc.

Thanks MT_dialog