Home > Mobile > Android bluetooth BluetoothGatt problem, modify the connection timeout, onConnectionUpdated problem
Android bluetooth BluetoothGatt problem, modify the connection timeout, onConnectionUpdated problem
Time:10-09
MBluetoothGatt=device. ConnectGatt (this, false, mGattCallback); Connection of bluetooth system, the default timeout time 30 s, how to modify this time, see BluetoothGattCallback onConnectionUpdated method with a parameter in a timeout, should be a connection timeout, but how to set the time, how to trigger this callback, why can't I @ Override onConnectionUpdated method
* @ param timeout Supervision timeout for this connection, in 10 ms unit. The Valid range is from 10 * (0.1 s) to 3200 (32) s
There is a problem: can't BluetoothGattCallback @ Override onConnectionUpdated method, however, the abstract class BluetoothGattCallback inside is the method, and the class BluetoothGatt implements in other BluetoothProfile @ can Override methods, but onConnectionUpdated do red
CodePudding user response:
CodePudding user response:
Bluetooth never get
Can not rewrite because that is the system API, next to a annotation @ hide, isn't it, have the means that this method is the method foreign hidden system
CodePudding user response:
The timeout value, in the MTK platform, is in the vendor, mediatek, proprietary, external \ bluetooth \ bt_cust \ bt_cust_table h, through LESupervisionTO this value to modify, other platforms are similar, may file name is different, but are set up Supervision timeout the value, specific you can refer to my blog: https://blog.csdn.net/xuhui_7810/article/details/87344279