Dbus Bluez GattManager1
See original GitHub issueHi, first of everything i’d like to say thanks for the awesome job done with this library, and thanks to keep the dbus door open for the .net Core! I’m tring to use the library in order to setup a Raspberry PI 4 as a gattserver, so i’d like to expose some device information and i/o status. By looking at the official documentation seem that i need to use the api “org.bluez.GattManager1” by passing a hierarchy of items : https://github.com/Vudentz/BlueZ/blob/master/doc/gatt-api.txt (LN 375)
i’ve used the Tmds.DBus.Tool to generate an interface of org.bluez and i get defined the “org.bluez.GattManager1” but i can’t figure out how to use that, i’ve try several different ways but the best result that i’ve obtained is “Unhandled exception. System.AggregateException: One or more errors occurred. (org.bluez.Error.Failed: No object received)”
the generated interface is
[DBusInterface("org.bluez.GattManager1")] interface IGattManager1 : IDBusObject { Task RegisterApplicationAsync(ObjectPath Application, IDictionary<string, object> Options); Task UnregisterApplicationAsync(ObjectPath Application); }
i’ve try to change the signature of object path, i’ve try to use the option dictionary but i’m always get the same error.
The code to create the prox of GattManager is the following:
Task.Run(async () => { using (var connection = new Connection(Address.System)) { await connection.ConnectAsync(); var manager = connection.CreateProxy<IGattManager1>("org.bluez", "/org/bluez/hci0"); } }).Wait();
Thanks for any help!
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
@danielmeza this test does an implementation of
WatchPropertiesAsync
: https://github.com/tmds/Tmds.DBus/blob/b07c3e4d844f076124feb7629a20b5c9dc11d239/test/Tmds.DBus.Tests/PropertyObject.cs#L43-L46.This work like a charm! Now I’m able to use the entire GATT, Read, Write, Notify. Thanks you for your work. I had opened this Issue to join this repository to the .NET Foundation. https://github.com/tmds/Tmds.DBus/issues/99