0

I have a BLE device which has a "audio service". I want get audio data. I use gatttool to communicate with my device. To do this, I can enable notification. Then, when microphone is 'on', I receive data but it's stop suddenly.

$ sudo gatttool -b xx:xx:xx:xx:xx:xx -I
[xx:xx:xx:xx:xx:xx][LE]> connect
Attempting to connect to xx:xx:xx:xx:xx:xx
Connection successful
[xx:xx:xx:xx:xx:xx][LE]> char-write-cmd 0x3c 0100
Notification handle = 0x002a value: 04 
Notification handle = 0x002d value: 09 00 00 00 77 77 77 37 1b 09 a0 b2 91 80 09 1a 0a 99 a0 a0 
...
Notification handle = 0x002d value: 09 22 ae a4 38 82 8b 93 af 91 12 77 a4 81 cd 10 1a 15 0a c0 
[xx:xx:xx:xx:xx:xx][LE]> 
(gatttool:5840): GLib-WARNING **: Invalid file descriptor.

I'm under Ubuntu 16.04 and I have bluez 5.37

Have you some idea ? Is it possible that problem comes from data frequency ?


Edit : With Qt (using bluez), I have the log:

qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 23 error: -1 "Fonction non implantée"
Cannot connect to remote device.
Controller Error: 1
Remote device disconnected
helene
  • 1,201
  • 2
  • 18
  • 30
  • Are you sure that you didn't lose the connection before this error ? – François Dupont Apr 25 '17 at 14:30
  • The connection is indeed lost at this time but I don't know why it happens (time before it happens isn't always the same) – helene Apr 25 '17 at 15:39
  • Your devices are not too far one to each other ? Because this error can be raised because of this. See : https://raspberrypi.stackexchange.com/questions/53982/how-to-fix-gatttools-glib-warning-invalid-file-descriptor – François Dupont Apr 25 '17 at 16:03
  • No, the device are directly above my computer. I think it's the error which produces disconnection. (I edit my post whith debug on Qt which suggest this) – helene Apr 25 '17 at 16:29
  • Where is the "Fonction non implantée" coming from? This is not a generic BlueZ error and the gatttool commands shouldn't fail with this error anyway. I suggest that you 1) run 'btmon&' to monitor the Bluetooth activity in the background, and 2) use gatttool directly from the command line as seen in this answer: http://stackoverflow.com/questions/15657007/bluetooth-low-energy-listening-for-notifications-indications-in-linux/15722811#15722811 – Youssif Saeed May 18 '17 at 10:19

0 Answers0