Hi Dialog,
我这边使用了 sps_device 和 sps_host 的例程,想主机从机一对一配对,请指导一下,代码上做什么改动呢?目前在 sps_device 中做了以下的改动:
1、app.c 中 cmd->op.code 设为定向广播模式。
static struct gapm_start_advertise_cmd* app_easy_gap_undirected_advertise_start_create_msg(void)
{
// Allocate a message for GAP
if (adv_cmd == NULL)
{
struct gapm_start_advertise_cmd *cmd;
cmd = app_advertise_start_msg_create();
adv_cmd = cmd;
cmd->op.code = GAPM_ADV_DIRECT;
cmd->op.addr_src = user_adv_conf.addr_src;
cmd->op.renew_dur = user_adv_conf.renew_dur;
if (user_adv_conf.addr_src == GAPM_PROVIDED_RND_ADDR)
{
........
........
}
2、app_default_handlers.c 里做了如下的修改
void default_advertise_operation(void)
{
if (user_default_hnd_conf.adv_scenario==DEF_ADV_FOREVER)
app_easy_gap_directed_advertise_start();
else if (user_default_hnd_conf.adv_scenario==DEF_ADV_WITH_TIMEOUT)
app_easy_gap_directed_advertise_with_timeout_start(user_default_hnd_conf.advertise_period,NULL);
}
做了上述修改后,烧代码进芯片,用抓包工具进行抓包,没抓到广播数据。请问这样改是有什么错误吗? sps_host 中还需要做什么修改呢?