j-kaltes / Juggluco

Android app for Freestyle Libre 1,2 and 3 and Chinese Sibionics sensors
GNU General Public License v3.0
217 stars 56 forks source link

Fix Libre2 handshake failed with GATT_CONN_TERMINATE_PEER_USER(19 #78

Closed ah7675 closed 1 year ago

ah7675 commented 1 year ago

@j-kaltes Please check updated version, which limits the retry scope and applies to both phase2 & phase3.

09-01 14:47:24.211 26540  5439 I logno   : I/MyGattCallback 3MH00K86P2M onConnectionStateChange, status:0, state: CONNECTED
09-01 14:47:24.999 26540  5439 I logno   : I/MyGattCallback BLE onServicesDiscovered invoked, status: 0
09-01 14:47:24.999 26540  5439 I logno   : I/MyGattCallback Using security generation 2
09-01 14:47:25.013 26540  5439 I logno   : I/MyGattCallback Enabled Security notification: true
09-01 14:47:25.030 26540  5439 I logn    : onDescriptorWrite UUID: 0000f001-0000-1000-8000-00805f9b34fb null
09-01 14:47:25.030 26540  5439 I logno   : I/MyGattCallback Sent read security challenge
09-01 14:47:25.068 26540  5439 I logno   : I/MyGattCallback UUID: with str=false without=false conphase=2
09-01 14:47:25.068 26540  5439 I logno   : I/MyGattCallback onCharacteristicChanged 0000f001-0000-1000-8000-00805f9b34fb isDeviceBusy=true
09-01 14:47:25.092 26540  5439 I logno   : I/MyGattCallback sensdorident: 15D6200900A407E0
09-01 14:47:25.092 26540  5439 I logno   : I/MyGattCallback Authenticationdata: 6A21D9CCCD8193A87C740100
09-01 14:47:25.257 26540  5439 I logno   : E/MyGattCallback phase2 retry=0 writeCharacteristic(BLELogincharacteristic)
09-01 14:47:25.258 26540  5439 I logno   : D/MyGattCallback C0:D0:63:B4:74:12 onCharacteristicWrite, status:0 UUID:0000f001-0000-1000-8000-00805f9b34fb
09-01 14:47:25.508 26540  5439 I logno   : I/MyGattCallback UUID: with str=false without=false conphase=3
09-01 14:47:25.509 26540  5439 I logno   : I/MyGattCallback onCharacteristicChanged 0000f001-0000-1000-8000-00805f9b34fb isDeviceBusy=true
09-01 14:47:25.509 26540  5439 I logno   : I/MyGattCallback UUID: with str=false without=false conphase=3
09-01 14:47:25.509 26540  5439 I logno   : I/MyGattCallback onCharacteristicChanged 0000f001-0000-1000-8000-00805f9b34fb isDeviceBusy=true
09-01 14:47:25.645 26540  5439 I logno   : I/MyGattCallback Gen2 session 6
09-01 14:47:25.650 26540  5439 I logno   : E/MyGattCallback phase3 retry=0 enableNotification failed
09-01 14:47:25.651 26540  5439 I logno   : D/MyGattCallback C0:D0:63:B4:74:12 onCharacteristicWrite, status:0 UUID:0000f001-0000-1000-8000-00805f9b34fb
09-01 14:47:25.884 26540  5439 I logno   : I/MyGattCallback UUID: with str=true without=true conphase=4
09-01 14:47:25.884 26540  5439 I logno   : I/MyGattCallback onCharacteristicChanged 0000f002-0000-1000-8000-00805f9b34fb isDeviceBusy=true
09-01 14:47:25.884 26540  5439 I logno   : D/MyGattCallback 3MH00K86P2M oldonCharacteristicChanged 20
09-01 14:47:25.885 26540  5439 I logn    : onDescriptorWrite UUID: 0000f002-0000-1000-8000-00805f9b34fb 79 35 93 1D D8 71 B0 05 5C 30 18 4D 9C C1 EF BB BF 28 B6 1D
09-01 14:47:25.957 26540  5439 I logno   : I/MyGattCallback UUID: with str=true without=true conphase=4
09-01 14:47:25.958 26540  5439 I logno   : I/MyGattCallback onCharacteristicChanged 0000f002-0000-1000-8000-00805f9b34fb isDeviceBusy=false
j-kaltes commented 1 year ago

My only problem with your patch, is that spaces and new lines are changed so that diff shows a lot more differences that really exist. I first modified the original with only the changes added.

ah7675 commented 1 year ago

@j-kaltes Sorry, just saw your comment now. Are we all set? Do you need me to fix whitespace and indent?

j-kaltes commented 1 year ago

I uploaded the changes back to previous whitespace.