您好,
我想通过Android手机的蓝牙与CC2541建立通信,从网上下载的Android示例看,手机上的蓝牙只能与一个BLE设备建立连接(connectGatt(mContext, false, mGattCallback))。现在我想有多个BLE终端设备,请问要怎样使android上的蓝牙与多个设备建立连接,或是以怎样的方式连接会让传输效率最高???
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
我想通过Android手机的蓝牙与CC2541建立通信,从网上下载的Android示例看,手机上的蓝牙只能与一个BLE设备建立连接(connectGatt(mContext, false, mGattCallback))。现在我想有多个BLE终端设备,请问要怎样使android上的蓝牙与多个设备建立连接,或是以怎样的方式连接会让传输效率最高???
Yan,
您好,我看SensorTag的android代码将Connect在OnDeviceLick中调用的,我原以为只能是点击某个DeviceList后就连接该BLE设备。按照您上面说的,是不是对每个device 的address都可以用final BluetoothDevice device = mBtAdapter.getRemoteDevice(address);mBluetoothGatt = device.connectGatt(this, false, mGattCallbacks);这两个函数来建立同时与多个BLE设备的连接而不会互相干扰? 当多个BLE设备同时向Android手机发送数据时,最终都是在同一个回调mGattCallbacks中处理?