“无法加密连接"与BlueZ外设和iOS [英] "Failed to encrypt the connection" with BlueZ peripheral and iOS

查看:119
本文介绍了“无法加密连接"与BlueZ外设和iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作树莓派蓝牙外围设备,因此我尝试运行BlueZ示例"example-gatt-server".和示例广告"同时.然后与我的手机通信.但是我得到无法加密连接,连接意外超时".在我的带有nrf connect应用程序的iOS上.

I'm trying to make a raspberry pi bluetooth peripheral, so I try running the BlueZ example "example-gatt-server" and "example-advertising" at the same time. Then communicate it with my phone. But I got "Failed to encrypt the connection, the connection has timed out unexpectedly." on my iOS with nrf connect app.

我正在使用iOS 14,BlueZ 5.50,Raspberry Pi 4,Raspberry Pi OS Stretch

I'm using iOS 14, BlueZ 5.50, Raspberry Pi 4, Raspberry Pi OS Stretch

推荐答案

我建议您创建自己的GATT服务器,然后通过bluetoothctl工具作为外围设备进行广告宣传,而不是使用现成的示例.您可以按照以下顺序进行操作:-

Instead of using ready made examples, I recommend that you create your own GATT server and then advertise as a peripheral through the bluetoothctl tool. You can do this through the following sequence:-

#bluetoothctl
[bluetoothctl] menu gatt
[bluetoothctl] register-service 0xFFFF # (Choose yes when asked if primary service)
[bluetoothctl] register-characteristic 0xAAAA read       # (Select a value of 1 when prompted)
[bluetoothctl] register-characteristic 0xBBBB read,write # (Select a value of 0 when prompted)
[bluetoothctl] register-characteristic 0xCCCC read       # (Select a value of 2 when prompted)
[bluetoothctl] register-application # (This commits the services/characteristics and registers the profile)
[bluetoothctl] back
[bluetoothctl] advertise on

请查看以下链接,以获取有关如何设置自己的外围设备的更多信息:-

Have a look at the following links for more information on how to set up your own peripheral:-

这篇关于“无法加密连接"与BlueZ外设和iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆