Commit Graph

15 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
68fa26fb80 client: Add register-characteristic command
This adds register-characteristic which can be used to register
characteristic to a service registered with register-service:

register-characteristic 00002a06-0000-1000-8000-00805f9b34fb write-without-response
[NEW] Characteristic
	/org/bluez/app/service0x1122150/chrc0x113fa40
	00002a06-0000-1000-8000-00805f9b34fb
	Alert Level
2017-06-30 12:33:22 +03:00
Luiz Augusto von Dentz
bd35ab6bd4 client: Add unregister-service command
This adds unregister-service which can be used to unregister an
application service registered with register-service:

register-service 00001820-0000-1000-8000-00805f9b34fb
[NEW] Primary Service
	/org/bluez/app/service0x92a150
	00001820-0000-1000-8000-00805f9b34fb
	Internet Protocol Support
[bluetooth]# unregister-service /org/bluez/app/service0x92a150
[DEL] Primary Service
	/org/bluez/app/service0x92a150
	00001820-0000-1000-8000-00805f9b34fb
	Internet Protocol Support
2017-06-30 12:22:43 +03:00
Luiz Augusto von Dentz
0f47058a6e client: Add register-service command
This adds register-service command which can be used to add GATT services
to the application:

[bluetooth]# register-service 00001820-0000-1000-8000-00805f9b34fb
[NEW] Primary Service
	/org/bluez/app/service0x8c2610
	00001820-0000-1000-8000-00805f9b34fb
	Internet Protocol Support
[/org/bluez/app/service0x8c2610] Primary (yes/no): yes
[bluetooth]# register-application
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 0000112d-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 00001820-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:1B:DC:07:31:88 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb

Note: register-application still has to be called at the end to register
with bluetoothd as everything is done with ObjectManager.
2017-06-30 12:16:29 +03:00
Luiz Augusto von Dentz
f585e7ac8d client: Fix using RegisterProfile
RegisterProfile no longer works for registering GattProfile instances
as this functionality has been moved to RegisterApplication.

In order to make this more clear this replaces the (un)register-profile
with (un)register-application and enable ObjectManager, here is an
example how to register for 12345678-1234-5678-1234-56789abcdef1:

[bluetooth]# register-application 12345678-1234-5678-1234-56789abcdef1
Application registered

bluetoothd[8777]: src/gatt-database.c:manager_register_app() Registering application: :1.483:/
bluetoothd[8777]: src/gatt-database.c:proxy_added_cb() Object received: /org/bluez/application, iface: org.bluez.GattProfile1
bluetoothd[8777]: src/gatt-database.c:proxy_added_cb() Object received: /org/bluez/agent, iface: org.bluez.Agent1
bluetoothd[8777]: src/gatt-database.c:profile_add() Added ":1.483/org/bluez/application/12345678-1234-5678-1234-56789abcdef1"
bluetoothd[8777]: src/gatt-database.c:client_ready_cb() GATT application registered: :1.483:/

[bluetooth]# unregister-application
Application unregistered

bluetoothd[8777]: src/gatt-database.c:profile_remove() Removed ":1.483/org/bluez/application/12345678-1234-5678-1234-56789abcdef1"
bluetoothd[8777]: src/gatt-database.c:profile_release() Releasing ":1.483"
2017-05-29 16:02:34 +03:00
Luiz Augusto von Dentz
d4ecd13f8c client: Use selected attribute when selecting by UUID
There could be multiple instances of the same UUID, like e.g CCC and CEP,
so instead of matching the first one found from the beginning this uses
the current selected attribute as parent looking up existing child
attributes first.
2017-03-15 17:21:14 +02:00
Luiz Augusto von Dentz
84cc810f3f client: Add unregister-profile command
This adds support to unregister-profile command which uses
GattManager1.UnregisterProfile.
2015-03-25 12:34:49 +02:00
Luiz Augusto von Dentz
0677f7ac3e client: Add register-profile command
This adds support to register-profile command which uses
GattManager1.RegisterProfile.
2015-03-25 12:34:48 +02:00
Luiz Augusto von Dentz
fcbf38a99c client: Add notify command
This command can be used to start/stop changes on the attribute value,
it only works if an attribute has been selected with select-attribute.
2015-02-10 13:15:58 +02:00
Luiz Augusto von Dentz
52392d8405 client: Add write command
This command can be used to write attributes, it only works if an
attribute has been selected with select-attribute.

The data argument should be passed hexdump format, %02x separated by
spaces, which is the same format used by read command.
2015-02-10 13:15:58 +02:00
Luiz Augusto von Dentz
838bdbce23 client: Add read command
This command can be used to read attributes, it only works if an
attribute has been selected with select-attribute.
2015-02-10 13:15:58 +02:00
Luiz Augusto von Dentz
2eb1f615c4 client: Add command select-attribute
Command select-attribute can be used to select a service attribute.
2015-02-10 13:15:58 +02:00
Luiz Augusto von Dentz
496b6abf74 client: Add command list-attributes
This command can be used to list service attributes of a device.
2015-02-10 13:15:57 +02:00
Luiz Augusto von Dentz
77196fd631 client: Add support for GattDescriptor1
This add support for GattDescriptor1 interface detection and
prints when they are added or removed.
2015-02-10 13:15:57 +02:00
Luiz Augusto von Dentz
c6923a75ae client: Add support for GattCharacteristic1
This add support for GattCharacteristici1 interface detection and
prints when they are added or removed
2015-02-10 13:15:57 +02:00
Luiz Augusto von Dentz
aab6835b0a client: Add support for GattService1
This add support for GattService1 interface detection and prints when
they are added or removed
2015-02-10 13:15:57 +02:00