简体   繁体   English

是否可以同时在 android 手机中进行蓝牙 SPP 连接和 BLE GATT 连接?

[英]Is it possible to have an Bluetooth SPP connection and BLE GATT connection in an android phone at the same time?

I am making application to connect an android based tablet to BLE GATT based temperature sensor and an Bluetooth SPP based printing device at the same time.我正在申请将基于 android 的平板电脑同时连接到基于 BLE GATT 的温度传感器和基于蓝牙 SPP 的打印设备。 Is this possible in android devices?这在 android 设备中是否可行? My purpose is to read the temperature sensor to my device and print the temperature with user data using the printing device.我的目的是将温度传感器读取到我的设备并使用打印设备使用用户数据打印温度。

Yes this should be possible.是的,这应该是可能的。 Classic Bluetooth and BLE are almost two different technologies so using them in parallel through the same app shouldn't be an issue.经典蓝牙和 BLE 几乎是两种不同的技术,因此通过同一个应用程序并行使用它们应该不是问题。 The only restriction you have when working with both is that you cannot scan for both classic and LE devices at the same time.使用两者时唯一的限制是您不能同时扫描经典设备和 LE 设备。 This is mentioned in the Android BLE Developer Guide:- Android BLE 开发人员指南中提到了这一点:-

You can only scan for Bluetooth LE devices or scan for Classic Bluetooth devices, as described in Bluetooth.您只能扫描蓝牙 LE 设备或扫描经典蓝牙设备,如蓝牙中所述。 You cannot scan for both Bluetooth LE and classic devices at the same time.您不能同时扫描蓝牙 LE 和经典设备。

You can find more information about this here:-您可以在此处找到有关此的更多信息:-

Yes, spp and ble are two different protocols.是的,spp 和 ble 是两种不同的协议。 Spp adopts Bluetooth socket, ble adopts GATT protocol, so it is OK, and I have practiced this technology this year spp采用蓝牙socket,ble采用GATT协议,这样就OK了,我今年也实践过这个技术

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM