嗨对话支持。
我使用SDK 5.0.3对于DA14580设备。设备在中央扫描模式下工作,应报告所有广告消息。设备始终处于运行模式,不会以任何睡眠模式进入。
经过一段时间,应用程序停止接收广告报告。
我使用IO切换为每份报告来确定这种情况。我并不成功地找到麻烦的原因,因为任何断点或调试暂停原因会恢复正常操作。
这个问题的重要原因 - 当前任务的缺失中断。
When i used the timer with empty handle - this repairs the issue.
我发现了同样的事情我想:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...
你能帮我了解情况吗?
报告函数是:
void app_adv_report_ind_func(struct gapm_adv_report_ind const *param)
{
gpio_setactive(Orange_led_port,Orange_led_pin);
__nop();
__nop();
__nop();
__nop();
gpio_setinactive(Orange_led_port,Orange_led_pin);
返回;
}
扫描参数是:
static const struct scan_configuration user_scan_conf = {
///操作代码。
.code = gapm_scan_passive,
///自己的BD地址源
.ddr_src = gapm_public_addr,
//扫描间隔
.Interval = app_scan_time_window_ms,
// Scan window size
.window = APP_SCAN_TIME_WINDOW_MS,
///扫描模式
.mode = gap_observer_mode,
///扫描过滤策略
.filt_policy = scan_allow_adv_all,
///扫描重复过滤策略
.filter_duplic = SCAN_FILT_DUPLIC_DIS
};
嗨Vadym,
首先,您不必从Void函数返回,除非您在观察者模式下扫描以外,如果您获得广告报告,请您确定这一点,用于检查LED切换吗?我问因为眨眼会发生得太快,因为看到任何东西,你可以检查你是否通过打印指示来检查广告迹象(确保它非常短,因为自打印太多的数据可能导致由于过多的内存而导致复位分配,因为您也使用滤波器进行了打印禁用复制品),如果您有Pro Dev套件,则可以检查设备是否扫描,并且您可以将Arch_set_pxact_gpio()函数放在.app_on_adv_report_ind回调中并检查光标是否检查出现在电力分析器上。还要确保您尝试跟踪的任何设备都确实是广告。
I dont understand what kind of timer have you used and the issue is fixed, if you could give some extra details perhaps i will be able to understand what is going on.
谢谢mt_dialog.
亲爱的支持你好。
根据空白的回报:你绝对是正确的。它仍然来自真实的项目代码,它不应干扰函数执行。
2.根据LED眨眼,您也不眨眼。我不使用真实的LED,但是连接到引脚的范围。如果您注意到,我不抱怨它根本不起作用。
我没有一个专业的开发套件。
我在我的空间中绝对有至少5-10个BLE设备,每个〜100ms都会广告。
5.我没有看到我使用gapm_reset_cmd或gapm_cancel_cmd。添加定时器后,设备不会停止操作。
6. I used the timer with empty body. With the timer, the device doesn't stop to receive advertising reports.
I also notice that, when the receiving hangs on and I ask something in UART (in real project i have UART communication, for example keepalive command), the device returns to normal operation. Adding any break point to code also returns the device to normal operation - this is does debugging very hard and this is a reason, that i used the IO to understand what is happen.
我用空体使用了计时器。当我使用计时器时,设备不会停止接收广告报告。
使用的计时器:
int app_led_indication_handler(ke_msg_id_t const msgid,
const struct app_led_indication_evt * param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
ke_timer_set(APP_LED_INDICATION_TIMER, TASK_APP, 1000);
return(ke_msg_consumed);
}
关于,Vadym。
在额外时,我错误地按下网站按钮“接受此答案。如果您发现答案有用,请单击此链接”。
现在,我无法取消此操作。通常,有办法取消操作或确认问题。
Thanks.
嗨Vadym,
对不起,无法撤消接受答案。
关于你的问题,我无法找到任何再保险lation between the fact that you have an empty timer and this prevents the device from stop reporting the advertising strings that are scanned, it seems kind of weird, even if the device stops scanning at some point and the timer when it hits wakes it up, it should trigger a function in order to start the device to start scan again, do you have any other devices to test ? At least on my side i can test the Observer mode and i dont see it stopping (is there a time limit when you see that the device isn't reporting anymore ? for example a specific amount of seconds or minutes or even hours ?). If you see that the fw stops reporting advertising strings, i would suspect that the device for some reason it stops scanning, since you dont have a pro kit in order to attach Smart Snippets (which would help a lot for debugging something like this), i would check if the device is scanning, in order to do that you can toggle the GPIO everytime you have a RX interrupt, so by applying the below snippet you will be able to track each ending of the BLE scanning:
uint8_t app_last_ble_event;
枚举arch_main_loop_callback_ret user_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)
arch_set_pxact_gpio();
}
return GOTO_SLEEP;
}
还跟踪app_on_scanning_complete回调并检查是否有某些点调用。
谢谢mt_dialog.