ant*_*afe 11 android bluetooth bluetooth-lowenergy bluetooth-peripheral pairing
我正在编写一个通过BLE连接到物理设备的Android应用程序.Android应用程序将充当外围角色,而设备是中心.设备I/O功能也设置为NoInputNoOutput(ble_cmd_sm_set_parameters(0, 8, sm_io_capability_noinputnooutput))
建立连接的流程是:
bluetoothManager.openGattServer()Sent Pairing Request: AuthReq与Secure Connection Flag = 1后者Secure Connection Flag = 0有关(有关安全连接标志的更多信息,请参阅蓝牙配对第4部分)当从Android Studio logcat读取输出时(如果是三星设备),我得到这些日志:
01-31 15:21:53.322 D/BluetoothAdapter: isSecureModeEnabled
01-31 15:21:53.322 D/BtConfig.SecureMode: isSecureModeOn:false
01-31 15:21:53.325 D/BluetoothAdapter: STATE_ON
01-31 15:21:53.325 D/BluetoothLeAdvertiser: start advertising
不确定SecureMode是否与我们提到的SecureConnection相同.
据我所知,配对是BLE Secure Connections,采用JustWorks模式.但似乎并非所有的Android设备都支持它(你能否确认一下我的想法?).或者,我们如何强制后一个设备也有配对对话框?
一个重要的是,我有一个具有相同连接流和相同物理设备的iOS应用程序,它确实显示了配对对话框.
| 归档时间: |
|
| 查看次数: |
393 次 |
| 最近记录: |