我們的應用程序需要編程將藍牙設備與android手機配對。這在我們測試過的所有手機上都可以正常工作......除了Nexus S.與Nexus S配對藍牙設備
它一直在使用此手機,直到我們從傳統(PIN碼)配對切換到較新的安全簡單配對(SSP)方法。
這是我得到當配對失敗日誌:
10-31 15:16:47.933: D/ShockboxBluetooth(9676): Created socket
10-31 15:16:47.953: E/BluetoothEventLoop.cpp(110): event_filter: Received signal org.bluez.Adapter:DeviceCreated from /org/bluez/254/hci0
10-31 15:16:47.953: E/BluetoothEventLoop.cpp(110): event_filter: Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/254/hci0
10-31 15:16:49.187: E/BluetoothEventLoop.cpp(110): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/254/hci0/dev_00_07_80_4D_B9_00
10-31 15:16:49.566: E/BluetoothEventLoop.cpp(110): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/254/hci0/dev_00_07_80_4D_B9_00
10-31 15:16:49.593: D/BluetoothService(110): updateDeviceServiceChannelCache(00:07:80:4D:B9:00)
10-31 15:16:49.609: D/BluetoothService(110): uuid(application): 00001101-0000-1000-8000-00805f9b34fb 1
10-31 15:16:49.609: D/BluetoothService(110): Making callback for 00001101-0000-1000-8000-00805f9b34fb with result 1
10-31 15:16:49.617: I/BluetoothEventLoop.cpp(110): agent_event_filter: Received method org.bluez.Agent:OutOfBandAvailable
10-31 15:16:54.156: E/BluetoothEventLoop.cpp(110): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/254/hci0/dev_00_07_80_4D_B9_00
10-31 15:16:54.156: D/BluetoothService(110): 00:07:80:4D:B9:00 bond state 10 -> 12 (0)
10-31 15:16:54.421: I/BluetoothEventLoop.cpp(110): agent_event_filter: Received method org.bluez.Agent:OutOfBandAvailable
10-31 15:16:54.988: E/ShockboxBluetooth(9676): Could not connect to Device
10-31 15:16:54.988: E/ShockboxBluetooth(9676): java.io.IOException: Connection refused
10-31 15:16:54.988: E/ShockboxBluetooth(9676): at android.bluetooth.BluetoothSocket.connectNative(Native Method)
10-31 15:16:54.988: E/ShockboxBluetooth(9676): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:204)
10-31 15:16:54.988: E/ShockboxBluetooth(9676): at com.Impakt.Shockbox.ShockboxBluetooth$ConnectThread.run(ShockboxBluetooth.java:416)
10-31 15:16:54.992: D/ShockboxBluetooth(9676): Closed socket
這是一個大量閱讀,所以我會縮小它(我認爲)。我相信這已經是與我們正在考慮這個問題行
10-31 15:16:49.617: I/BluetoothEventLoop.cpp(110): agent_event_filter: Received method org.bluez.Agent:OutOfBandAvailable
與NFC在Nexus S的....也許它想使用NFC配對?
我已經成功地使用createInsecureRfcommSocket
(使用反射)配對......但我不能從設備接收與listenUsingRfcommWithServiceRecord
(顯然)創建了一個socket上的數據,我們不希望使用listenUsingInsecureRfcommWithServiceRecord
因爲它需要API等級10,我們將用2.2/2.3.2手機來裁剪大量客戶。
任何幫助表示讚賞。謝謝!