-
Notifications
You must be signed in to change notification settings - Fork 134
bluetoothgatt discoverServices takes so long #5
Comments
further search found this could help some diagnostics. from the app screenshot, faster discovery device has the Slave Connection Interval Range. Our prototype using nRF51 DK Development Kit for Bluetooth (slow) does not has the Slave Connection Interval Range, is it due to this problem that our prototype has a slow connection + service discovery connection speed ? right now we are not sure where Nordic's employee recommends the way to speed up service discovery is to reduce the connection interval when doing service discovery. we are still exploring where to change it and what does Master here means ? any suggestions or guidance are welcome. nRF Connect for mobile (previously called nRF Master Control Panel) and |
Please create a case on devzone when you have a question. You can request higher priority connection using requestConnectionPriority, |
not helpful. 02-08 17:25:18.854 D/BluetoothGatt: requestConnectionPriority() - params: 1 |
Hi, first of all, it of course depends on number of services and characteristics on your device. Secondly, before Android 5 the minimum Conn Interval was 7.5ms, after that it's 11.5ms. |
Also, those 50s on your photos is set in the adv packet. You may write the any value you want, it doesn't matter for the connection actually, just like the complete local name. |
You may read the proper ones from Connection Parameters characteristic in the Generic Access service. |
still not very useful no matter how early i set requestConnectionPriority. from 4.20 CONNECTION PARAMETER UPDATE REQUEST (CODE0x12) it seems to us that the LE slave play a part to speed up the discovery process. i verified this on a Android 4.4.2 phone running nRF Connect and repeat the steps on our prototype (using nRF51 DK) and one equipment we brought from the market. the speed that we brought from the market is still the same compared to using Android 5.x or 6.x phones running nRF Connect. we like to know / confirm where should we exactly tune it (Phone / LE slave) before we put resource to investigate, understand and modify it. we hope to hear concrete sharing from experts as we have limited resources and new in BLE. 02-09 10:00:09.242 D/BluetoothGatt: connect() - device: F7:73:DE:00:4D:DE, auto: false |
As you know there is no callback for requesting connection parameters in Android. It's a bug and will hopefully be fixed one day. Until then you have know what the actual interval is. Target device may reject request from the master. So I'd recommend to configure it on the peripheral side. |
from this log it shows that from mBluetoothGatt.discoverServices() to public void onServicesDiscovered(BluetoothGatt gatt, int status) callback took about 6 seconds for android 6.0.1 & 5.x. for android 4.4.2 it takes about 10 seconds, for android 4.3 about 1 second.
i like to know is there way to control / improve it ?
12:02:41.642 D/BluetoothGatt: connect() - device: F7:73:DE:00:4D:DE, auto: false
12:02:41.642 D/BluetoothGatt: registerApp()
12:02:41.642 D/BluetoothGatt: registerApp() - UUID=8a45498c-dcdf-4987-970d-0395638f72c6
12:02:41.644 D/UartService: Trying to create a new connection.
12:02:41.644 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
12:02:42.775 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=F7:73:DE:00:4D:DE
12:02:42.775 D/UartService: onConnectionStateChange state = 2
12:02:42.777 D/UartService: broadcastUpdate 1
12:02:42.777 I/UartService: Connected to GATT server.
12:02:42.796 D/BluetoothGatt: discoverServices() - device: F7:73:DE:00:4D:DE
12:02:42.801 I/UartService: Attempting to start service discovery:true
12:02:48.298 D/BluetoothGatt: onSearchComplete() = Device=F7:73:DE:00:4D:DE Status=0
12:02:48.298 W/UartService: mBluetoothGatt = android.bluetooth.BluetoothGatt@ace296b
12:02:48.299 D/UartService: broadcastUpdate 1
12:02:48.304 D/BLE_com: ACTION_GATT_SERVICES_DISCOVERED
The text was updated successfully, but these errors were encountered: