你好,
I am working on a heart rate sensor application and I have put together an app which is working well. ie, I am able to connect and view HR using any standard android BLE app.
I am using the BASIC development kit as peripheral slave for this purpose.
Now, I want to add some security so that only a user with a pin can connect to the peripheral. I know that this is vulnerable to brute force attack but that is okay.
这些是我对同样的变化。
void app_sec_init_func(void)
{
#if(ble_app_sec)
app_sec_env.auth =(gap_auth_req_mitm_bond);
#endif
}
void app_send_pairing_rsp_func(struct gapc_bond_req_ind *param)
{
struct gapc_bond_cfm * cfm = ke_msg_alloc(gapc_bond_cfm,ke_build_id(task_gapc,app_env.conidx),task_app,gapc_bond_cfm);
cfm->请求= gapc_pairing_rsp;
cfm->接受= true;
// OOB信息
cfm->data.pairing_feat.oob = GAP_OOB_AUTH_DATA_NOT_PRESENT;
//加密密钥大小
cfm->data.pairing_feat.key_size = KEY_LEN;
// IO capabilities
cfm->data.pairing_feat.iocap = GAP_IO_CAP_DISPLAY_ONLY;
//身份验证要求
cfm->data.pairing_feat.auth = GAP_AUTH_REQ_MITM_BOND;
//安全要求
cfm-> data.pairing_feat.sec_req = gap_sec1_auth_pair_enc;
//Initiator key distribution
cfm->data.pairing_feat.ikey_dist = GAP_KDIST_ENCKEY;
//响应者密钥分布
cfm-> data.pairing_feat.rkey_dist = gap_kdist_enckey;
KE_MSG_SEND(CFM);
}
由于CFM-> Data.pairing_feat.iocap = gap_cap_display_only;,Android设备应该弹出键盘时配对时输入引脚。
收到绑定请求时,应调用app_send_tk_exch_func()将设置静态引脚。
Now,the android when I try to pair using android device, the android device just says key mismatch without keyboard popping up. Also, I dont get GAPC_TK_EXCH request gapc_bond_req_ind_handler() for this case.
只要检查到CFM-> Data.pairing_feat.iocap = gap_cap_kb_only时;然后,当配对android设备显示应在外围设备(按预期上输入的随机配对代码时。但是,这不是我需要的。
你能告诉我什么是错的吗?
Thanks in advance.
你好,
任何有任何信息的人?
Regards,
Ashwin
嗨Ashwin,其中一支球队will start to take a look at this for your tomorrow. BR JE_Dialog
嗨Ashwin Rao.
If i understand correctly you would like to connect to your device by using a passkey which will be entered by the keyboard of your host (phone). Well, you can try changing the IO_Capabilities of your host to “Keyboard Only” in order to accomplish something like that. The device’s IO Capabilities should be NoInput/NoOutput since the device isn’t going to have any buttons and the PIN number would be fixed. The “Display capability” you mentioned I don’t think that will force the android device to display the keyboard.
谢谢mt_dialog.
你好,
谢谢你的回应。
根据
https://developer.bluetooth.org/TechnologyOverview/Pages/LE-Security.aspx
我提到的设置是正确的。
在您的帖子中,您提到的“设备的IO功能应该是noinput / nooutput,因为设备不会有任何按钮,并且PIN数将是固定的。”
But according to the above link, if that is done, then just works authentication mode will be used which is not what I need.
嗨Ashwin Rao.
我要离线寄给你一些东西,请看看,我希望它会帮助你。
谢谢mt_dialog.
我正在阅读这篇文章,寻求帮助/提示我如何能够做到这样的事情:
--On the peripheral, press a button, and for the next 2 seconds, broadcast and allow a connection from ANY android device that is scanning (looking for my service's UUID).
--Once that bond is established, turn off braodcasting, and now in the future, allow ONLY that android device to reconnect without the button press.
- 这似乎非常简单,但我找不到关于如何做到这一点的良好建议。
- 我已经在外设工作中拥有其他一切,只想添加它。
我应该在对话中提到你们的人,如果可能的情况,如果可能的情况下,如果可能的情况,您可能会更有帮助,并且可以在论坛中完全回答问题。我在这里读过的大部分帖子都没有得到答复,最终帖子来自对话主持人,他们说的是“我要脱机送你的东西......”我意识到有时候没有容易的答案对于你们所获得的许多问题,但它让我们遇到了一堆死胡同。
嗨Klim,谢谢你的反馈。我同意离线采取东西不是理想的:有时它是必要的(因为问题的长度/复杂性意味着它不能在这里处理),但总体而言,您的情绪是正确的,非常感谢:在线更好。我将有一个团队展望您的要求,我们会反馈。
谢谢&br je_dialog
谢谢je_dialog,我很高兴that you didn't see this as a negative comment, it was not meant to be. I will keep an eye on this thread and see if you guys have something that will point me in the right direction.
Hi Klim9531, Our initial thought is that :
Do you need to distinguish between an android and iOS device ?
这可以从键盘参考设计(剥离)构建。我们有一个关于我们可以分享的白名单的内部注意事项(这表明如何将设备添加到白名单中,有效地将制作已知连接列表,并且仅连接到白名单的那些)。
BR JE_DIALOG.
嗨je_dialog,
感谢输入,这里有一些澄清:
——客户端设备是否都无所谓Android or iOS (I currently have a fully functioning android app to interface with the device, I intend to built an iOS app soon). The android app scans for advertising devices and if it finds one with my name/service, I begin data transfer. This design is based on the Serial Port Service app.
你的想法。在DA14580中获取设备的蓝牙地址并在DA14580中与我的需求有关。这是我想要的序列:
1. DA14580 is powered on, has never before connected to a peer device (Android or iOS).
2. User presses a button on DA14580 (resets the whitelist, however this list is empty at first power-up).
3.用户启动Android / iOS应用程序,2.5秒内应用程序开始扫描任何BT设备,找到我的命名服务,并开始双向通信(此部分当前正在工作)。
4. DA14580查询Android / IOS设备并获取BD地址,然后在白名单中存储该地址。
5.通信继续,直到DA14580断电。
6.重新启动DA14580后,它现在只允许与白名单中的设备进行通信。
7.如果再次按下DA14580上的按钮,则清除白名单中的Android / IOS设备,DA14580重复上述#2。
如果您可以发布对话框的内部注意事项的链接 - 如何查询设备,然后将其BD地址添加到白名单 - 然后可以帮助我对此进行排序。
我会等你的回复,同时这样做,看看键盘参考设计。
谢谢你的帮助,klim9531
je_dialog.,
This is exactly what I wish to do with the SPS. Can you comment how this was resolved?
thanks,
Rich
嗨理查德,
Please check your previous post, i trust that it will cover your question.
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...
谢谢mt_dialog.