Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/200.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用颤振蓝连接到BLE设备时出现问题_Android_Flutter_Bluetooth Lowenergy - Fatal编程技术网

Android 使用颤振蓝连接到BLE设备时出现问题

Android 使用颤振蓝连接到BLE设备时出现问题,android,flutter,bluetooth-lowenergy,Android,Flutter,Bluetooth Lowenergy,我是一个新手,我想测试一下Flitter Blue提供的一些BLE功能。我已经启动并运行了示例应用程序,它在我周围找到了很多设备。问题是我无法连接到它们中的任何一个。我目前正在使用第二部手机来模拟BLE外设,所有其他软件(如nRF Connect for Mobile)都能够连接到外设并读取它提供的数据。当尝试连接到设备时,Flatter Blue示例应用程序只是卡在断开状态 以下是尝试连接时的典型控制台输出: D/BluetoothGatt( 6359): connect() - device

我是一个新手,我想测试一下Flitter Blue提供的一些BLE功能。我已经启动并运行了示例应用程序,它在我周围找到了很多设备。问题是我无法连接到它们中的任何一个。我目前正在使用第二部手机来模拟BLE外设,所有其他软件(如nRF Connect for Mobile)都能够连接到外设并读取它提供的数据。当尝试连接到设备时,Flatter Blue示例应用程序只是卡在断开状态

以下是尝试连接时的典型控制台输出:

D/BluetoothGatt( 6359): connect() - device: 73:B9:9F:25:67:DC, auto: true
D/BluetoothGatt( 6359): registerApp()
D/BluetoothGatt( 6359): registerApp() - UUID=44fdc1ff-3804-4ae2-ab52-3f3b6eb31e17
D/BluetoothGatt( 6359): onClientRegistered() - status=0 clientIf=7
D/BluetoothGatt( 6359): onAutoConnectionStatusCb()status =10
D/BluetoothGatt( 6359): close()
我已经成功地连接到模拟外围设备好几次,首先通过不同的应用程序连接,然后“连接”颤振应用程序。这是输出:

D/BluetoothGatt( 6359): connect() - device: 73:B9:9F:25:67:DC, auto: true
D/BluetoothGatt( 6359): registerApp()
D/BluetoothGatt( 6359): registerApp() - UUID=201eaf3d-ab8a-402e-9cbf-232527fa53a8
D/BluetoothGatt( 6359): onClientRegistered() - status=0 clientIf=8
D/BluetoothGatt( 6359): onAutoConnectionStatusCb()status =10
D/BluetoothGatt( 6359): onClientConnectionState() - status=0 clientIf=8 device=73:B9:9F:25:67:DC
D/FlutterBluePlugin( 6359): [onConnectionStateChange] status: 0 newState: 2
D/BluetoothGatt( 6359): discoverServices() - device: 73:B9:9F:25:67:DC
I/flutter ( 6359): connected!
D/BluetoothGatt( 6359): onSearchComplete() = Device=73:B9:9F:25:67:DC Status=0
D/FlutterBluePlugin( 6359): [onServicesDiscovered] count: 3 status: 0
我已经了解到,在退出其他应用程序后,连接未正确关闭,我已确保打开/关闭蓝牙和位置服务,以及卸载可能干扰Flatter应用程序的其他应用程序。我已经尝试在连接时允许更长的超时时间,以确保应用程序在能够真正连接之前不会关闭连接,除此之外,我有点迷路了,无法确定可能出现的问题


编辑:只是想补充一点,这似乎是一个与可仿真外围设备相关的问题。我已经能够使它与AT-09模块和ESP32板一起工作,没有任何问题

你也问过吉特回购。我在这里张贴这封信以供参考。