question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dbus Bluez GattManager1

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
danielmezacommented, Mar 3, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

GattManager1 (bluez-dbus 0.1.4 API)
GATT service definition. To make service registration simple, BlueZ requires that all objects that belong to a GATT service be grouped under a...
Read more >
bluez/doc/gatt-api.txt at master
BlueZ D-Bus GATT API description ******************************** GATT local and remote services share the same high-level D-Bus API.
Read more >
test/example-gatt-server - pub/scm/bluetooth/bluez
Fake Battery service that emulates a draining battery. """ BATTERY_UUID = '180f'.
Read more >
Creating a BLE Peripheral with BlueZ
We're going to build our peripheral directly using BlueZ's D-Bus API. ... Find a BlueZ object that implements the GattManager1 interface.
Read more >
GATT + DBus API Questions
Hey There, I've been trying to create a GATT service via the DBus BlueZ API (org.bluez.GattManager1 + org.bluez.GattService1/GattCharacteristic1).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found