1

I am working on Android BLE, i found strange behavior on Huawei(Honor 7C) devices some times i didn't get response from requestMtu mean when i call this method onMtuChanged method never triggers, this works fine on Samsung devices but on Huawei things are not working well.

Help will be appreciated thanks in advance.

I looked into logs and what i found is that the in case i didn't have the response for MTU request i didn't get the onConnectionUpdated and onConfigureMTU logs, only configureMTU call was visible in the logs when the issue arises

D/BluetoothGatt: configureMTU() - device: 00:60:37:39:95:BE mtu: 256 
D/BluetoothGatt: onConnectionUpdated() - Device=00:60:37:39:95:BE interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt: onConfigureMTU() - Device=00:60:37:39:95:BE mtu=247 status=0
Zubair Akber
  • 2,760
  • 13
  • 30
  • Are you sure you don't have any pending BLE operation while requesting the MTU change ? Also, check this out: https://stackoverflow.com/questions/46149114/request-mtu-is-not-working-in-nougat – matdev May 13 '20 at 09:45
  • Could you post your code? Have you checked the HCI log if the remote device actually responds to the MTU request? – Emil May 13 '20 at 11:12
  • @matdev it was a fresh request, means i just connect set the MTU and have no response of that call – Zubair Akber May 14 '20 at 06:48
  • Are you able to write on a characteristic after sending the requestMtu() ? – matdev May 18 '20 at 14:35
  • @matdev when i didn't get response of MTU request than i was not able to subscribe and write to device, i then disconnect and reconnect it – Zubair Akber May 19 '20 at 07:06
  • @Emil what i found in logs is that when the issue happens i didn't get the onConnectionUpdated and onConfigureMTU MTU logs – Zubair Akber May 20 '20 at 06:51
  • Have you checked the hci log? – Emil May 20 '20 at 08:44
  • @ZubairAkber Do you see any error message when you do the BLE write ? Any status update in your BluetoothGattCalback.onConnectionStateChange() ? – matdev May 22 '20 at 12:15

0 Answers0