0

I need to write data to a BlueZ characteristic through D-Bus that does not show up after Service Discovery on a Bluetooth LE device. Is it possible?

"What I've done so far" I have a Bluetooth device that is controlled by an Android app written in Java. I am trying to duplicate it's function in Linux. My initial attempt is using Python and dbus-python. The Java code sends a "key code" to a service UUID with characteristic UUID. Using D-feet, after service discovery, I can see the path representing the service UUID. However, there are two discovered characteristics and neither match the characteristic UUID that the java code is sending this key to.

Or in other words, I don't have a path for: proxy = bus.get_object('org.bluez', 'object path')

Before I give up on a Python/D-Bus approach, is it possible to write data to this assumed hidden characteristic via D-Bus? Is there a way to make my own path definition to this UUID? Does it require a different Python Binding? Different language?

cas
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 02 '23 at 19:01
  • A good way to help debug this is to use `bluetoothctl` on the command line first. This enables you can connect and send data to the remote device using the D-Bus API without having to worry about your code. Could it be that you don't see the UUID that you are expecting because you have not paired with the remote device from the Linux PC? Using `GetManagedObject()` can be helpful way to see what BlueZ knows about a device https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/bluezutils.py#n9 – ukBaz May 03 '23 at 05:57

0 Answers0