Implement Bonding in master role

⚠️
你好。。谢谢你来参加论坛。令人兴奋的消息!我们现在正在移动到我们的新论坛平台,将提供更好的功能,并包含在主对话网站的过程。所有帖子和账号都已迁移。我们现在只接受新论坛上的流量-请在//www.xmece.com/support. 我们将在未来几天内修复bug/优化搜索和标记。
7个职位/0个新职位
最后一篇文章
dhirajp15型
离线
最后一次见到:2年1个月前
已加入:2016-06-08 15:26
Implement Bonding in master role

嗨,对话,
我有两个由da14583组成的设备BLE-central和peripheral在连接上交换数据。我想实现绑定,所以我在peripheral侧做了教程5 BLE-u-security中建议的更改_example.pdf. 但在中间部分,我找不到实现绑定的过程,我也查看了sps\u主机示例,但没有实现。穿过RW-BLE-GAP-IS.pdf 我知道需要使用GAPC\u BOND\u CMD命令从主机端启动粘合程序。我已通过GAPC\u security\u CMD请求外围设备上的安全性,并成功接收到主设备上的GAPC\u security\u IND指示。我需要帮助编写一个程序,以便在安全请求时从主设备启动绑定。
Thanks,

Regards,
迪拉杰

设备:
MT\u对话框
离线
最后一次见到:2个月6天前
工作人员
已加入:2015-06-08 11:34
你好,dhirajp15,

你好,dhirajp15,

Unfortunatelly there is no example that will guide you through the security procedure of a central, but as the document indicates you will need to issue a GAPC_BOND_CMD in order to start the procedure, so you can just send the GAPC_BOND_CMD as soon as the handler for the GAPC_SECURITY_IND is triggered. So you can just create a callback that will send the GAPC_BOND_CMD, just like below:

结构gapc\u bond\u cmd*msg;
msg=(struct gapc\u bond\u cmd*)KE\u msg\u ALLOC(gapc\u bond\u cmd,TASK\u gapc,TASK\u APP,gapc\u bond\u cmd);

然后在.app\u on\u security\u req\u ind钩子中附加回调。

Thansk MT\u对话框

dhirajp15型
离线
最后一次见到:2年1个月前
已加入:2016-06-08 15:26
嗨,MT\u Dialog,

嗨,MT\u Dialog,
我使用Justworks安全级别与以下配置绑定:
静态const struct security\u configuration user\u security\u configuration={
.oob=GAP\u oob\u AUTH\u DATA\u NOT\u存在,
.key\u size=键长度,
.iocap=间隙IO CAP NO输入NO输出,
.auth = GAP_AUTH_REQ_NO_MITM_BOND,
.sec_req=间隙\u SEC1 \u NOAUTH \u对\u ENC,
.ikey\u dist=间隙\u KDIST\u SIGNKEY,
.rkey\u dist=间隙\u KDIST\u ENCKEY,
.tk公司={
.key={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},
},
csrk先生={
.key={0xAB,0xAB,0x45,0x55,0x23,0x01,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},
},
};
我在韩user_catch_rest GAPC_BOND_CMD实现dler cb on GAPC_SECURITY_IND as suggested. So the peripheral gets a pairing request and it provides a pairing response .After this I get app_on_pairing_succeded callback on central device .I also receive GAPC_BOND_IND with msg_param->info==GAPC_LTK_EXCH here I initiate a GAPC_ENCRYPT_CMD sending the long term key received previously.Further I receive app_on_encryption_ind callback followed by GAPC_CMP_EVT with msg_param->operation==GAPC_ENCRYPT and msg_param->status =00 which indicates that encryption is completed with no errors .Is this the correct way to implement bonding on central device?Are there any more commands I am missing?

谢谢,
regards,
迪拉杰

MT\u对话框
离线
最后一次见到:2个月6天前
工作人员
已加入:2015-06-08 11:34
你好,dhirajp15,

你好,dhirajp15,

如果我正确理解了您描述的顺序,当GAPC\u BOND\u IND随GAPC\u LTK\u EXCH一起提供时,这意味着设备获得了LTK密钥,当您收到该密钥时,您应该存储它,而不是启动GAPC\u ENCRYPT\u CMD(空中分发的密钥种类取决于应用程序)。GAPC\u ENCRYPT命令用于在绑定过程结束且配对成功后加密链接,如果您希望使用LTK而不是TK(这是链接的当前加密)加密链接,则可以发送加密命令。例如,您可以在应用程序中发送加密命令。

谢谢你的对话

dhirajp15型
离线
最后一次见到:2年1个月前
已加入:2016-06-08 15:26
嗨,MT\u dialog,

嗨,MT\u dialog,
谢谢你的帮助。我做了建议的改变,成功地完成了粘合过程。现在重新连接,如果我不想重复切割过程(假设我有粘合数据-LTK,Ediv,randnb),RW\u BLE\u GAP_IS.pdf 建议:
“当收到安全请求指示时,链路的主机可以决定启动配对或加密
根据债券数据”--第95页。
那么在主机端,如果我收到GAPC\u SECURITY\u IND,我是否应该检查是否要发出GAPC\u BOND\u CMD或GAPC\u ENCRYPT\u CMD(以前的绑定)??
谢谢,
regards,
迪拉杰

MT\u对话框
离线
最后一次见到:2个月6天前
工作人员
已加入:2015-06-08 11:34
你好,dhirajp15,

你好,dhirajp15,

由于绑定完成,然后设备断开连接,这意味着两个设备都已绑定并保留其绑定数据,因此无需再次执行绑定过程以重新连接安全性。因此,当设备被绑定时,中央应该发出一个加密命令来加密链接,所以是的,主设备应该检查它是否被绑定,以便发出绑定命令或加密命令。

谢谢你的对话

dhirajp15型
离线
最后一次见到:2年1个月前
已加入:2016-06-08 15:26
嗨,MT\u Dialog,

嗨,MT\u Dialog,
Thanks for the help!
Regards,
迪拉杰