Ah, missed it. I actually have an XA2 coming (next week), but I’m not sure I can help debug without the correct kind of client?
I will find some other BLE devices to see if the disconnect happens with them as well (but I assume it won’t)
The difference between the gatttool and the Qt based control mode is the discovery:
With gatttool I do not perform any discovery: the characteristics is written by a handle, while the Qt API mandates the discovery of the services and their characteristics. During the service an characteristics discovery I see a lot of suspicious messages:
[D] unknown:0 - Sending read_by_group_type request, startHandle: 8 endHandle: ffff 2800
[D] unknown:0 - Received size: 14 data: "110608000e00f0ff0f0012000f18"
[D] unknown:0 - Found uuid: "{0000fff0-0000-1000-8000-00805f9b34fb}" start handle: 8 end handle: e
[W] BburagoRcCar::serviceDiscovered:59 - service discovered "{0000fff0-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Sending read_by_type request, startHandle: 8 endHandle: e type: 2802 packet: "0808000e000228"
[D] unknown:0 - Found uuid: "{0000180f-0000-1000-8000-00805f9b34fb}" start handle: f end handle: 12
[W] BburagoRcCar::serviceDiscovered:59 - service discovered "{0000180f-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Sending read_by_type request, startHandle: f endHandle: 12 type: 2802 packet: "080f0012000228"
[D] unknown:0 - Sending read_by_group_type request, startHandle: 13 endHandle: ffff 2800
[D] unknown:0 - Received size: 5 data: "010808000a"
[D] unknown:0 - Error1: "no attribute in given range found" last command: 8 handle: 8
[D] unknown:0 - Sending read_by_type request, startHandle: 8 endHandle: e type: 2803 packet: "0808000e000328"
[D] unknown:0 - Received size: 5 data: "01080f000a"
[D] unknown:0 - Error1: "no attribute in given range found" last command: 8 handle: f
[D] unknown:0 - Sending read_by_type request, startHandle: f endHandle: 12 type: 2803 packet: "080f0012000328"
[D] unknown:0 - Received size: 5 data: "011013000a"
[D] unknown:0 - Error1: "no attribute in given range found" last command: 10 handle: 13
[D] unknown:0 - Sending read_by_group_type request, startHandle: 1 endHandle: ffff 2801
[D] unknown:0 - Received size: 16 data: "090709001c0a00f1ff0c00100d00f2ff"
[D] unknown:0 - Found handle: 9 properties: QFlags(0x4|0x8|0x10) value handle: a uuid: "{0000fff1-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Found handle: c properties: QFlags(0x10) value handle: d uuid: "{0000fff2-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Sending read_by_type request, startHandle: d endHandle: e type: 2803 packet: "080d000e000328"
[D] unknown:0 - Received size: 9 data: "09071000121100192a"
[D] unknown:0 - Found handle: 10 properties: QFlags(0x2|0x10) value handle: 11 uuid: "{00002a19-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Sending read_by_type request, startHandle: 11 endHandle: 12 type: 2803 packet: "08110012000328"
[D] unknown:0 - Received size: 5 data: "011001000a"
[D] unknown:0 - Error1: "no attribute in given range found" last command: 10 handle: 1
[D] unknown:0 - Received size: 5 data: "01080d000a"
[D] unknown:0 - Error1: "no attribute in given range found" last command: 8 handle: d
[D] unknown:0 - Reading all characteristic values for "{0000fff0-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Discovering descriptor values for "{0000fff0-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Sending find_info request (9, c) 9
[D] unknown:0 - Received size: 5 data: "010811000a"
[D] unknown:0 - Error1: "no attribute in given range found" last command: 8 handle: 11
[D] unknown:0 - Reading all characteristic values for "{0000180f-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Received size: 14 data: "0501090003280a00f1ff0b000229"
[D] unknown:0 - Suppressing primary/characteristic 2803
[D] unknown:0 - Suppressing char handle a
[D] unknown:0 - Descriptor found, uuid: "{00002902-0000-1000-8000-00805f9b34fb}" descriptor handle: b
[D] unknown:0 - Sending find_info request (c) c
[D] unknown:0 - Received size: 2 data: "0b38"
[D] unknown:0 - Discovering descriptor values for "{0000180f-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Sending find_info request (10) 10
[D] unknown:0 - Received size: 14 data: "05010c0003280d00f2ff0e000229"
[D] unknown:0 - Suppressing primary/characteristic 2803
[D] unknown:0 - Suppressing char handle d
[D] unknown:0 - Descriptor found, uuid: "{00002902-0000-1000-8000-00805f9b34fb}" descriptor handle: e
[D] unknown:0 - Reading all descriptor values for "{0000fff0-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Received size: 14 data: "0501100003281100192a12000229"
[D] unknown:0 - Suppressing primary/characteristic 2803
[D] unknown:0 - Suppressing char handle 11
[D] unknown:0 - Descriptor found, uuid: "{00002902-0000-1000-8000-00805f9b34fb}" descriptor handle: 12
[D] unknown:0 - Reading all descriptor values for "{0000180f-0000-1000-8000-00805f9b34fb}"
[D] unknown:0 - Received size: 3 data: "0b0000"
[D] unknown:0 - Received size: 3 data: "0b0000"
[W] ShellRcCar::controlServiceDetailsDiscovered:108 - Control service discovered QLowEnergyService::ServiceState(ServiceDiscovered)
[W] ShellRcCar::controlServiceDetailsDiscovered:111 - Connected!
[W] AvailableDevicesModel::currentDeviceConnectionStateChangedSlot:142 - AbstractRcCar::ConnectionState(Connecting) AbstractRcCar::ConnectionState(Connected)
[D] unknown:0 - Writing characteristic 9 (size: b with response: false )
[D] unknown:0 - Writing characteristic 9 (size: b with response: false )
[D] unknown:0 - Received size: 3 data: "0b0000"
I am unsure if the Android app does discovery or not, or even if on Android is it possible to write to characteristics by handles.