在 Android 中尝试使用 BluetoothSocket.connet() 时,A2DP 会下降
因此,我正在使用利用 A2DP、HFP、AVRCP 和 SPP 的硬件设备。我遇到的问题似乎只出现在某些手机上,但我想解决它。
通过 Android (pair.connect) 连接硬件设备时,一切正常。如果我进入默认音乐播放器,它会正确播放并且 AVRCP 命令正常工作。
然而,在我正在开发的应用程序中,我使用 SPP。当我尝试使用 BluetoothSocket.connet() 方法时,它会导致硬件丢失 A2DP 和 AVRCP(媒体连接),我正在使用蓝牙聊天示例中的标准 bluetoothSerialService 类
private static final UUID SerialPortServiceClass_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
...
mmSocket = mmDevice.createRfcommSocketToServiceRecord(SerialPortServiceClass_UUID);
mmSocket.connect();
无法工作的手机,我am 测试包括 Droid X (2.2/2.3)、HTC Desire 2.2、Droid1 2.2。它适用于 Samsung Captivate 2.2 和 LG Optimus One 2.2
So I am working with a hardware device that utilizes A2DP, HFP, AVRCP, and SPP. The problem I am getting seems to be only on some phones but I want to resolve it.
While connecting the hardware device through Android (pair.connect) everything works fine. If I go into a default music player it streams correctly as well as AVRCP commands working.
However, in the app I am working on I use SPP. And when I try to use the BluetoothSocket.connet() method it causes the hardware to lose A2DP and AVRCP (media connections) I am using the standard bluetoothSerialService class from the Bluetooth Chat example
private static final UUID SerialPortServiceClass_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
...
mmSocket = mmDevice.createRfcommSocketToServiceRecord(SerialPortServiceClass_UUID);
mmSocket.connect();
The phones that don't work and I am testing include Droid X (2.2/2.3), HTC Desire 2.2, Droid1 2.2. And it works on Samsung Captivate 2.2 and LG Optimus One 2.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论