亲爱的对话框
在SDK5.0版本中调用app_easy_gap_directed_advertise_start方法不能进行定向广播,查看电流情况发现先广播了3秒钟然后就睡眠下去了
/ * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
为定向连接创建广告消息。
* @return gapm_start_advertise_cmd指向广告消息的指针
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* /
静态结构gapm_start_advertising se_cmd* app_easy_gap_directed_advertising se_start_create_msg(void)
{
//为空白分配一条消息
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 s退出广告状态。
也就是说1.28年代以内没有收到连接的请求,就不再发定向广播包了。