Implement Bonding in master role

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
7个帖子/ 0新
最后一篇
dhirajp15.
离线
最后一次露面:2年1个月前
加入:2016-06-08 15:26
Implement Bonding in master role

嗨对话框,
我有两个设备BLE中央和外设由DA14583交换连接数据.I希望实现绑定,因此我在Tutorial_5 BLE_Security_example.pdf中提出的外围方面的更改。但在中央方面,我找不到实施绑定的过程。我也经过SPS_HOST榜样但没有实现。通过RW-BLE-GAP-IS.PDF我知道需要使用命令从主侧发起绑定程序:GAPC_BOND_CMD。我通过GAPC_SECURITY_CMD请求外设的安全性,并成功接收主站的指示GAPC_SECURY_IND .I需要帮助编写一个过程从安全请求中从主设备启动绑定程序。
Thanks,

Regards,
Dhiraj.

设备:
mt_dialog.
离线
最后一次露面: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:

struct gapc_bond_cmd * msg;
msg =(struct gapc_bond_cmd *)ke_msg_alloc(gapc_bond_cmd,task_gapc,task_app,gapc_bond_cmd);

然后在.app_on_security_req_ind挂钩中附加回调。

Thansk mt_dialog.

dhirajp15.
离线
最后一次露面:2年1个月前
加入:2016-06-08 15:26
嗨mt_dialog,

嗨mt_dialog,
我正在使用jortworks安全级别与flowning配置绑定:
static const struct security_configuration user_security_configuration = {
.oob = gap_oob_auth_data_not_present,
.key_size = key_len,
.iocap = gap_cap_no_input_no_output,
。auth = GAP_AUTH_REQ_NO_MITM_BOND,
.sec_req = gap_sec1_noauth_pair_enc,
.ikey_dist = gap_kdist_signkey,
.rkey_dist = gap_kdist_enckey,
.tk = {
.key = {0x0,0x0,0x0,0x0.0x0.0x0,0x0,0x0.0x0,0x0,0x0,0x0.0x0.0x0,0x0,0.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,
Dhiraj.

mt_dialog.
离线
最后一次露面:2个月6天前
职员
加入:2015-06-08 11:34
嗨Dhirajp15,

嗨Dhirajp15,

如果我正确理解您描述的序列是什么,当GAPC_BOND_IND附带GAPC_LTK_EXCH时,它意味着设备获取LTK密钥,当您收到该密钥时,您应该存储它,而不是启动GAPC_ENCRYPT_CMD(分布了什么样的键在空中取决于应用程序)。GAPC_ENCRYPT命令是为了在绑定过程结束后加密链路,并且配对已成功,如果您想加密与LTK而不是TK(这是链接的当前加密)加密链接(这是链接的当前加密),然后您可以发送加密命令。例如,您可以在app_on_pairing_succeded中发送encryption命令。

谢谢mt_dialog.

dhirajp15.
离线
最后一次露面:2年1个月前
加入:2016-06-08 15:26
嗨mt_dialog,

嗨mt_dialog,
谢谢您的帮助。我做了建议的变化,并能够成功完成绑定过程。现在在重新连接时,如果我不想重复判决程序(假设我有绑定数据显示 - LTK,EDIV,RANDNB),则RW_BLE_GAP_IS.PDF建议:
“当接收到安全请求指示时,链接的主机可以决定启动配对或加密
根据其债券数据“。 - - 页95。
因此,如果我收到gapc_security_ind,则在主侧,我应该保留是否发布eapc_bond_cmd或gapc_encrypt_cmd(以前的绑定)??
谢谢 ,
regards,
Dhiraj.

mt_dialog.
离线
最后一次露面:2个月6天前
职员
加入:2015-06-08 11:34
嗨Dhirajp15,

嗨Dhirajp15,

由于键合完成,然后断开设备,这意味着两个设备都被绑定并保留其键合数据,因此不需要再次执行键合过程以便重新连接安全性。因此,当设备绑定时,中央应发出ECRYPORTION命令才能加密链接,因此是肯定的主机应检查其绑定是否键入键合命令或加密命令。

谢谢mt_dialog.

dhirajp15.
离线
最后一次露面:2年1个月前
加入:2016-06-08 15:26
嗨mt_dialog,

嗨mt_dialog,
Thanks for the help!
Regards,
Dhiraj.