您好:
我们想在DA14580官方灯塔样例的基础上增加同时扫描接收广播包的功能。我们尝试在default_app_on_set_dev_config_complete中发送如下参数的GAPM_START_SCAN_CMD命令,开启扫描,结果这条命令回应在gapm_cmp_evt_handler中回应GAPM_SCAN_PASSIVE,出错代码GAP_ERR_COMMAND_DISALLOWED。请问要如何修改修改能在灯塔样例工程中间扫描接收广播包。
谢谢!
static struct gapm_start_scan_cmd * app_easy_gap_start_scan_create_msg(void)
{
//分配用于GAP的消息
if(scan_cmd == null)
{
struct gapm_start_scan_cmd * cmd;
cmd = app_start_scan_msg_create();
scan_cmd = cmd;
cmd-> op.code = gapm_scan_passive;
cmd-> op.addr_src = gapm_public_addr;
cmd->间隔= 10;
cmd->窗口= 5;
cmd-> mode = gap_observer_mode;
cmd-> filt_policy = scan_allow_adv_all;
cmd-> filter_duplic = scan_filt_duplic_dis;
}
返回scan_cmd;
}
设备:
您好,
DA14580不行时代成面(信标)和中央(扫描)两两角色,具体型可致帖子:
https://support.dialog-semicondiondiondiondumondiondum/forums/post/dialog-smartbond-bluetooth-low-energy-%2%80%93-software-dialog-%2%80%9csmartbond%ee2%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
谢谢您的支持!
按照样例程序,已经可以控制程序在信标和扫描之间切换。