* [PATCH BlueZ 3/3] test/example-gatt-server: Add more comments
2016-08-02 11:33 [PATCH BlueZ 1/3] doc/gatt-api: Mention available examples Luiz Augusto von Dentz
2016-08-02 11:33 ` [PATCH BlueZ 2/3] test/example-gatt-client: Add more comments Luiz Augusto von Dentz
@ 2016-08-02 11:33 ` Luiz Augusto von Dentz
2016-08-04 8:09 ` [PATCH BlueZ 1/3] doc/gatt-api: Mention available examples Luiz Augusto von Dentz
2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2016-08-02 11:33 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds more comments what the example is doing.
---
test/example-gatt-server | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/test/example-gatt-server b/test/example-gatt-server
index 84905f3..44ceb70 100755
--- a/test/example-gatt-server
+++ b/test/example-gatt-server
@@ -42,6 +42,9 @@ class FailedException(dbus.exceptions.DBusException):
class Application(dbus.service.Object):
+ """
+ org.bluez.GattApplication1 interface implementation
+ """
def __init__(self, bus):
self.path = '/'
self.services = []
@@ -74,6 +77,9 @@ class Application(dbus.service.Object):
class Service(dbus.service.Object):
+ """
+ org.bluez.GattService1 interface implementation
+ """
PATH_BASE = '/org/bluez/example/service'
def __init__(self, bus, index, uuid, primary):
@@ -121,6 +127,9 @@ class Service(dbus.service.Object):
class Characteristic(dbus.service.Object):
+ """
+ org.bluez.GattCharacteristic1 interface implementation
+ """
def __init__(self, bus, index, uuid, flags, service):
self.path = service.path + '/char' + str(index)
self.bus = bus
@@ -195,6 +204,9 @@ class Characteristic(dbus.service.Object):
class Descriptor(dbus.service.Object):
+ """
+ org.bluez.GattDescriptor1 interface implementation
+ """
def __init__(self, bus, index, uuid, flags, characteristic):
self.path = characteristic.path + '/desc' + str(index)
self.bus = bus
@@ -636,6 +648,8 @@ def main():
mainloop = GObject.MainLoop()
+ print('Registering GATT application...')
+
service_manager.RegisterApplication(app.get_path(), {},
reply_handler=register_app_cb,
error_handler=register_app_error_cb)
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ 1/3] doc/gatt-api: Mention available examples
2016-08-02 11:33 [PATCH BlueZ 1/3] doc/gatt-api: Mention available examples Luiz Augusto von Dentz
2016-08-02 11:33 ` [PATCH BlueZ 2/3] test/example-gatt-client: Add more comments Luiz Augusto von Dentz
2016-08-02 11:33 ` [PATCH BlueZ 3/3] test/example-gatt-server: " Luiz Augusto von Dentz
@ 2016-08-04 8:09 ` Luiz Augusto von Dentz
2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2016-08-04 8:09 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
Hi,
On Tue, Aug 2, 2016 at 2:33 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> ---
> doc/gatt-api.txt | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
> index f2f3d89..fd4bdd5 100644
> --- a/doc/gatt-api.txt
> +++ b/doc/gatt-api.txt
> @@ -307,6 +307,15 @@ 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
> +
> +
> Service org.bluez
> Interface org.bluez.GattManager1
> Object path [variable prefix]/{hci0,hci1,...}
> --
> 2.7.4
Applied.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread