BLE上的Android MIDI:MidiManager openBluetoothDevice方法的结果始终有效

问题描述

在android应用中,我必须处理蓝牙midi设备连接。除了那种情况,一切都工作正常:

  • 我扫描蓝牙设备。有一个结果。
  • 我关闭了相应的物理蓝牙设备。
  • 我尝试使用之前从扫描中收到的地址,使用MidiManager上的openBluetoothDevice方法连接到已关闭的设备。

结果:

  • 由于设备未连接(物理设备已关闭),我希望从OnDeviceOpenedListener的回调中收到空的MidiDevice。
  • 相反,使用看起来无效的非null MidiDevice调用回调OnDeviceOpenedListener。

有没有办法知道在这种情况下连接是否失败?

// try to pair a bluetooth device that is switched off
midiManager.openBluetoothDevice(bluetoothDevice,new MidiManager.OnDeviceOpenedListener() {
       @Override
       public void onDeviceOpened(MidiDevice device) {
       // should receive a null device
       }

}


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...