你好,
以下背景(使用SDK 5.0.4):
we have set up one advertiser that transmits 5 messages in a burst on same channel, every 2 seconds. (on ble_powered callback we wait for a transition from BLE_EVT_TX to BLE_EVT_END and then we cancel the transmission with app_advertise_stop_op() and then start it again upon undirect_complete callback). This works, we have verified with current measurments that they are transmitted instantly and all messages are received by a CENTRAL device and everything is fine, BUT the messages are delayed upon reception, the .app_on_adv_report_ind in the CENTRAL device does not pass on the message when it arrives. for example:
外围发送消息1 2,3,4和5,其中大约10ms中的约10ms,然后等待2秒将导致以下内容:
peripheral transmit: 1 (10ms) 2 (10ms) 3 (10ms) 4 (10ms) 5 ( about 2 seconds ) 1 (10ms) 2 (10ms) 3 (10ms) 4 (10ms) 5 ( 2 seconds ) 1....
中央接收:1,2,3(约2秒)4,5,1,2,3,4(2秒)5,1 ....
消息4,5和下一个周期消息5延迟几秒钟!如果将另一个外设添加到此(或在同一频道上发送的其他BT设备),您会注意到消息与这些消息接收到逾越节。这意味着如果你在空中有很多BT流量的地方,你很可能不会发现这个错误。
消息似乎被SDK收到并收集,但直到有足够的消息排队或类似的消息。你能验证这个吗?或者让我知道是否有一种方法来强制SDK释放收到的消息?
2.请提供SDK的一些文件。记录非常糟糕!
3.修复支持站点的登录,每次登录时,我都必须按“请求新密码”。
嗨塞巴斯蒂安,
谢谢mt_dialog.
谢谢你的快速回复,
receiving is set to the following:
cmd-> op.code = gapm_scan_passive;
cmd->op.addr_src = GAPM_PUBLIC_ADDR;
cmd-> interval = llm_scan_interval_max;
cmd-> window = llm_scan_window_max;
cmd-> mode = gap_observer_mode;
cmd-> filt_policy = scan_allow_adv_all;
cmd-> filter_duplic = scan_filt_duplic_dis;
附加图像(logic_Analyzer_Image_describing_the_reception_problus.zip)显示了更“拥挤”环境中的接收(某些设备每80ms广告)。
第一行(蓝色)是消息的传输(当在外围设备中执行函数app_advertise_start_msg_send(cmd)时)
第二行(棕色)是回调函数.app_on_adv_report_ind在Central中执行。
The third line (red) is when the correct message is processed within the central device.
As you can see in the image, the peripheral transmits 4 messages (blue line, number 1. to 4.). They are received in portions (brown line, number 5. to 8. and 10. to 13.), the first three messages (number 5. to 7.) are some other advertisements, not for us, and our message is received as number 8. (and processed as number 9.), the rest (number 2. to 4. are delayed until number 13. has been received). Then they are processed as number 14. to 16.
2.至4的接收延迟直到接收到数字13.(或可能是扫描窗口的结尾,该窗口设置为10秒)。
Is there any way to release the messages 2. to 4. before number .13 has arrived? like sending a ke_message that triggers the release, or simulate the reception of the 2 messages or similar?
或者看接收,.app_on_adv_report_ind函数总是连续4次执行,这表明接收缓冲区是4个邮件大,可以将此消息减少到1条消息吗?
传输:是的,我们再次停止并重新开始,这会每4,5秒生成一次消息。
- >我输入了这些字母,然后按下了
没有注意到密码没有得到更新,因为用户没有注意到红色改变框告诉他们他们的密码与安全标准不匹配。
- >它被标记为强
Use their browsers automatic password suggestion, which is different to their new one.
- >我始终关闭了这个功能
误读密码或用户名
- >我甚至在节省后直接尝试。它仍然没有工作。
你有其他东西我可以尝试吗?
嗨塞巴斯蒂安,
谢谢mt_dialog.
你好mt_dialog,
是否有一种方法可以在扫描期间触发缓冲区中收到的消息的释放?例如:我可以以某种方式发出内部消息,以便堆栈相信它正在收到第4条消息,从而释放缓冲区?或者我可以以某种方式触发最早的扫描?
Or is there a way to setup a callback on a scan window ending, so that I can cancel it from there?
嗨塞巴斯蒂安,
否无法在扫描窗口结束之前释放缓冲区或强制设备直接指示此刻可用的数据,在扫描过程中的配置如何扫描在堆栈中运行,您只能接口它具有特定消息。关于一个通道上的扫描,您可以在获得BLE_EVT_END后立即实现该频道并强制扫描过程结束,可以在.app_on_ble_powered中实现,并使用ARCH_LAST_RWBLE_EVT_GET()检查无线电状态,您可以采取看下面的例子:
void user_app_on_ble_powered(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_last_ble_event = temp_last_ble_event;
if(app_last_ble_event == ble_evt_end)//如果上次的无线电事件是扫描事件(自扫描以来)
{
//停止扫描
struct gapm_cancel_cmd *cmd = app_gapm_cancel_msg_create();
//发送消息
app_gapm_cancel_msg_send(cmd);
}
}
}
Also make sure that there is some distance in the interval and window values that you will place in the scanning procedure, for example if the window is 5, then make sure that the interval should be at least 15 BLE slots in order for the device to be able to operate in between that period and retrieve your advertising events.
谢谢mt_dialog.
你好mt_dialog,
我现在已经实现了您的建议和自扫描重启(Gapm_cancel_cmd,等待回调,然后GAPM_START_SCAN_CMD)大约需要800μs,我们不会经常这样做,因此我将间隔设置为160(100ms)和窗口到155.这可以接受可接受的妥协,它几乎按预期工作。缓冲区中的消息在窗口端时释放,如预期,并由应用程序处理。这意味着我们现在有100ms的最大延迟接收消息,这远远优于之前。
But, after a while (30-60 seconds) the scan hangs somehow and does no longer receive messages at all. This seem to happen everytime we receive a 4th message (SDK buffer full) just right before (or during?) a window-end (so that the on_ble_powered callback with the BLE_EVT_END was delayed about 0,7ms). All 4 messages are sent to the application and soon thereafter we get the BLE_EVT_END as expected, we send GAPM_CANCEL_CMD, wait for callback and then GAPM_START_SCAN_CMD, exactly as every time, however from this point on we do not receive a single message. The BLE_EVT_END keeps coming as expected and we CANCEL/START_SCAN as every time, but still nothing is being received (did it change channel since we CANCELed to late? or did the buffer crash?).
所以首先,我们是否可以检查是否可以检查扫描是否已成功启动,并且它扫描第一个通道?带有状态或类似的回调?
Second, I tried to decreased the window to 150 (still having interval set to 160), then the hang effect (no longer receiving) does not happen any longer (ran it for 30 minutes). For me this indicates some kind of race condition and I would like to know how I can identify when it occurs and how I can repair it. Is this why you told me to keep the window slightly lower than the interval? Is this a known issue, can you elaborate?
嗨塞巴斯蒂安,
我推荐的,你实现的只是一种“傻瓜”堆栈的方式,以便只扫描一个频道,因为SDK不支持只扫描一个频道,所以这只是一个逆行支持的解决方法通常不建议,但它是我所知道的唯一方法,你可以实现你想要的东西。关于你的问题,这正是我建议在窗口中拥有完全长度的时间,因为显然是的,堆栈中存在竞争条件,并且在这项工作中有什么历史。因此,为了避免您必须确保在扫描窗口的末尾和扫描间隔之间提供一些空间,也这样做并不保证设备不会达到特定条件,这就是为什么当没有广告迹象时,在没有广告迹象的情况下,在没有广告迹象的情况下,稍微扫描到普通扫描,然后返回到一个通道的扫描,这将是明智的。但我再次警告你,这只是一个解决方法,而不是扫描一个频道的官方和验证的解决方案。
谢谢mt_dialog.
你好mt_dialog,
谢谢你的真诚答案,这不是我们希望的,并且在我们开始这个项目时,在我们启动这个项目时会有一些这个谈话真的很好。这个主题将拯救我们一周的试验和错误。请提出此提示,并撰写有关接收/扫描的文档。
无论如何,因为这个和其他几个类似的问题,我们决定与竞争对手一起去。
问候
Sebastian
ps. login still does not work, I had to press "Request new password" to write this.
嗨塞巴斯蒂安,
很抱歉听到这个消息,我会将您的评论传递给文档团队的支持者的管理员,无论如何希望一切顺利。
谢谢mt_dialog.