* Help on BLE MIDI Peripheral
@ 2019-03-12 10:39 Andrea
0 siblings, 0 replies; only message in thread
From: Andrea @ 2019-03-12 10:39 UTC (permalink / raw)
To: linux-bluetooth
Hi,
I have adapted the python test files in example-gatt-server and example-advertisement to MIDI.
The code is here https://github.com/audetto/ble-midi
I can advertise it properly and in Android I can see the device.
But after it is selected and the android app create a MIDI Device, it drops after 3-4 seconds.
In Android I have used https://github.com/philburk/android-midisuite which is the reference
implementation.
I have added a lot of logging to the code and it does not print anything after the initial
advertisement phase.
Application.GetManagedObjects
GATT application registered
Advertisement.GetAll
returning props
Advertisement registered
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/org/bluez/example/advertisement0: Released!
Advertisement unregistered
I would expect the Central to Read some values as in the MIDI BLE spec
"The Central will attempt to read the MIDI I/O characteristic of the Peripheral after establishing a
connection with the accessory. The accessory shall respond to the initial MIDI I/O characteristic
read with a packet that has no payload."
And I get the exact same behaviour if I use the wrong UUID for the characteristic, or if I don't add
it at all.
I have the feeling the Characteristic is not registered properly.
Here is the key code:
class MIDICharacteristic(egs.Characteristic):
def __init__(self, bus, index, service):
flags = ['notify', 'read', 'write', 'write-without-response']
super().__init__(bus, index, MIDI_CHARACTERISTIC_UUID, flags, service)
and
class MIDIService(egs.Service):
def __init__(self, bus, index):
super().__init__(bus, index, MIDI_SERVICE_UUID, True)
self.add_characteristic(MIDICharacteristic(bus, 0, self))
Is there anything that comes to your mind with these symptoms?
Thank you
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-03-12 10:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 10:39 Help on BLE MIDI Peripheral Andrea
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).