我想根据连接到DA14580的传感器的数据更改广告间隔。我计划通过将app.c中的第209行和第210行更改为可以由另一个函数更新的全局变量来实现这一点。
所以我在app.c中会有这样的内容:
void app_adv_start(void)
{
...
cmd->intv\u min=current\u app\u adv\u int\u min;//是app\u adv\u int\u min
cmd->intv\u max=current\u app\u adv\u int\u max;//是app\u adv\u int\u max
....
}
Will this work? Is this the best way of accomplishing this?
Thanks for any help you can give.
亲爱的莫特瑞德,
你说得对,如果你需要改变广告时间间隔,应用程序c中的第209行和第210行都必须改变。
所以你提到的功能很好。
Note that current_app_adv_int_min & current_app_adv_int_max must be the same.
致以最诚挚的问候,
纪尧姆。
嗨,纪尧姆,
你知道如果你将intv\u min和intv\u max设置为不同会发生什么吗?
根据我的测试,当intv\u min
你知道这样做有没有副作用吗?如果忽略intv\u min,它有什么好处?
(我只是出于好奇才感兴趣)。
谢谢,
Oren
#定义APP\u ADV\u INT\u MIN 1100
#定义APP\u ADV\u INT \u MAX 1100
1100 means ?? unit??
Hi hrg, I believe the units are 1/100ths of seconds.
比尔
JE\U对话框
你好,
You should multiply the number 1100 with 0.625 to get the number of miliseconds between events. So 1100 => 688ms.
Hi JE_Dialog
于确定吗?因为它是广告时间间隔o 1100*(1/100) = 11 seconds !! ?? or is it 1100 * 0.625 =687.s msec ? because while checking in power profiling the time between two advertising event is approx 680 msec !!
Hi Hrg,
See my answer above.
Other than the setting, the stack will have to add a random number to the advertising to avoid that two separate devices collide in the air continuosly. So the advertising will fluctuate some +/-10ms
你好,hrg,是的,你是对的:我错看了我们的信标软件,我们有一个不同的计算。
Line 81 and 83 in main.c apply a multiper of 0.625 so the 680mS is the correct value.
#定义APP\u ADV\u INT \u MIN 0x20//*0.625ms(+伪随机advDelay从0到10ms)
BR JE\u对话框
你好,
只是补充一下。你将不得不停止,然后重新开始广告,以真正改变间隔。
嗨,杰,
在#8中,您提到(BLE)堆栈将在APPŠADVŠu INTŠMAX上方添加随机数(0~10ms),而在我们的测试中,我们没有看到此随机添加到间隔:
-当我们同时启动3个DA模块(使用相同的固件)时,我们很难扫描所有3个模块(有时我们只能扫描1个,有时2个)。
-如果我们一个接一个地打开3个DA模块,我们每次都可以扫描所有3个模块。
- if we burn firmware with different APP_ADV_INT_MAX value to each module, and power up the 3 modules simutaneously, we also can scan all 3 modules everytime.
Pls help to check and advise..
谢谢。
亚历克斯
Hi alex,
According to the bluetooth spec the advertising events occurs at regular intervals which are slightly modified with a random delay to aid in interference avoidance. Even without this mechanism, over time the different advertising intervals should drift and stop overlapping eachother (no matter how simutaneously your advertising starts for how long the other devices aren't discoverable by your scanner). Do you use different bd-addresses ? What is your software version ?
谢谢你的对话
Thank you MT..
Do you use different bd-addresses ?
-是的,我们每个模块有不同的BDA。
What is your software version ?
-基于SDK304开发的固件。
亚历克斯。
Hi alex,
请您尝试定义CFG\u TRNG配置,并再次检查广告事件是否重叠?
谢谢你的对话。
嗨对话框
我们的问题与#11相同,我们使用的是SDK 5.0.2.1
信息:
We are using "app_easy_gap_non_connectable_advertise_start_create_msg" which sets up cmd->intv_max and cmd->intv_min identically
cmd->intv\u max=user\u non\u connectable\u播发_配置intv;
cmd->intv_min = user_non_connectable_advertise_conf.intv;
True Random number Generator is enabled in "da1458x_config_advanced.h"
#定义CFG\u TRNG
希望你有一个解决方案,因为这是一个真正的问题的应用程序。
Best Regards,
西亚诺霜
Denmark
Hi ciano,
Please make sure that the image that is downloaded in the 580 has the CFG_TRNG defined, i tested your scenario with the SDK 5.0.2.1 in a modified template example advertising in non-connectable mode (different advertising strings, different bd_addresses and same advertising intervals ) and by connecting the two reset pins i issue a reset at the two boards at the same time. I can properly see the boards with a sniffer and with a normal android BLE app. The only way i could get one device and corrupted advertising data is when the CFG_TRNG is undefined. Please check the sniffer attachments when TRNG is defined and when its not.
谢谢你的对话
嗨对话框
有一件事我忘了提,那就是我正在用计时器每秒钟重新启动一次广告。我每次都会更改广告数据。我用用户\非\可连接\广告设置了广告_配置intv=16000,即10秒。所以我的有效间隔是由我的1秒计时器决定的,在这里我停止并重新启动广告。
Now my question is: Will there still be added a random 0-10 ms delay to the advertisement, when the bluetooth stack has its advertisment restarted every second?
If the random delay is not added in this case, then this could explain the collisions I experience of the advertisements in the air.
期待你的回答。
Best Regards,
齐亚诺
Hi ciano,
So you are advertising 1 advertising packet every 1 second and this is defined by an elapsed timer that issues an advertise start. That explains what you are experincing, the first advertising message hasn't a delay applied to it. After the app_adv_start is issued the advertising string is transmited in the same time as the other DUT after that the next advertising event is re-scheduled with a random delay, so in the first message you send there is a collision between the two advertising messages. A work around of what you are experiencing is to decrease the advertising interval so that the second advertising string is transmitted within the 1 second interval and the random delay to insert the advertising interval so that the two advertising string doesnt collide.
你可以数一数你已经发出的广告字符串,并在第二个发出的广告字符串中停止广告(这将被正确接收),你可以捕捉广告的完成情况并启动计时器,当计时器结束时,再次开始广告。
Here is a small snippet on how you can count your advertising events:
枚举arch\u main\u loop\u callback\u ret count\u adv\u events(void)
{
uint8_t temp_last_ble_event;
temp_last_ble_event=arch_last_rwble_evt_get();
if (app_last_ble_event != temp_last_ble_event)
{
app\u last\u ble\u event=临时\u last\u ble\u事件;
if(app\u last\u ble\u event==ble\u EVT\u END)
adv_count++;
if (adv_count == 2)
{
adv\ U计数=0;
app_easy_gap_advertise_stop();
}
}
回到睡眠状态;
}
谢谢你的对话
谢谢你的回答。
One more question:
据我所知,那么在10ms的范围内添加到广告间隔I的随机延迟是否可以将这个范围增加到500或1000ms?
目前,我已经做到这一点手动应用程序定时器设置从一个固定的延迟加上随机(TRNG)时间从-500毫秒到500毫秒。。。这及时地传播了广告,我几乎看不到与许多FOB的碰撞。
Best Regards,
西亚诺霜
Denmark
Hi ciano,
广告操作中插入的延迟根据BLE规范位于ROM代码中,您不能更改它。
谢谢你的对话
非常感谢你提供的信息。
I have no more questions for now.
Best Regards,
西亚诺霜
Denmark.