2017-08-24 571 views
1

當我嘗試打開通知後連接ble時,通常返回BleGattException status = 133,有時有時候不會。BleGattException狀態返回133(onClientConnectionState() - status = 133)

這是我的代碼:

mConnectingDevice.establishConnection(false) 
    .doOnNext(this::storeConnect) 
    .flatMap(rxBleConnection -> rxBleConnection.setupNotification(notifyUuid)) 
    .observeOn(AndroidSchedulers.mainThread()) 
    .flatMap(notificationObservable -> notificationObservable) 
    .observeOn(AndroidSchedulers.mainThread()) 
    .subscribe(this::onNotify, this::connectFail); 

connectFail返回BleGattException狀態= 133

這是打印日誌//後面我的評論:

08-22 14:12:00.777 31399-31399/com.evan.yeeuusample D/BluetoothAdapter:  STATE_ON 
    08-22 14:12:00.781 31399-31399/com.evan.yeeuusample D/BluetoothGatt: connect() - device: F0:65:A0:1A:20:16, auto: false 

mConnectingDevice.establishConnection(假)

08-22 14:12:00.781 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp() 
    08-22 14:12:00.782 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp() - UUID=58cec16e-bb91-4603-bd28-11da0e5e17c0 
    08-22 14:12:00.785 31399-31410/com.evan.yeeuusample D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5 

    08-22 14:12:02.965 31399-31410/com.evan.yeeuusample D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 
    device=F0:65:A0:1A:20:16 

connectstatus 133

08-22 14:12:02.969 31399-31399/com.evan.yeeuusample D/BluetoothManager: getConnectionState() 
    08-22 14:12:02.970 31399-31399/com.evan.yeeuusample D/BluetoothManager: getConnectedDevices 
    08-22 14:12:02.997 31399-31399/com.evan.yeeuusample D/BluetoothGatt: close() 

連接失敗關貿總協定接近

08-22 14:12:02.997 31399-31399/com.evan.yeeuusample D/BluetoothGatt: unregisterApp() - mClientIf=5 

繼續嘗試連接:

08-22 14:17:35.278 31399-31399/com.evan.yeeuusample D/BluetoothGatt: connect() - device: F0:65:A0:1A:20:16, auto: false 
    08-22 14:17:35.278 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp() 
    08-22 14:17:35.278 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp() - UUID=b8fa445c-aab2-46d1-b2c2-e67bb475caf9 
    08-22 14:17:35.280 31399-31411/com.evan.yeeuusample D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5 
    08-22 14:17:43.666 31399-31441/com.evan.yeeuusample D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=F0:65:A0:1A:20:16 

無法再次連接! 有沒有解決方法?我不知道爲什麼連接狀態是133,gatt已關閉!現在這個狀態經常發生,幫助我謝謝你。

BleGattException status return 133

+0

這似乎是一個較低級別的Android BLE堆棧問題。你檢查過HCI snoop日誌嗎?你用什麼手機?什麼外設? –

+0

智能設備藍牙模塊是北歐的,我用過華爲和小米都是這樣的一種現象,我現在在做doOnUububscribe()方法重新連接,問題肯定存在@DariuszSeweryn –

回答

0

請使用NRF連接的應用程序測試設備:https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp

如果應用程序可以連接到您的設備,我想rxble LIB的問題。

+0

nRF連接設備是否正常,並且斷開後再次斷開連接不會出現133,我已經提交了關於rxble的問題,但他們認爲這是問題不是問題,要關閉。 –