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

CodePudding user response:

refer to the second floor can reply wang:
bluetooth never get

Can't rewrite because that is the system API, next to a annotation @ hide, isn't it, there is this means this method is the system of foreign hidden

good

CodePudding user response:

reference xuhui_7810 reply: 3/f
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



If it is the user's mobile phone, this time, cannot change the default 30 s

CodePudding user response:

reference 5 floor ink_s reply:
Quote: refer to the third floor xuhui_7810 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



If it is the user's mobile phone, this time, cannot change the default 30 s







The user can't change, of course, if you are mobile phone manufacturer, you can open the interface to the user, but is it is not open to the user by default
  • Related