Package org.bluez

Interface GattManager1

All Superinterfaces:
org.freedesktop.dbus.interfaces.DBusInterface

public interface GattManager1 extends org.freedesktop.dbus.interfaces.DBusInterface
File generated - 2023-02-20.
Based on bluez Documentation: gatt-api.txt.

Service: org.bluez
Interface: org.bluez.GattManager1

Object path:
[variable prefix]/{hci0,hci1,...}

GATT Manager hierarchy
======================

GATT Manager allows external applications to register GATT services and
profiles.

Registering a profile allows applications to subscribe to *remote* services.
These must implement the GattProfile1 interface defined above.

Registering a service allows applications to publish a *local* GATT service,
which then becomes available to remote devices. A GATT service is represented by
a D-Bus object hierarchy where the root node corresponds to a service and the
child nodes represent characteristics and descriptors that belong to that
service. Each node must implement one of GattService1, GattCharacteristic1,
or GattDescriptor1 interfaces described above, based on the attribute it
represents. Each node must also implement the standard D-Bus Properties
interface to expose their properties. These objects collectively represent a
GATT service definition.

To make service registration simple, BlueZ requires that all objects that belong
to a GATT service be grouped under a D-Bus Object Manager that solely manages
the objects of that service. Hence, the standard DBus.ObjectManager interface
must be available on the root service path. An example application hierarchy
containing two separate GATT services may look like this:

-> /com/example
| - org.freedesktop.DBus.ObjectManager
|
-> /com/example/service0
| | - org.freedesktop.DBus.Properties
| | - org.bluez.GattService1
| |
| -> /com/example/service0/char0
| | - org.freedesktop.DBus.Properties
| | - org.bluez.GattCharacteristic1
| |
| -> /com/example/service0/char1
| | - org.freedesktop.DBus.Properties
| | - org.bluez.GattCharacteristic1
| |
| -> /com/example/service0/char1/desc0
| - org.freedesktop.DBus.Properties
| - org.bluez.GattDescriptor1
|
-> /com/example/service1
| - org.freedesktop.DBus.Properties
| - org.bluez.GattService1
|
-> /com/example/service1/char0
- org.freedesktop.DBus.Properties
- org.bluez.GattCharacteristic1

When a service is registered, BlueZ will automatically obtain information about
all objects using the service's Object Manager. Once a service has been
registered, the objects of a service should not be removed. If BlueZ receives an
InterfacesRemoved signal from a service's Object Manager, it will immediately
unregister the service. Similarly, if the application disconnects from the bus,
all of its registered services will be automatically unregistered.
InterfacesAdded signals will be ignored.

Examples:
- Client
test/example-gatt-client
client/bluetoothctl
- Server
test/example-gatt-server
tools/gatt-service
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    RegisterApplication(org.freedesktop.dbus.DBusPath _application, Map<String,org.freedesktop.dbus.types.Variant<?>> _options)
    From bluez documentation:

    Registers a local GATT services hierarchy as described
    above (GATT Server) and/or GATT profiles (GATT Client).

    The application object path together with the D-Bus
    system bus connection ID define the identification of
    the application registering a GATT based
    service or profile.

    void
    UnregisterApplication(org.freedesktop.dbus.DBusPath _application)
    From bluez documentation:

    This unregisters the services that has been
    previously registered.

    Methods inherited from interface org.freedesktop.dbus.interfaces.DBusInterface

    getObjectPath, isRemote
  • Method Details

    • RegisterApplication

      void RegisterApplication(org.freedesktop.dbus.DBusPath _application, Map<String,org.freedesktop.dbus.types.Variant<?>> _options) throws BluezInvalidArgumentsException, BluezAlreadyExistsException
      From bluez documentation:

      Registers a local GATT services hierarchy as described
      above (GATT Server) and/or GATT profiles (GATT Client).

      The application object path together with the D-Bus
      system bus connection ID define the identification of
      the application registering a GATT based
      service or profile.

      Parameters:
      _application - application
      _options - options
      Throws:
      BluezInvalidArgumentsException - when argument is invalid
      BluezAlreadyExistsException - when item already exists
    • UnregisterApplication

      void UnregisterApplication(org.freedesktop.dbus.DBusPath _application) throws BluezInvalidArgumentsException, BluezDoesNotExistException
      From bluez documentation:

      This unregisters the services that has been
      previously registered. The object path parameter
      must match the same value that has been used
      on registration.

      Parameters:
      _application - application
      Throws:
      BluezInvalidArgumentsException - when argument is invalid
      BluezDoesNotExistException - when item does not exist