没有收到连接。

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
9 posts / 0 new
最后一篇
insi.
离线
最后一次露面:3 years 4 months ago
加入:2017-07-20 15:50
没有收到连接。

你好,,
我有连接两个设备的问题。

Dev1(Slave)正在发送包含我想要在Dev2(中央)上的数据的广告。

Dev1 seems fine and sending regularily without any issue and its advertisement is reached on dev2 at call app_easy_gap_start_connection_to_set. I want to connect to the device and as I understand I call app_easy_gap_start_connection_to_set. And eventually after canceling the scanning the call app_easy_gap_start_connection_to is made.

扫描dev2是:

void user_scan_start(void)
{
printf_string(“扫描... \ r \ n”);
struct gapm_start_scan_cmd * cmd = ke_msg_alloc(gapm_start_scan_cmd,task_gapm,task_app,gapm_start_scan_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;

//发送消息
ke_msg_send(cmd);

//我们现在是可连接的
ke_state_set(task_app,app_connectable);
}

来自user_on_adv_report_ind的回调时,params是:
param-> eport.adv_addr_type:0x01和我预期的设备的正确MAC地址。

但是,我似乎没有得到任何连接,并且在一些调试后,我通过参数到GapM_CMP_EVT_Handler:操作= 0x12和Status = 0x40。状态清楚地表明传递了无效的参数。我在app_easy_gap_start_connection_to_set询问。但不是为什么。

我不能把头包裹在它周围。任何帮助都得到了赞赏。谢谢。

设备:
insi.
离线
最后一次露面:3 years 4 months ago
加入:2017-07-20 15:50
更新,

更新,

Changing MTU (to 23) and min and max connection interval to 100 ms gets me to GAP_ERR_PROTOCOL_PROBLEM. A guide for why this is would be very helpful.

mt_dialog.
离线
最后一次露面:2 weeks 3 days ago
职员
加入:2015-06-08 11:34
Hi insi,

Hi insi,

As far as i can tell from the facts and the errors that you are getting, the 0x12 is the cancellation of your connection due to invalid parameters, so what are the parameters that you are passing to the app_easy_gap_start_connection_to_set() ? There is no documentation in order for a device to act as a central but you can have a look at the DSPS reference design at the host side for this. The procedure that you are describing is proper, i dont see a relation between changing the intervals of the connection but, what is the GAP role of the device, is it GAP_OBSERVER_SCA? I am asking this because i can see that the device is scanning under GAP_OBSERVER_MODE (in the scanning function), and the GAP_ERR_PROTOCOL_PROBLEM is something that i can replicate with the above role configuration, and this is because you can't have a connection if the device is operating under obserever mode.

谢谢mt_dialog.

insi.
离线
最后一次露面:3 years 4 months ago
加入:2017-07-20 15:50
Thanks for your response!

Thanks for your response!

我改变了模式GAP_GEN_DISCOVERY but now I get GAP_ERR_INVALID_PARAM.

I am following the DSPS reference (as been indicated from other forum posts).

角色是:GAP_Central_mst。

我尝试使用app_easy_gap_start_connection_to_set的设备:

if(memcmp(param-> report.addr.addr,mac_addr,6)== 0)
{
printf_string(“连接。\ r \ n”);

app_easy_gap_start_connection_to_set(param-> report.adv_addr_type,
(uint8_t *)&param-> eport.adv_addr.addr,
ms_to_doubleslots(user_con_intv));
user_gapm_cancel();
}


静态void user_gapm_cancel(void)
{
/* Disable Advertising */
struct gapm_cancel_cmd *cmd = app_gapm_cancel_msg_create();
app_gapm_cancel_msg_send(cmd);
}


void user_on_scanning_completed(void)
{
printf_string(“扫描完成\ r \ n”);

app_easy_gap_start_connection_to();
}

我认为这是DSPS设计参考中引用的方式。我错过了什么?

JK_DIALOG.
离线
最后一次露面:4 days 6 hours ago
职员
加入:2016-08-22 23:07
嗨insi,为了连接

嗨INSI,为了连接中心必须能够看到广告,然后发送连接请求。因此,在连接时,这会启动临时扫描。如果将APP_EASY_GAP_START_CONNECTION_TO_SET(...)查看,则GAP_START_CONNECTION_CMD需要您的SCAN_INTERVAL,窗口等。因此,您将在此调用之后,您发送user_gapm_cancel(),这将停止此操作,因此取消回调。

如果删除此问题,请告诉我。

谢谢jk_dialog.

insi.
离线
最后一次露面:3 years 4 months ago
加入:2017-07-20 15:50
嗨jk_dialog,

嗨jk_dialog,
谢谢你的回答,但仍然没有去我害怕。我改变了模式Gap_gen_discoverable,

我有DSPS版本5.150.2。在该示例中它使用了user_gapm_cancel()just afterapp_easy_gap_start_connection_to_set( .. )。我有错误的版本还是关于时间设置有关间隔的时间设置?

我删除了user_gapm_cancel()10秒后(gapm_start_scan_cmd.intverval = 10.)流程是:
- 在此10S间隔期间,回调user_on_adv_report_ind(...)is called multiple times where now only once I 'register' the device to connect usingapp_easy_gap_start_connection_to_set(...)
- 10年代之后,回调user_on_scanning_completed()is correctly called.

我得到的流量和状态是:
gapm_cmp_evt_handler:
msgid:w0
1.1操作:11
1.2状态:45

扫描完成

gapm_cmp_evt_handler
msgid:w0
2.1 operation: 12
2.2状态:41

所以我在协议问题之前获得超时。使用时app_easy_gap_start_connection_to_set( .. )。,我给了变化user_con_intv.parameter from 12.5 (dsps host example) to 10000 (presuming 10 s. wild guess) by:

void user_on_adv_report_ind(struct gapm_adv_report_ind const * param)
{
if(memcmp(param-> report.addr.addr,mac_addr,6)== 0)
{
if(连接== false)
{
printf_string("Connecting to device\r\n");

app_easy_gap_start_connection_to_set(param-> report.adv_addr_type,
(uint8_t *)&param-> eport.adv_addr.addr,
ms_to_doubleslots(user_con_intv));
连接=真;
}
}
}
有任何想法吗?

JK_DIALOG.
离线
最后一次露面:4 days 6 hours ago
职员
加入:2016-08-22 23:07
Hi Insi,

Hi Insi,

我很抱歉,我不熟悉需求方host. I see now they are waiting for scanning to be finished piror to sending the connect command. BTW, a connection interval of 10 seconds is outside the BLE specification.

Can you send me your following configurations from the user_config.h file - user_scan_conf (if applicable) and user_central_conf?

谢谢JK.

insi.
离线
最后一次露面:3 years 4 months ago
加入:2017-07-20 15:50
你好,

你好,

间隔> 10s根据BLE规格。是的,你是对的,但此时我一直在尝试一切。我使用了MS_TO_DOUBLESLOTS(10000),它分为1.25,所以我认为我是安全的。

我只有user_config.h。我也只有其他配置。但是,这些从BLE_APP_BAREBONE示例中直截了当。但请羽会检查某些东西是否是奇数。

在DSP示例中struct central_configuration.has been defined but I cannot find this in the current (later) sdk. So I presume it's deprecated. Please correct me if I'm wrong.

再次感谢!

依恋:
JK_DIALOG.
离线
最后一次露面:4 days 6 hours ago
职员
加入:2016-08-22 23:07
嗨insi,我们可以尝试使用

嗨insi,我们可以尝试使用DSPS central example and modify this file with your peripheral's address? Let's see if a connection is possible in this manner.