亲爱的对话框
在SDK5.0版本中调用app_easy_gap_directed_advertise_start方法不能进行定向广播,查看电流情况发现先广播了3秒钟然后就睡眠下去了
/**
****************************************************************************************
* @brief创建定向连接的广告消息。
* @return gapm_start_advertise_cmd发布消息的指针
****************************************************************************************
*/
Static struct gapm_start_advertise_cmd* app_easy_gap_directed_advertise_start_create_msg(void)
{
//为GAP分配消息
if (adv_cmd == NULL)
{
struct gapm_start_advertise_cmd * cmd;
cmd = app_advertise_start_msg_create ();
adv_cmd = cmd;
如果(USER_CONFIG)
{
cmd - > op。代码= user_directed_advertise_conf.advertise_operation;
cmd - > op。addr_src = user_directed_advertise_conf.address_src;
cmd - > channel_map = user_directed_advertise_conf.channel_map;
cmd - > intv_min = 1100;
cmd - > intv_max = 1120;
cmd - > info.host。模式= GAP_GEN_DISCOVERABLE;
ASSERT_WARNING (user_directed_advertise_conf。advertise_operation = = GAPM_ADV_DIRECT);
cmd - > info.direct。addr_type = user_directed_advertise_target_address_conf.addr_type;
memcpy (cmd - > info.direct.addr。addr, user_directed_advertise_target_address_conf.addr BD_ADDR_LEN);
}
其他的
memcpy (cmd (void *) (void *) &default_dir_adv_cmd sizeof (default_dir_adv_cmd));
}
返回(adv_cmd);
}
请问,上面的配置哪里不正确;谢谢
定向广播依据蓝牙标准的说明,见4.4.2.4接入导演事件类型这一章节。
链路层必须在进入广告状态后不迟于1.28秒退出广告状态。
也就是说1.28年代以内没有收到连接的请求,就不再发定向广播包了。