시나리오는 다음과 같습니다BluetoothGatt : onClientConnectionState() 상태를 반환 = 133
내가 android dongle 내 응용 프로그램을 실행하고 다른면에서 내가 esp8266에 부착 된 HM10 LE 블루투스를 가지고 있습니다.
내 앱을 통해 안드로이드 동글을 블루투스를 통해 HM10에 연결하려고합니다.
여러 주 동안 안드로이드 동글을 다른 HM10으로 연결하거나 그 반대의 경우에도 다른 동글과 함께 동일한 HM10을 연결해도 성공적으로이 작업을 수행했습니다.
문제 : 일정 기간 후
연결시 시도, 나는 상태 (133)와 연결이 끊긴 상태를 수신하기 시작했지만, 일부 연결이 시도 후 연결이 성공적으로 일어났다.
이제 HM10 (문제가있는 HM10이라고 부름)과 함께 특정 안드로이드 동글 (문제있는 동글이라고 부르 자)을 연결할 수 없습니다. 나는 항상 133을 받고 있고 심지어 재시도 수백 번 연결할 수 없다.
하지만 다른 동글을 사용하면 "문제가있는"HM10에 연결할 수 있습니다. 또한 다른 HM10을 사용하면 "문제가있는"동글에 연결할 수 있습니다.
마지막으로 문제가 발생한 동글에 다른 HM10을 연결하면 바로 문제가있는 동글에 문제가있는 HM10을 연결할 수 있습니다. 그러나 연결을 끊으면 결코 다시 연결할 수 없습니다.
특정 BLE 장치에 연결하려고하면 항상 상태 = 133 인 연결 끊김 상태가 나타납니다. 나는 그것을 해결하기 위해 노력했습니다 무엇
:
그것은 정상적인 사용 중에 HM10가의 켜져 있고 그 반대의 경우도 마찬가지 할 수있다,라고하는 것이 중요합니다. 그러나 Gatt Callback의 "onConnectionStateChange"에 대한 연결 끊기 이벤트를 가져올 때 나는 항상 gatt (deviceGatt.close();)를 닫습니다.
나는 또한 일부 게시물을 닫은 후에 deviceGatt를 새로 고치기 위해 읽었습니다. 또한 그 일을 해요 : 나는 또한 안드로이드 설정 -에서 캐시를 청소 한 후 읽어
//inside the onConnectionStateChange on the BluetoothGattCallback:
case BluetoothProfile.STATE_DISCONNECTED:
mConnectionState = ConnectionStatus.DISCONNECTED;
readCharacteristic = null;
writeCharacteristic = null;
if (status != BluetoothGatt.GATT_SUCCESS) {
if (status == 133) {
refreshDeviceCache(deviceGatt);
}
}
deviceGatt.close();
deviceGatt = null;
break;
}
private boolean refreshDeviceCache(BluetoothGatt gatt){
try {
BluetoothGatt localBluetoothGatt = gatt;
Method localMethod = localBluetoothGatt.getClass().getMethod("refresh", new Class[0]);
if (localMethod != null) {
boolean bool = ((Boolean) localMethod.invoke(localBluetoothGatt, new Object[0])).booleanValue();
return bool;
}
}
catch (Exception localException) {
}
return false;
}
> 무선 & Networks-> 자세히 -> 네트워크 설정 재설정하지만 문제가 계속 그 일을 한 후 존재한다. 여기에 btsnoop_hci의 스크린 샷이다
11-27 11:16:49.353 8104-8130/? D/bt_hci_h5: hci_hal_h5 h5_transmit_data, data type: 1
11-27 11:16:49.353 8104-8130/? D/bt_hci_h5: cmd opcode = 0xfc19
11-27 11:16:49.353 8104-8130/? D/bt_hci_h5: hci_hal_h5 h5_int_transmit_data_cb data type: 5
11-27 11:16:49.353 8104-8144/? W/bt_btif: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0008
11-27 11:16:49.353 8104-8144/? W/bt_btif: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0008
11-27 11:16:49.353 8104-8144/? W/bt_btif: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=5 reason=0x0008
11-27 11:16:49.353 8104-8144/? W/bt_btif: bta_gattc_conn_cback() - cif=6 connected=0 conn_id=6 reason=0x0008
11-27 11:16:49.353 8104-8144/? W/bt_btif: bta_gattc_conn_cback() - cif=7 connected=0 conn_id=7 reason=0x0008
11-27 11:16:49.353 8104-8144/? E/rtk_parse: rtk_delete_le_profile, hci_conn not exist with handle ffff
11-27 11:16:49.353 8104-8144/? I/bt_btm_sec: btm_sec_disconnected clearing pending flag handle:16 reason:8
11-27 11:16:49.354 8104-8126/? D/BtGatt.GattService: onConnected() - clientIf=7, connId=0, address=34:15:13:E6:50:8F
11-27 11:16:49.354 8104-8130/? D/bt_hci_h5: hci_hal_h5 h5_int_transmit_data_cb data type: 5
11-27 11:16:49.354 24277-24288/? D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=7 device=34:15:13:E6:50:8F
11-27 11:16:49.358 24277-24288/? D/BluetoothComm: Error connecting to device: com.polidea.rxandroidble.exceptions.BleDisconnectedException: Disconnected from 34:15:13:E6:50:8F
11-27 11:16:49.359 24277-24288/? W/System.err: com.polidea.rxandroidble.exceptions.BleDisconnectedException: Disconnected from 34:15:13:E6:50:8F
11-27 11:16:49.359 24277-24288/? W/System.err: at com.polidea.rxandroidble.internal.connection.RxBleGattCallback$2.onConnectionStateChange(RxBleGattCallback.java:76)
11-27 11:16:49.359 24277-24288/? W/System.err: at android.bluetooth.BluetoothGatt$1.onClientConnectionState(BluetoothGatt.java:184)
11-27 11:16:49.359 24277-24288/? W/System.err: at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:70)
11-27 11:16:49.359 24277-24288/? W/System.err: at android.os.Binder.execTransact(Binder.java:565)
11-27 11:16:49.362 24277-24324/? D/BluetoothManager: getConnectionState()
11-27 11:16:49.362 24277-24324/? D/BluetoothManager: getConnectedDevices
11-27 11:16:49.367 24277-24324/? D/BluetoothGatt: close()
11-27 11:16:49.367 24277-24324/? D/BluetoothGatt: unregisterApp() - mClientIf=7
11-27 11:16:49.368 8104-8158/? D/BtGatt.GattService: unregisterClient() - clientIf=7
11-27 11:16:49.465 8104-8130/? D/bt_vendor_uart: op for 7
11-27 11:16:49.465 8104-8130/? D/bt_hci_h5: hci_hal_h5 h5_transmit_data, data type: 1
11-27 11:16:49.465 8104-8130/? D/bt_hci_h5: cmd opcode = 0xfc94
:
아래의 로그를 찾아주세요.CFA :
// 업데이트 - 추가 파일 로그 여기
인 log file
// 최종 갱신
나는이 문제에 대해 포스트를 많이 읽어하지만, 또는 아무튼 제공된 솔루션이 없거나 제공된 솔루션이 작동하지 않습니다.
옵션이 없으므로 누군가 내가이 문제를 해결할 수 있는지 궁금합니다. 이견있는 사람?
hci 로그를 업로드 할 수 있습니까? – Emil
@Emil 로그 파일로 게시물을 업데이트했습니다. 당신의 도움을 주셔서 감사합니다. –