您好:
我们想在DA14580官方信标样例的基础上增加同时扫描接收广播包的功能。我们尝试在default_app_on_set_dev_config_complete中发送如下参数的GAPM_START_SCAN_CMD命令,开启扫描,结果这条命令回应在gapm_cmp_evt_handler中回应GAPM_SCAN_PASSIVE,出错代码GAP_ERR_COMMAND_DISALLOWED。请问要如何修改能在灯塔样例工程中能同时扫描接收广播包。
谢谢!
* app_easy_gap_start_scan_create_msg(无效)
{
//为GAP分配消息
if (scan_cmd == NULL)
{
struct gapm_start_scan_cmd * cmd;
cmd = app_start_scan_msg_create ();
scan_cmd = cmd;
cmd - > op。代码= GAPM_SCAN_PASSIVE;
cmd - > op。addr_src = GAPM_PUBLIC_ADDR;
cmd - >间隔= 10;
cmd窗口- > = 5;
cmd - >模式= GAP_OBSERVER_MODE;
cmd - > filt_policy = SCAN_ALLOW_ADV_ALL;
cmd - > filter_duplic = SCAN_FILT_DUPLIC_DIS;
}
返回scan_cmd;
}
设备:
您好,
DA14580不支持同时成为外围(灯塔)和中央(扫描)两种角色,具体可参见相关帖子:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software-dialog-%E2%80%9Csmartbond%E2%80%9D%E7%B3%BB%E5%88%97%E4%BD%8E%E5%8A%9F%E8%80%97%E8%93%9D%E7%89%99%E2%80%94%E8%BD%AF%E4%BB%B6/da14580-10
谢谢您的支持!
按照样例程序,已经可以控制程序在灯塔和扫描之间切换。