Commit Graph

489 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
e4fd2dc5aa client/player: Enable acquiring multiple transports
This enables acquiring multiple transports simultaneously.
2022-06-22 11:00:55 -07:00
Gopal Tiwari
b4233bca18 client/gatt: Fix memory leak issues
While performing the static tool analysis using coverity tool
found following reports

Error: RESOURCE_LEAK (CWE-772):
bluez-5.64/client/gatt.c:1531: leaked_storage: Variable "service"
going out of scope leaks the storage it points to.

Error: RESOURCE_LEAK (CWE-772):
bluez-5.64/client/gatt.c:2626: leaked_storage: Variable "chrc"
going out of scope leaks the storage it points to.

Error: RESOURCE_LEAK (CWE-772):
bluez-5.64/client/gatt.c:2906: leaked_storage: Variable "desc"
going out of scope leaks the storage it points to.
2022-05-31 12:48:33 -07:00
Inga Stotland
79fe529d64 client: Fix setting of advertisement interval
This fixes incorrect argument read when using "interval" command
in "advertisement" submenu
2022-05-23 13:47:15 -07:00
Zhengping Jiang
bda2a9e6f9 client: Add filter to devices and show Bonded in info
Use the property name as optional filters to the command "devices" and
show the "Bonded" property for the command "info".

Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Yun-Hao Chung <howardchung@chromium.org>
2022-05-04 14:56:05 -07:00
Luiz Augusto von Dentz
7a87497da4 client/player: Add transport.receive command
This adds transport.receive command:

Get/Set file to receive
Usage:
	 receive [filename]
2022-04-26 11:03:26 -07:00
Luiz Augusto von Dentz
dd5b66695c client/player: Add transport.volume command
This adds transport.volume command:

Get/Set transport volume
Usage:
	 volume <transport> [value]
2022-04-22 16:01:29 -07:00
Luiz Augusto von Dentz
b2db8f0e3a client/player: Fix use of unsupported config_qos
QoS is not yet supported by bluetoothd so remove them.
2022-04-18 16:57:49 -07:00
Luiz Augusto von Dentz
777bc7c3f5 client/player: Add transport menu
This adds transport menu:

[bluetooth]# menu transport
Menu transport:
Available commands:
-------------------
list                                              List available transports
show <transport>                                  Transport information
acquire <transport>                               Acquire Transport
release <transport>                               Release Transport
send <filename>                                   Send contents of a file
2022-04-14 17:05:25 -07:00
Luiz Augusto von Dentz
46f171a86c client/player: Add endpoint menu
This adds endpoint menu:

[bluetooth]# menu endpoint
Menu endpoint:
Available commands:
-------------------
list [local]                                      List available endpoints
show <endpoint>                                   Endpoint information
register <UUID> <codec> [capabilities...]         Register Endpoint
unregister <UUID/object>                          Register Endpoint
config <endpoint> <local endpoint> [preset]       Configure Endpoint
presets <UUID> [default]                          List available presets
2022-04-14 17:05:24 -07:00
Luiz Augusto von Dentz
d204e84c06 client: Add support for player submenu
This moves adds the functionality of bluetooth-player into
bluetoothctl.
2022-03-30 12:54:29 -07:00
Luiz Augusto von Dentz
18af5f4faf client: Add support for scan <le/bredr>
This adds support for entering the transport directly as an scan
argument rather than having to first set it scan.transport.
2022-03-02 16:30:11 -08:00
Luiz Augusto von Dentz
cfab569484 build: Replace use of g_memdup with util_memdup
This replaces the uses of g_memdup with util_memdup since the former has
been deprecated:

  warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead
  [-Wdeprecated-declarations]

g_memdup2 requires bumping glib version which would likely have its
own problems thus why util_memdup was introduced.
2022-01-06 12:58:39 -08:00
Ulisses Costa
433f7cce3b client/gatt: Fix property_change in WriteValue for desc
g_dbus_emit_property_changed was not working properly in the WriteValue
for the descriptor because the Characteristic interface was being used.
2021-12-07 18:48:46 -08:00
Tedd Ho-Jeong An
6ea642f6ef client: Fix uninitiailzed scalar variable
This patch fixes the uninitiailzed varialble(CWE-457) reported by
the Coverity scan.
2021-11-15 13:07:08 -08:00
Luiz Augusto von Dentz
8d2b847b00 client/gatt: Fix using atoi
atoi doesn't support values entered in hexadecimal (0x...) which is
likely the prefered format for the likes of handles, etc, so this
replaces the uses of atoi with strtol.
2021-11-09 14:45:23 -08:00
Miao-chen Chou
f4151f35b2 client: Print error code for connect methods
The following steps were performed.
- Issuing repeated commands to connect the same BLE device.
- Verifying the print in bluetoothctl console

Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Howard Chung <howardchung@google.com>
2021-10-04 15:44:56 -07:00
Luiz Augusto von Dentz
1e9ce5ed80 client: Print MTU on attribute-info
This prints the MTU of the characteristic when available.
2021-09-28 16:53:08 -07:00
Archie Pusaka
28a5c47650 client: Inclusive language changes
Use "parent" to describe dbus hierarchy.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-09-21 10:51:54 +02:00
Luiz Augusto von Dentz
b84f294cb1 client: Add support for printing ExperimentalFeatures property
Thid adds support to show command to print ExperimentalFeatures property:

[bluetooth]# show
Controller ...
	Experimental: BlueZ Experimental LL p.. (15c0a148-c273-11ea-b3de-0242ac130004)
2021-09-08 14:12:58 -07:00
Yun-Hao Chung
bb0714be21 client: add AffectedByPolicy property
This prints property AffectedByPolicy in device info if
org.bluez.AdminPolicyStatus1 exists.

This also rename find_battery_by_path to find_proxies_by_path to reuse
the function.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
2021-08-11 11:18:22 -07:00
Yun-Hao Chung
4f3adc7bef client: add admin submenu and allow command
This creates a menu - admin and add a commands to bluetoothctl
- allow [clear/uuid1 uuid2 ...]

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
2021-08-11 11:18:22 -07:00
Luiz Augusto von Dentz
f287a42cd6 client/advertising: Fix not disabling local-name in Includes
When setting a advertising.name other than on/off it shall also disable
local-name flag from Includes as that would cause an error when parsed
by the daemon.
2021-08-10 14:59:12 -07:00
Luiz Augusto von Dentz
c3159848b9 client: Fix advertise broadcast
When advertising with type broadcast it cannot be discoverable as that
would require setting flags which is not allowed by the spec.
2021-05-14 17:25:52 -07:00
Luiz Augusto von Dentz
4e7780d0eb client/advertising: Add support for setting min/max intervals
This adds support for setting MinInterval/MaxInterval.
2021-05-13 13:26:13 -07:00
Daniel Winkler
0b8e166fd8 client: Add adv SupportedFeatures to bluetoothctl
This change adds SupportedFeatures to be shown in "show" option of
bluetoothctl. It was tested with and without kernel support for features
to verify that they are shown or not shown correctly.

Change was tested by verifying SupportedFeatures were populated
correctly in bluetoothctl on hatch and kukui chromebooks

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
2021-03-17 11:30:27 -07:00
Archie Pusaka
ad02a4eddb bluetoothctl: advmon rssi support for mgmt
Using the new opcode MGMT_OP_ADD_ADV_PATTERNS_MONITOR_RSSI to
monitor advertisement according to some RSSI criteria.
2021-01-15 11:55:06 -08:00
Manish Mandlik
fa53b7018b client: Use correct root path for RegisterMonitor
Bluetoothctl uses "/" as the app root path. So, use the same
app root path while invoking RegisterMonitor method. This will
also ensure that InterfacesAdded/InterfacesRemoved signals are
emitted on the correct app root path.
2020-12-02 21:09:07 -08:00
Inga Stotland
c29a438abe client: Remove reference to g_steal_pointer()
In order to avoid requiring higher version of GLib, replace
g_steal_pointer() with explicitly setting the pointer value
to NULL.
2020-11-09 13:54:06 -08:00
Daniel Winkler
664c55440b client: Add SupportedCapabilities to bluetoothctl
This patch adds the new "SupportedCapabilities" property to the
bluetoothctl "show" view.

The change is tested by verifying bluetoothctl shows the desired
properties.
2020-10-29 17:45:40 -07:00
Tedd Ho-Jeong An
f22f166d6e client: Add SPDX License Identifier
This patch adds SPDX License Identifier and removes the license text.

-------------------------------------
       License            COUNT
-------------------------------------
 GPL-2.0-or-later     :      11

License: GPL-2.0-or-later
   client/adv_monitor.c
   client/adv_monitor.h
   client/advertising.h
   client/display.c
   client/main.c
   client/display.h
   client/agent.h
   client/gatt.c
   client/agent.c
   client/advertising.c
   client/gatt.h
2020-09-21 16:19:33 -07:00
Howard Chung
d465c70f9b client: Expose ADV monitor objects
This adds logic to expose user-defined advertisement monitor to dbus and
also implements methods for exposed objects.
2020-09-16 09:38:14 -07:00
Howard Chung
566db0ed69 client: Implement more interfaces of ADV monitor in bluetoothctl
This patch creates a submenu in bluetoothctl and implements several
commands.

new commands:
[bluetooth]# menu monitor
[bluetooth]# add-or-pattern 1 2 ab0011
Advertisement Monitor 0 added
[bluetooth]# add-or-pattern-rssi -80, ,5 1 2 aa 3 4 ff
Advertisement Monitor 1 added
[bluetooth]# get-pattern all
Advertisement Monitor 0
	path: /org/bluez/adv_monitor_app/0
	type: or_patterns
	pattern 1:
		start position: 1
		AD data type: 2
		content: ab0011
Advertisement Monitor 1
	path: /org/bluez/adv_monitor_app/1
	type: or_patterns
	rssi:
		high threshold: -50
		high threshold timer: 5
		low threshold: -80
		low threshold timer: 5
	pattern 1:
		start position: 1
		AD data type: 2
		content: aa
	pattern 2:
		start position: 3
		AD data type: 4
		content: ff
[bluetooth]# get-supported-info
Supported Features:
Supported Moniter Types: or_patterns
[bluetooth]# remove-pattern 0
Monitor 0 deleted
2020-09-16 09:38:03 -07:00
Howard Chung
664e10ff7e client: Implement basic interface of ADV monitor in bluetoothctl
This patch implements some basic functions for ADV monitor in
bluetoothctl

[bluetooth]# show
...
Advertisement Monitor Features:
	SupportedMonitorTypes: or_patterns
2020-09-16 09:37:42 -07:00
Barry Byford
c24db50c43 client: Fix typo in bluetoothctl 2020-08-31 10:33:48 -07:00
Miao-chen Chou
4d0336ea40 client: Add cancel-pairing command
This adds cancel-pairing command which can be used to cancel the ongoing
pairing.
2020-08-21 10:50:04 -07:00
Alain Michaud
615d82331d client: Add support for the Roles property.
This adds support for reading the Roles property through bluetootctl's
show option.

[bluetooth]# show
...
Roles: central
Roles: peripheral
Roles: central-peripheral
2020-07-07 10:49:34 -07:00
Abhishek Pandit-Subedi
d4c2c8a473 client: Display wake allowed property with info
Display whether the device is configured as wake allowed when queried
with cmd_info.
2020-07-07 10:46:48 -07:00
Sonny Sasaka
841b7ebe0f client: Add battery percentage to info command
This adds the Battery Percentage to the info command based on
org.bluez.Battery1 API. Example usage:

[bluetooth]# info XX:XX:XX:XX:XX:XX
Device XX:XX:XX:XX:XX:XX (random)
        Name: ...
        Alias: ...
        ...
        Modalias: ...
        Battery Percentage: 0x64 (100)
2020-07-02 16:22:10 -07:00
Mariusz Skamra
236fb26ff4 client: Update write callbacks with invalid offset error handlers
This patch adds invalid offset handlers to write callbacks of attributes.
2020-05-11 15:26:55 +02:00
Łukasz Rymanowski
1c2271575d client: Fix possible stack corruption
DBUS_TYPE_BOOLEAN is 'int', which does not have to be the same size as
'bool'.
On architecture where bool is smaller than in, getting prepare-authorize
will corrupt the stack
2020-05-11 15:26:55 +02:00
Luiz Augusto von Dentz
397cbeb864 client: Make advertise instances default to discoverable
The more common case is that advertisements are discoverable not the
other way around.
2020-04-07 12:52:23 -07:00
Luiz Augusto von Dentz
4ec7da4037 client: Add scan.pattern command
This uses the new Pattern filter:

[bluetooth]# scan.pattern Living
[bluetooth]# scan on
SetDiscoveryFilter success
Discovery started
[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: yes
[NEW] Device XX:XX:XX:XX:XX:XX Living Room TV
2020-02-19 16:25:04 -08:00
Syam Sidhardhan
a64d370949 client: Fix memory leak 2019-12-08 06:08:46 +02:00
Ronan Pigott
d45b4ac3ec client/main: add help option for available args
This option exists to facilitate external completion of commands that
have specially defined arguments. It effectively adds two new commands
to bluetoothctl with the following output:

$ bluetoothctl agent help
on
off
DisplayOnly
DisplayYesNo
KeyboardDisplay
KeyboardOnly
NoInputNoOutput

$ bluetoothctl advertise help
on
off
peripheral
broadcast

Shell completion scripts can then parse this output to provide
completions for those commands.
2019-09-06 10:57:10 +03:00
Luiz Augusto von Dentz
19329b3f68 client: Fix not able to select attributes if parent exists
When selecting attributes by UUID the code was not checking attributes
that are not a children of the current selected attribute.
2019-08-20 16:47:29 +03:00
Luiz Augusto von Dentz
31d7430759 client: Allow UUID 16 bits on select-attribute
This allow passing UUIDs on 16 bits format.
2019-08-20 16:47:29 +03:00
Luiz Augusto von Dentz
b723fafbbe client: Fix crash when setting advertising.discoverable on
DBUS_TYPE_BOOLEAN expect a pointer to dbus_bool_t not bool.
2019-05-10 14:58:09 +03:00
Luiz Augusto von Dentz
bbfaae247f client: Fix build with older version on libdbus
This fixes the following error when building with older version of
D-Bus:

client/gatt.c:2973: undefined reference to `dbus_message_iter_get_element_count'
2019-02-26 19:24:40 +02:00
Luiz Augusto von Dentz
d705d726c6 client: Print AdvertisingManager properties on command 'show'
This outputs the AdvertisingManager properties command 'show':

bluetoothctl> show
...
Advertising Features:
	ActiveInstances: 0x00
	SupportedInstances: 0x05
	SupportedIncludes: tx-power
	SupportedIncludes: appearance
	SupportedIncludes: local-name
2019-02-21 14:08:57 +02:00
Luiz Augusto von Dentz
bd0808bf01 client: Add advertise.secondary command
This adds advertose.secondary command which can be used to set a
secondary channel to advertise.
2019-02-21 14:08:52 +02:00
Luiz Augusto von Dentz
64438092cb client: Fix uninitialized error
trusted should be initialized with false since the property may not be
available.
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
15cbd14aaa client: Improve logging of GATT operations
This prints the UUID along with attribute path and also print the
hexdump when payload is available.
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
f12dc48511 client: Forward notifications from cloned attributes
Notifications come in a form of 'Value' property changes thus this
copies the values to the local attribute so they are in sync.
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
40ebc70dae client: Remove cloned services if the proxy is removed
This unregister the cloned services if the proxy is removed since they
would no longer be accessible.
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
8ba5b4fb21 client: Proxy calls to StartNotify/StopNotify
This uses the proxies created by clone command to forward the
subscriptions to the cloned services.
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
32232aba53 client: Proxy calls to ReadValue and WriteValue
This uses the proxies created by clone command to forward the requests
to the cloned services.
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
183d47c176 client: Add gatt.clone command
This adds clone command to gatt submenu which can be use to clone
services as follow:

Clone all services from the connected device:
> gatt.clone

Clone a given service
> gatt.select-attribute <attribute/uuid>
> gatt.clone

In either case there is a prompt to confirm since this may add a lot of
service the user must confim before proceding.

Then finally:

> gatt.register-application
2019-02-13 17:09:13 +02:00
Luiz Augusto von Dentz
db15160d5c client: Add type to write command
This enables setting the write type as optional third parameter:

write <data=xx xx ...> [offset] [type]

The type can be used to force a specific procedure to be used, for
example to force reliable writes one can enter:

> write 00 0 reliable
2019-02-11 11:29:21 +02:00
Luiz Augusto von Dentz
b52543ae3d client: Don't expose pointer value in attribute path
Instead use the position in the list to create a unique path:

[bluetooth]# register-service 0x1820
[NEW] Primary Service (Handle 0x0000)
	/org/bluez/app/service0
	0x1820
	Internet Protocol Support
2019-01-31 14:10:56 +02:00
Luiz Augusto von Dentz
d5cb29ce5a client: Enable list-attributes to print local attributes
This enable passing "local" to list-attributes to print the attributes
registered locally:

> list-attributes local
Primary Service (Handle 0x0400)
	/org/bluez/app/service0x74ccb0
	0x1820
	Internet Protocol Support
2019-01-31 14:10:54 +02:00
Luiz Augusto von Dentz
918f6f932b client: Enable setting attribute handles
This emulates application setting their attribute handles.
2019-01-31 14:10:51 +02:00
Luiz Augusto von Dentz
ae63206ff8 client: Enable Handle property for GATT attributes
This enable bluetoothd to write back the actual value of attribute
handles.
2019-01-31 14:10:50 +02:00
Marcel Holtmann
261948090e build: Move declaration of _GNU_SOURCE back into individual source files 2018-12-06 21:28:18 +01:00
Luiz Augusto von Dentz
91df85690c client: Switch from write to sendmsg for Acquire*
Use sendmsg with MSG_NOSIGNAL to prevent crashes involving SIGPIPE.
2018-11-20 11:28:29 +02:00
Luiz Augusto von Dentz
847dcb2a6c client: Fix not resetting filters on scan.clear
If call to SetDiscoveryFilter comes with any value set the daemon will
not attempt to clear the filters, instead the client is suppose to send
an empty dict.
2018-08-01 14:55:40 +03:00
Luiz Augusto von Dentz
151a80b6ac client: Commit changes to scan filter if active
This detects if the command scan has been triggered and if so commit
changes to filter immediately so they take effect in the current
session.
2018-08-01 14:55:40 +03:00
Luiz Augusto von Dentz
9a57d90628 client: Add scan.clear discoverable
This implements scan.clear for discoverable filter.
2018-08-01 14:55:39 +03:00
Luiz Augusto von Dentz
170ff3b81f client: Add scan.discoverable command
This adds discoverable command to scan menu which can be used to set
if adapter should become discoverable while scanning:

[bluetooth]# scan.discoverable on
[bluetooth]# scan on
SetDiscoveryFilter success
[CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: yes
Discovery started
[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: yes
[bluetooth]# scan off
Discovery stopped
[CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: no
2018-08-01 14:55:39 +03:00
Luiz Augusto von Dentz
ee863d9d5d client: Make show command print DiscoverableTimeout
Controller XX:XX:XX:XX:XX:XX (public)
	Name: Vudentz's T460s
	Alias: Intel-1
	Class: 0x004c010c
	Powered: yes
	Discoverable: no
	DiscoverableTimeout: 0x00000000
	Pairable: yes
	UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: SIM Access                (0000112d-0000-1000-8000-00805f9b34fb)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v1D6Bp0246d0532
	Discovering: no
2018-07-30 09:36:27 +03:00
Luiz Augusto von Dentz
2796d545e8 client: Add discoverable-timeout command
This adds discoverable-timeout command which can be used to get/set
DiscoverableTimeout property:

[bluetooth]# discoverable-timeout 180
Changing discoverable-timeout 180 succeeded
2018-07-30 09:36:23 +03:00
Grzegorz Kolodziejczyk
1e32752f38 client: Don't require authorization for trusted devices
This patch adds possibility to ommit authorization request from trusted
devices.
2018-05-29 14:06:34 +03:00
Grzegorz Kolodziejczyk
822f082063 client: Add authorized property handling to characteristic attribute
This patch adds handling of characteristic prepare write authorized
property to bluetoothctl.
2018-05-28 16:29:11 +03:00
Luiz Augusto von Dentz
806276fe54 client: Add advertise.discoverable-timeout command
This adds advertise.discoverable-timeout command which can be used to
limit the amount of time the advertisement is discoverable:

[bluetooth]# advertise.discoverable on
[bluetooth]# advertise.discoverable-timeout 10
[bluetooth]# advertise on

@ MGMT Command: Add Advertising (0x003e) plen 14
        Instance: 1
        Flags: 0x00000001
          Switch into Connectable mode
        Duration: 0
        Timeout: 0
        Advertising data length: 3
        Flags: 0x02
          LE General Discoverable Mode
        Scan response length: 0
@ MGMT Event: Advertising Added (0x0023) plen 1
        Instance: 1
@ MGMT Event: Command Complete (0x0001) plen 4
      Add Advertising (0x003e) plen 1
        Status: Success (0x00)
        Instance: 1
@ MGMT Command: Add Advertising (0x003e) plen 14
        Instance: 1
        Flags: 0x00000001
          Switch into Connectable mode
        Duration: 0
        Timeout: 0
        Advertising data length: 3
        Flags: 0x00
        Scan response length: 0
2018-05-24 11:09:31 +03:00
Luiz Augusto von Dentz
e8f51b980c client: Print AD Data and Discoverable once registered
This prints both Data and Discoverable if advertise command succeeds:

[bluetooth]# advertise.data 0x26 0x01 0x00
[bluetooth]# advertise.discoverable on
[bluetooth]# advertise on
Advertising object registered
Data Type: 0x26
  01 00                                            ..
Tx Power: off
Name: off
Apperance: off
Discoverable: on
2018-05-24 11:09:30 +03:00
Luiz Augusto von Dentz
4f68e5f1fe client: Add advertise.discoverable command
This adds advertise.discoverable command which can be used to set it
own instance:

[bluetooth]# advertise.discoverable on
[bluetooth]# advertise on

@ MGMT Command: Add Advertising (0x003e) plen 14
        Instance: 1
        Flags: 0x00000001
          Switch into Connectable mode
        Duration: 0
        Timeout: 0
        Advertising data length: 3
        Flags: 0x02
          LE General Discoverable Mode
        Scan response length: 0
< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
        Length: 3
        Flags: 0x02
          LE General Discoverable Mode
2018-05-24 11:09:30 +03:00
Luiz Augusto von Dentz
8cfef5aa0c client: Fix use of g_free
g_free shall only be used with pointer allocated with g_* functions.
2018-05-21 11:35:06 +03:00
Avichal Agarwal
8f970c44e6 client/gatt : Add support for Included Service
included service support implemented at service registration
2018-05-21 11:30:05 +03:00
Nagaraj D R
454fdfb541 Fix possible invalid memory access
Uninitialized data is read from local variable 'addr'
2018-05-21 11:28:43 +03:00
Grzegorz Kolodziejczyk
d2277dfa5f client: Define maximum attribute value length as initial value
Initial registered attribute value is set as maximal attribute length.
2018-05-21 11:09:30 +03:00
Grzegorz Kolodziejczyk
48dd3a49fb client: Add missing duplicated string free
This patch free duplicated strings in read, write attribute callbacks.
2018-05-21 11:09:29 +03:00
Luiz Augusto von Dentz
884fe6c82c client: Make info command print Advertising{Flags,Data} 2018-05-02 12:01:50 +03:00
Luiz Augusto von Dentz
72c9b97f5e client: Add support for setting advertising Data property
This adds data command to advertise menu which can be used to set
an arbitrary/profile specific advertising type and data:

[bluetooth]# data 0x26 0x01 0x01 0x00
2018-05-02 12:01:41 +03:00
Grzegorz Kolodziejczyk
7f9dcb3c45 client: Add support for optional gatt write offset parameter
This patch extends missing optional gatt write offset parameter.
2018-04-26 15:53:38 +03:00
Grzegorz Kolodziejczyk
5d50dc020b client: Add support for optional gatt read offset parameter
This patch extends missing optional gatt read offset parameter.
2018-04-26 15:53:37 +03:00
Grzegorz Kolodziejczyk
1dd33d584c client: Fix writing attribute values
Attribute values is not copied with dbus_message_iter_get_fixed_array,
so gatt write callback needs to replace old value with reallocation and
copy.
2018-04-26 15:53:37 +03:00
Luiz Augusto von Dentz
9f1388f2cf client: Attempt to convert the device path to address
Printing the object path is not only long but it also may change.
2018-03-29 14:10:25 +03:00
Luiz Augusto von Dentz
650a0d814a client: Add envs for proxies
This adds envs for device and adapter proxies found so other files are
able to access them.
2018-03-29 14:10:25 +03:00
ERAMOTO Masaya
14388c1d94 client: Return exit status for non-interactive 2018-03-27 13:58:17 +03:00
Luiz Augusto von Dentz
db663b1d57 client: Parse all options passed for GATT attribute
This parses the options given to Acquire*, WriteValue and ReadValue.
2018-03-26 16:19:29 +03:00
ERAMOTO Masaya
76d29b9bad client: Fix stay on error handling in non-interactive
Returns the FAILURE status since there is no meaning of stay in
non-interactive mode when executing some commands with an invalid
argument or with no controller. Also returns with the SUCCESS status
when getting a scan filtering value or disconnecting a non-default
device.
2018-03-23 13:19:04 +02:00
Grzegorz Kolodziejczyk
d3f155e458 client: Add authorization request handling for attribute operations
This patch adds optional authorization request for reading, writing of
gatt database attributes.
2018-03-21 11:25:52 +01:00
Grzegorz Kolodziejczyk
bc6facb0cf client: Update read callbacks with invalid offset error handlers
This patch adds invalid offset handlers to read callbacks of attributes.
2018-03-21 10:47:07 +01:00
Grzegorz Kolodziejczyk
1abee58711 client: Fix reading long values
While value has more than single MTU can carry long read procedure will
be triggered. In such cases offset need to bo considered while getting
value from storage.
2018-03-21 10:47:07 +01:00
Luiz Augusto von Dentz
41465ce57c client: Fix lines going beyond 80 columns 2018-03-01 11:23:09 +02:00
ERAMOTO Masaya
237365998f client: Use g_dbus_dict_append_*() 2018-03-01 10:49:05 +02:00
Luiz Augusto von Dentz
936ad5ef7b client: Quit when done with command
This ensures that the commands don't stay hanging since bt_shell no
longer quits immediatelly after executing a command.
2018-02-28 16:17:13 +02:00
Luiz Augusto von Dentz
fd656b1ce3 client: Don't auto register agent on non-interactive mode
There is no use to register an agent when on non-interactive mode.
2018-02-22 11:52:16 +02:00
ERAMOTO Masaya
9c90fc508d client: Add clear command for advertise
Adds the clear command to advertise-related commands to clear individual
fields or whole of advertise configuration.
2018-02-19 12:21:11 +02:00
ERAMOTO Masaya
4d04b9f573 client: Introduce ad_disable_{uuids,service,manufacturer} 2018-02-19 12:21:11 +02:00
ERAMOTO Masaya
f0fccd6f4d client: Introduce data_clear() calling ->clear() 2018-02-19 12:21:11 +02:00
ERAMOTO Masaya
0540ff6339 client: Improve help messages for advertise 2018-02-19 12:21:11 +02:00
ERAMOTO Masaya
3df943537a client: Fix data growth if reconfiguring ad service
Since commit 65eff5c2 ("client: Rename set-service to service"), data
are appended in every run of advertise service with data arguments as
below:

  [bluetooth]# service 1 1 2
  [bluetooth]# service
  UUID: SDP(1)
    01 02                                            ..
  [bluetooth]# service 1 1 2 3
  [bluetooth]# service
  UUID: SDP(1)
    01 02 01 02 03                                   .....
2018-02-19 12:21:11 +02:00
ERAMOTO Masaya
7c6d0647ee client: Not output ad service info if no uuid sets 2018-02-19 12:21:11 +02:00
ERAMOTO Masaya
3de5807a53 client: Fix null output for ad service uuid
If getting the advertise service information without setting, outputs
null as UUID as below:

  [bluetooth]# service
  UUID: ((null))
2018-02-19 12:21:11 +02:00
Luiz Augusto von Dentz
17c8980ad3 client: Fix not cleaning up notify pipe
If remote unsubscribe, disconnects or the daemon closes the socket the
io shall be destroyed properly otherwise it will prevent new
subscriptions.
2018-02-06 09:54:13 -02:00
Luiz Augusto von Dentz
36e0a8f817 client: Don't set generators for modes
Commands that already have all values set on the argument string don't
need to add a generator since bt_shell can now auto complete them.
2018-02-06 09:54:13 -02:00
Luiz Augusto von Dentz
0c8e542c4d client: Print advertising details
Print advertising details when active.
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
5c6ef1c396 client: Rename set-timeout to timeout
Make the command return the current value if no parameters:

[bluetooth]# timeout 1
[bluetooth]# timeout
Timeout: 1 sec
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
f309255a99 client: Rename set-duration to duration
Make the command return the current value if no parameters:

[bluetooth]# duration 1
[bluetooth]# duration
Duration: 1 sec
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
aebb7e1973 client: Rename set-appearance to appearance
Make the command return the current value if no parameters:

[bluetooth]# appearance 0x0001
[bluetooth]# appearance
Appearance: Unknown (0x0001)
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
821ad2ecd4 client: Rename set-name to name
Make the command return the current value if no parameters:

[bluetooth]# name blah
[bluetooth]# name
LocalName: blah
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
0c33c99102 client: Rename set-tx-power to tx-power
Make the command return the current value if no parameters:

[bluetooth]# tx-power on
[bluetooth]# tx-power
Tx Power: on
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
045e6b9a10 client: Rename set-manufacturer to manufacturer
Make the command return the current value if no parameters:

[bluetooth]# manufacturer 2 00
[bluetooth]# manufacturer
Manufacturer: 2
  00
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
65eff5c2eb client: Rename set-service to service
Make the command return the current value if no parameters:

[bluetooth]# service 0x1820 00 00 00
[bluetooth]# service
	UUID: Internet Protocol Support (0x1820)
  00 00 00                                         ...
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
6f20dba32d client: Rename set-uuids to uuids
Make the command return the current value if no parameters:

[bluetooth]# uuids 0x1820
[bluetooth]# uuids
UUID: Internet Protocol Support (0x1820
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
7b0e377b0d client: Fix register-{characteristic, descriptor}
Flags parameter should be found in the third parameter not the second
since bt_shell don't omit the command anymore.
2018-01-16 17:02:53 -02:00
Luiz Augusto von Dentz
d80f68286c client: Remove use of double const argument 2018-01-02 14:19:26 -02:00
ERAMOTO Masaya
203f5cb2f0 client: Use g_dbus_proxy_path_lookup() 2018-01-02 14:15:54 -02:00
ERAMOTO Masaya
6bf4c63d66 client: Use g_dbus_proxy_lookup() 2018-01-02 14:15:46 -02:00
Luiz Augusto von Dentz
7a03b61ee8 tools: Remove monitor/uuid.{c,h}
Use the shared/util.h helpers instead.
2017-12-21 10:08:22 -02:00
Szymon Janc
6c91d28459 client: Print Address type in show and info commands 2017-12-19 12:59:19 +01:00
Luiz Augusto von Dentz
a157235d66 client: Only set the discovery filter when necessary
Only set the discovery filter when the user wants execute the scan
command.
2017-12-16 16:53:50 +01:00
Luiz Augusto von Dentz
093768cd10 client: Add generator for scan:clear
This adds tab generator for scan:clear:

[bluetooth]# clear
duplicate-data  pathloss        rssi            transport       uuids
2017-12-16 16:50:05 +01:00
Luiz Augusto von Dentz
b80e11bf5c client: Make scan:clear clear individual fields
This reintroduces the option to clear individual fields which was
removed when redesining the commands which now read the fields when
no arguments are provided.
2017-12-16 16:50:04 +01:00
Luiz Augusto von Dentz
94c0774c31 client: Group discovery filter variables into a struct
This should be easier to read and maintain.
2017-12-16 16:50:03 +01:00
Luiz Augusto von Dentz
902ff0e049 client: Fix command scan:clear
Command clear shall clear all filters including DuplicateData.
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
3d15298157 client: Rename set-filter-clear to clear
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters.
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
cd2dcedfc9 client: Rename set-filter-duplicate-data to duplicate-data
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# duplicate-data on
SetDiscoveryFilter success
[bluetooth]# duplicate-data
DuplicateData: on
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
745918dfe2 client: Rename set-filter-transport to transport
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# transport le
SetDiscoveryFilter success
[bluetooth]# transport
Transport: le
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
5ed59502c2 client: Rename set-filter-pathloss to pathloss
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# pathloss 0
SetDiscoveryFilter success
[bluetooth]# pathloss
Pathloss: 0
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
4a6a055681 client: Rename set-filter-rssi to rssi
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# rssi 0
SetDiscoveryFilter success
[bluetooth]# rssi
RSSI: 0
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
e1021f7e48 client: Rename set-filter-uuids to uuids
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# uuids 0x1820
SetDiscoveryFilter success
[bluetooth]# uuids
	UUID: Internet Protocol Support (0x1820)

Note that to filter all UUIDs user must now use "all" instead of empty
list.
2017-12-14 16:31:23 -02:00
Szymon Janc
34553c1f74 client: Fix printing of array properties
ServiceData Key: 00001234-0000-1000-8000-00805f9b34fb
        ServiceData Value:
"3D     RSSI: -76
        TxPower: -7
2017-12-14 09:22:22 +01:00
Luiz Augusto von Dentz
8c60a31651 client: Add description for submenus
This adds proper descriptions for each submenu.
2017-12-13 10:08:38 -02:00
Luiz Augusto von Dentz
7c16c4044d shell: Add bt_shell_opt
Make use of struct option and getopt_long to parse the options given.
2017-12-08 13:06:19 +02:00
Luiz Augusto von Dentz
ab41d6df80 client: Fix arguments of set-filter-clear
Commands with no arguments shall use NULL not empty string.
2017-12-08 13:06:17 +02:00
Luiz Augusto von Dentz
8edcc31fa2 shared/shell: Don't remove command from arguments
Maintain the original argc and argv so the callback has a chance to
parse the command if it has to.
2017-12-08 13:06:11 +02:00
ERAMOTO Masaya
5e7ad41d08 shared/shell: Fix no version output with option
bluetoothctl does output the following error message with the option
-v/--version.

  $ bluetoothctl --version
  Unknown option --version
2017-12-05 16:18:57 -02:00
Luiz Augusto von Dentz
7cf75e0ca6 client: Fix format of arguments of set-service and set-manufacturer
Optional arguments should contain only one set of '[' ']' otherwise
wordexp won't be able to parse it.
2017-11-28 11:02:32 +02:00
Luiz Augusto von Dentz
6962f889bc client: Remove argument checks
This is now done automatically by bt_shell with the use of the
arguments entered in the command table.
2017-11-28 11:02:32 +02:00
Luiz Augusto von Dentz
a554a39dda client: Move set-alias back to main menu
set-alias is not GATT related command.
2017-11-21 17:23:12 +02:00
Luiz Augusto von Dentz
83e34edae3 client: Fix crashing on disconnect command
disconnect callback was writing on the argv pointer causing word
wordfree to access invalid memory:

Invalid free() / delete / delete[] / realloc()
  at 0x4C2FD18: free (vg_replace_malloc.c:530)
  by 0x56E8588: wordfree (in /usr/lib64/libc-2.25.so)
  by 0x41D0EB: rl_handler (shell.c:388)
  by 0x53CDB6D: rl_callback_read_char (in /usr/lib64/libreadline.so.7.0)
  by 0x41CA20: input_read (shell.c:661)
  by 0x41D88A: watch_callback (io-glib.c:170)
  by 0x4E85246: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5200.3)
  by 0x4E855E7: ??? (in /usr/lib64/libglib-2.0.so.0.5200.3)
  by 0x4E85901: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5200.3)
  by 0x41D77D: bt_shell_run (shell.c:609)
  by 0x4055E4: main (main.c:2502)
Address 0x76afcb4 is 4 bytes inside a block of size 30 alloc'd
  at 0x4C2EB6B: malloc (vg_replace_malloc.c:299)
  by 0x517F803: ??? (in /usr/lib64/libdbus-1.so.3.19.0)
  by 0x516D32A: dbus_message_copy (in /usr/lib64/libdbus-1.so.3.19.0)
  by 0x4195F4: prop_entry_update.isra.1 (client.c:186)
  by 0x4197C4: prop_entry_new (client.c:202)
  by 0x4197C4: add_property (client.c:237)
  by 0x4199A5: update_properties (client.c:277)
  by 0x419E74: parse_properties (client.c:974)
  by 0x419E74: parse_interfaces (client.c:1001)
  by 0x41B412: parse_managed_objects (client.c:1093)
  by 0x41B412: get_managed_objects_reply (client.c:1114)
  by 0x51607A1: ??? (in /usr/lib64/libdbus-1.so.3.19.0)
  by 0x516411E: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.19.0)
  by 0x41261F: message_dispatch (mainloop.c:72)
  by 0x4E81C26: ??? (in /usr/lib64/libglib-2.0.so.0.5200.3)
2017-11-20 17:11:50 +02:00
Luiz Augusto von Dentz
0fb2aff316 shared/shell: Use wordexp to parse arguments
This ensures the arguments are parsed properly.
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
7319353d40 client: Move gatt related commands to a submenu
All commands related to gatt settings are now under gatt
submenu:

[bluetooth]# menu gatt
Menu gatt:
Available commands:
-------------------
list-attributes [dev]                             List attributes
set-alias <alias>                                 Set device alias
select-attribute <attribute/UUID>                 Select attribute
attribute-info [attribute/UUID]                   Select attribute
read                                              Read attribute value
write <data=[xx xx ...]>                          Write attribute value
acquire-write                                     Acquire Write file descriptor
release-write                                     Release Write file descriptor
acquire-notify                                    Acquire Notify file descriptor
release-notify                                    Release Notify file descriptor
notify <on/off>                                   Notify attribute value
register-application [UUID ...]                   Register profile to connect
unregister-application                            Unregister profile
register-service <UUID>                           Register application service.
unregister-service <UUID/object>                  Unregister application service
register-characteristic <UUID> <Flags=read,write,notify...> Register application characteristic
unregister-characteristic <UUID/object>           Unregister application characteristic
register-descriptor <UUID> <Flags=read,write...>  Register application descriptor
unregister-descriptor <UUID/object>               Unregister application descriptor
back                                              Return to main menu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
3e55926dac client: Move scan related commands to a submenu
All commands related to scan settings are now under scan
submenu:

[bluetooth]# menu scan
Menu scan:
Available commands:
-------------------
set-filter-uuids [uuid1 uuid2 ...]                Set scan filter uuids
set-filter-rssi [rssi]                            Set scan filter rssi, and clears pathloss
set-filter-pathloss [pathloss]                    Set scan filter pathloss, and clears rssi
set-filter-transport [transport]                  Set scan filter transport
set-filter-duplicate-data [on/off]                Set scan filter duplicate data
set-filter-clear                                  Clears discovery filter.
back                                              Return to main menu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
ae3da8a270 client: Move advertise related commands to a submenu
All commands related to advertise settings are now under advertise
submenu:

> menu advertise
Menu advertise:
Available commands:
-------------------
set-uuids [uuid1 uuid2 ...]                       Set advertise uuids
set-service [uuid][data=[xx xx ...]               Set advertise service data
set-manufacturer [id][data=[xx xx ...]            Set advertise manufacturer data
set-tx-power <on/off>                             Enable/disable TX power to be advertised
set-name <on/off/name>                            Enable/disable local name to be advertised
set-appearance <value>                            Set custom appearance to be advertised
set-duration <seconds>                            Set advertise duration
set-timeout <seconds>                             Set advertise timeout
back                                              Return to main menu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
09391c5886 shared/shell: Add submenu support
This adds submenu support so application can have one extra level of
menus to better organize the interface.

Submenus will be show in the output of help command, to select a
submenu:

> menu <name>

To move back to main menu:

> back
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
70b8b754f8 client: Make use of bt_shell
Use bt_shell instead of readline directly.
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
068e0ba214 client: Add set-advertise-{duration, timeout}
This adds the following command which can be used to control the
advertisement intervals:

[bluetooth]# set-advertise-duration 4
[bluetooth]# set-advertise-timeout 4
[bluetooth]# advertise on
[CHG] Controller B8:8A:60:D8:17:D7 SupportedInstances: 0x04
[CHG] Controller B8:8A:60:D8:17:D7 ActiveInstances: 0x01
Advertising object registered
[CHG] Controller B8:8A:60:D8:17:D7 SupportedInstances: 0x05
[CHG] Controller B8:8A:60:D8:17:D7 ActiveInstances: 0x00
2017-11-02 16:03:41 +02:00
ERAMOTO Masaya
8221f8336c client: Clear ad manufacturer/service data when too much data
When data is too much, the data may include values not making sense, so
this patch clears the advertising manufacturer/service data corresponding
to the running command.
2017-11-02 13:18:19 +02:00
ERAMOTO Masaya
d3974659e3 client: Fix clearing advertising service data
Even if running set-advertise-manufacturer with data having an invalid
value, client does not clear the advertising service data and clears the
advertising manufacturer data.
2017-11-02 13:18:19 +02:00
Luiz Augusto von Dentz
f9a2b1f515 client: Fix not detecting advertising instance is no longer valid
If the advertising interfaces is removed while registered it should be
considered unregistered.
2017-11-02 13:18:19 +02:00
Anupam Roy
bdfe5fcee3 client: Fix segmentation fault while fetching advertising data
While testing advertisement, I encountered Seg fault in client, when bluetoothd
tries to fetch the Adv data set by client. It can happen either while fetching
Manufacturer specific data or Service data. Backtrace is provided below for reference
After fix is applied, advertisement works fine for me. I am sending the following patch
your review. Thank you.

Passing val instead of &val in dbus_message_iter_append_fixed_array
DBUS API causes segmentation fault while fecthing Manufacturer
data or service data set by client.

BT Before Fix:
[bluetooth]# set-advertise-name Test
[bluetooth]# set-advertise-uuids 0x1824
[bluetooth]# set-advertise-manufacturer 0x75 0x02 0x03 0x04
[bluetooth]# advertise on

Program received signal SIGSEGV, Segmentation fault.
in append_array_variant(iter=iter@entry=0x7fffffffd780,
val=val@entry=0x62485a <ad+90>, n_elements=n_elements@entry=3, type=121) at client/advertising.c:178
in dict_append_basic_array(type=121, n_elements=3,
val=0x62485a <ad+90>, key=0x624858 <ad+88>, key_type=113, dict=0x7fffffffd730) at client/advertising.c:205
get_manufacturer_data(property=<optimized out>, iter=0x7fffffffd840,
user_data=<optimized out>) at client/advertising.c:253

After Fix:
[bluetooth]# set-advertise-name Test
[bluetooth]# set-advertise-uuids 0x1824
[bluetooth]# set-advertise-manufacturer 0x75 0x02 0x03 0x04
[bluetooth]# advertise on
[CHG] Controller 00:19:0E:11:55:44 SupportedInstances: 0x04
[CHG] Controller 00:19:0E:11:55:44 ActiveInstances: 0x01
Advertising object registered
[bluetooth]#
2017-10-26 16:55:33 +03:00
ERAMOTO Masaya
aa33052536 client: Use new parse_argument() instead of parse_argument_XX() 2017-09-25 15:44:02 +03:00
ERAMOTO Masaya
ad65aeffbb client: Use existing function for parsing argument 2017-09-25 15:44:02 +03:00
ERAMOTO Masaya
fb0ccc9683 client: Prevent to pass invalid ad type to D-Bus 2017-09-25 15:44:02 +03:00
ERAMOTO Masaya
15225b1e0b client: Fix core dump when using set-advertise-name
If repeating to set on/off with set-advertise-name after setting local
name, and then may dump core by double free. This patch uses g_free()
instead of free().
2017-09-25 15:44:02 +03:00
ERAMOTO Masaya
115fd96871 client: Fix memory leak of advertise command
Since advertise command does not free the variable ad.type when repeating
to enable and disable advertising, the following memory leak occurs.

  11 bytes in 1 blocks are definitely lost in loss record 20 of 190
     at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
     by 0x4E89718: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
     by 0x4EA24EE: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
     by 0x40EBC8: ad_register (advertising.c:343)
     by 0x40A666: cmd_advertise (main.c:2344)
     by 0x40ABA3: rl_handler (main.c:2664)
     by 0x53C16F4: rl_callback_read_char (in /lib/x86_64-linux-gnu/libreadline.so.6.3)
     by 0x405AFC: input_handler (main.c:110)
     by 0x4E84049: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
     by 0x4E843EF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
     by 0x4E84711: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
     by 0x4055FE: main (main.c:2865)
2017-09-25 15:44:02 +03:00
Luiz Augusto von Dentz
7beae0fd70 client: Remove const char * const
This type of construct usually makes no difference in practice as it is
very rare that a static table would be changed.
2017-09-25 15:44:02 +03:00
Luiz Augusto von Dentz
8090f7a6c8 gatt: Update signature of AcquireWrite and AcquireNotify
It should now contain an argument for the options even though there
are not options defined for clients.
2017-09-22 13:50:17 +03:00
Luiz Augusto von Dentz
0f3e810258 client: Implement AcquireNotify for server
This enables IO via file descriptors using AcquireNotify if server
implements it.
2017-09-22 13:50:17 +03:00
Luiz Augusto von Dentz
29a8563ce1 client: Implement AcquireWrite for server
This enables IO via file descriptors using AcquireWrite if server
implements it.
2017-09-22 13:50:17 +03:00
Luiz Augusto von Dentz
99e8efca3f client: Rework variables for AcquireWrite/AcquireNotify
This creates a struct with necessary fields which is easier to reset.
2017-09-22 13:50:17 +03:00
Luiz Augusto von Dentz
9132109737 tools: Only add unique entries to readline history
Don't add duplicate commands to history this is similar to what
HISTCONTROL=ignoredups does.
2017-09-20 15:28:44 +03:00
ERAMOTO Masaya
686dc41f0f client: Fix indent 2017-09-20 12:14:40 +03:00
ERAMOTO Masaya
067c2e793e client: Fix completion for list/pair command
The unexpected generator is used if the input string forward matches
with the unexpected command string which a generator for completion
is registered on. Thus,
  - since 496b6abf74, list command
    generates the unneeded argument, which is device id like that
    list-attributes command generates.
  - since b0fe6045b7, pair command
    generates the invalid argument, which is on/off like that
    pairable command generates.
This patch use the exact matching command.
2017-09-20 12:14:40 +03:00
ERAMOTO Masaya
a5ceed91fb client: Fix default_ctrl change when new adapter is found
Since 4e111f3448, when another adapter is
found, the default adapter would be changed, which is not expected.
Default adapter can only be changed by select command.
2017-09-14 11:22:28 +03:00
Luiz Augusto von Dentz
7c2e76aa80 client: Use DuplicateData filter
Also use the term duplicate instead of reset to make it more clear
the intent of the filter.
2017-08-30 14:59:55 +03:00
Yunhan Wang
48f1e3c5b7 client: Add Confirm implementation
Add Confirm implementation when indication is received.
2017-08-29 16:05:09 +03:00
ERAMOTO Masaya
b0fe6045b7 client: Add autocompletion for on/off
For some commands bluetoothctl gives the hint of argument, which is "on"
and "off", it is convenient even if the argument of command was overlooked
in help message.
2017-08-28 13:56:55 +03:00
ERAMOTO Masaya
a8a57c02d6 client: Use the common argument generator 2017-08-28 13:56:55 +03:00
Luiz Augusto von Dentz
ebfcb76cbe client: Reset prompt before printing user input
This fixes printing input such as:

m[agent] Confirm passkey 754788 (yes/no):
2017-08-23 15:22:28 +03:00
Luiz Augusto von Dentz
c144863767 client: Use rl_prompt_input to prompt agent input
This uses rl_prompt_input to ask user input instead of maintaining its
own handling in agent.c lets display.c handle all user prompt requests.
2017-08-23 15:22:17 +03:00
Yunhan Wang
4e111f3448 client: Fix the selection bug of ad manager
If there are multiple adapters, bluetoothctl may choose the wrong
advertising manager. In addition, select command cannot update
current advertising manager when choosing another adapter. Therefore, we
need to put advertising manager under adapter structure to resolve this
issue.
2017-08-22 16:37:18 +03:00
Luiz Augusto von Dentz
a41a625b1d client: Emit PropertiesChanged if advertising changes
This allows bluetoothd to detect changes done by the user without
having to rely on advertise command to unregister and register again:

bluetooth]# set-advertise-name blah
[bluetooth]# advertise on

@ MGMT Command: Add Advertising (0x003e) plen 17
        Instance: 1
        Flags: 0x00000003
          Switch into Connectable mode
          Advertise as Discoverable
        Duration: 0
        Timeout: 0
        Advertising data length: 0
        Scan response length: 6
        Name (complete): blah

[bluetooth]# set-advertise-name bleh

@ MGMT Command: Add Advertising (0x003e) plen 17
        Instance: 1
        Flags: 0x00000003
          Switch into Connectable mode
          Advertise as Discoverable
        Duration: 0
        Timeout: 0
        Advertising data length: 0
        Scan response length: 6
        Name (complete): bleh
2017-08-16 13:59:00 +03:00
Luiz Augusto von Dentz
5c3a39e642 client: Enable set-advertise-appearance to set Appearance
This enables set-advertise-appearance to use Appearance property:

[bluetooth]# set-advertise-appearance 128
[bluetooth]# advertise on

@ MGMT Command: Add Advertising (0x003e) plen 15
        Instance: 1
        Flags: 0x00000003
          Switch into Connectable mode
          Advertise as Discoverable
        Duration: 0
        Timeout: 0
        Advertising data length: 4
        Appearance: Computer (0x0080)
        Scan response length: 0
2017-08-10 16:32:09 +03:00
Luiz Augusto von Dentz
177eccc145 client: Enable set-advertise-name to set LocalName
This enables set-advertise-name to use LocalName property:

[bluetooth]# set-advertise-name blah
[bluetooth]# advertise on

@ MGMT Command: Add Advertising (0x003e) plen 17
        Instance: 1
        Flags: 0x00000003
          Switch into Connectable mode
          Advertise as Discoverable
        Duration: 0
        Timeout: 0
        Advertising data length: 0
        Scan response length: 6
        Name (complete): blah
2017-08-10 16:32:07 +03:00
Luiz Augusto von Dentz
172e68c59f client: Add set-advertise-name and set-advertise-appearance
set-advertise-appearance enables the use of adapter's appearance in the
scan response:

[bluetooth]# set-advertise-appearance on
[bluetooth]# advertise on

    @ MGMT Command: Add Advertising (0x003e) plen 11
            Instance: 1
            Flags: 0x00000023
              Switch into Connectable mode
              Advertise as Discoverable
              Add Appearance field to Scan Response
            Duration: 0
            Timeout: 0
            Advertising data length: 0
            Scan response length: 0

set-advertise-name enables the use of adapter's name/alias in the
scan response:

[bluetooth]# set-advertise-name on
[bluetooth]# advertise on

    @ MGMT Command: Add Advertising (0x003e) plen 11
            Instance: 1
            Flags: 0x00000043
              Switch into Connectable mode
              Advertise as Discoverable
              Add Local Name in Scan Response
            Duration: 0
            Timeout: 0
            Advertising data length: 0
            Scan response length: 0
2017-08-10 16:31:42 +03:00
Luiz Augusto von Dentz
5a765af1c9 client: Use rl_hexdump to print fixed sized iterators
This makes the output less clutter with duplicated infomation:

before:

[CHG] Device 00:1B:DC:07:31:88 ServiceData Key: 00001827-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0xdd
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0xdd
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00

after:

[CHG] Device 00:1B:DC:07:31:88 ServiceData Key: 00001827-0000-1000-8000-00805f9b34fb
  dd dd 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00 00                                            ..
2017-07-31 13:03:02 +03:00
Luiz Augusto von Dentz
96fc3c1e14 client: Fix output for DBUS_TYPE_UINT32 iter
The correct for should be 0x%08x not 0x%06x.
2017-07-28 15:07:24 +03:00
Luiz Augusto von Dentz
9bd39196bd client: Add set-scan-filter-reset-data command
This adds set-scan-filter-reset-data that makes use of ResetData
filter:

[bluetooth]# set-scan-filter-reset-data on
SetDiscoveryFilter success
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:8A:60:D8:17:D7 Discovering: yes
[CHG] Device F0:79:59:2F:D6:5A RSSI: -87
[NEW] Device 39:5B:8F:12:84:2E 39-5B-8F-12-84-2E
[CHG] Device 14:99:E2:0E:AC:6B RSSI: -80
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Key: 0x004c
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x09
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x06
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x03
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x19
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 39:5B:8F:12:84:2E RSSI: -30
[CHG] Device F0:79:59:2F:D6:5A RSSI: -87
[CHG] Device 00:1B:DC:07:31:88 RSSI: -31
[CHG] Device 00:1B:DC:07:31:88 ServiceData Key: 00001827-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0xdd
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0xdd
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B RSSI: -75
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Key: 0x004c
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x09
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x06
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x03
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x19
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device 14:99:E2:0E:AC:6B ManufacturerData Value: 0x00
[CHG] Device F0:79:59:2F:D6:5A RSSI: -86
[CHG] Device F0:79:59:2F:D6:5A RSSI: -86
[CHG] Device F0:79:59:2F:D6:5A RSSI: -86
[CHG] Device 00:1B:DC:07:31:88 RSSI: -27
[CHG] Device 00:1B:DC:07:31:88 ServiceData Key: 00001827-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0xdd
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0xdd
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
[CHG] Device 00:1B:DC:07:31:88 ServiceData Value: 0x00
2017-07-28 09:41:31 +03:00
Luiz Augusto von Dentz
5e44548ec1 client: Print properties changes of LEAdvertisingManager1
This prints properties changes of org.bluez.LEAdvertisingManager1
interface:

[bluetooth]# advertise on
[CHG] Controller B8:8A:60:D8:17:D7 AdvertisementInstances: 0x04
Advertising object registered
[bluetooth]# advertise off
[CHG] Controller B8:8A:60:D8:17:D7 AdvertisementInstances: 0x05
2017-07-24 17:39:30 +03:00
Luiz Augusto von Dentz
1c358b9274 client: Fix error when AcquireNotify fails
It should print "Failed to AcquireNotify".
2017-07-12 11:09:18 +03:00
Marcel Holtmann
9c249a035d client: Add missing fall through declaration 2017-07-11 11:26:42 -07:00
ERAMOTO Masaya
e0eeef1030 client: Fix memory leak due to the option to register an agent
When bluetoothctl runs with the command line option "-a <capability>", it
does not free the variable auto_register_agent registering the initial
agent and allocates new memory for it.

This frees the allocated memory before allocating new memory.
(The related commit id is 6db3470c2ea161b4b808ad1fc80dfd7e014fd359.)
2017-07-07 10:01:42 +03:00
Luiz Augusto von Dentz
c89618370d client: Add release-notify command
This adds release-notify command which closes an existing fd unlocking
the attribute:

[Test peripheral:/service001f/char0020]# release-notify
[CHG] Attribute /org/bluez/hci1/dev_69_16_5B_9A_06_CD/service001f/char0020 NotifyAcquired: no
2017-07-05 14:27:40 +03:00
Luiz Augusto von Dentz
706f9cb68f client: Add acquire-notify command
This adds acquire-notify command which uses D-Bus AcquireNotify method
to acquire a file descriptor to read notifications locking the attribute:

[Test peripheral:/service001f/char0020]# acquire-notify
[CHG] Attribute /org/bluez/hci1/dev_56_A0_AA_D0_12_FF/service001f/char0020 NotifyAcquired: yes
AcquireNotify success: fd 7 MTU 65

< ACL Data TX: Handle 3585 flags 0x00 dlen 9
      ATT: Write Request (0x12) len 4
        Handle: 0x0022
          Data: 0200

[CHG] /org/bluez/hci1/dev_56_A0_AA_D0_12_FF/service001f/char0020 Notification:
  00

> ACL Data RX: Handle 3585 flags 0x02 dlen 8
      ATT: Handle Value Indication (0x1d) len 3
        Handle: 0x0021
          Data: 00
2017-07-05 14:27:38 +03:00
Luiz Augusto von Dentz
25360fe34f client: Add release-write command
This adds release-write command which closes an existing fd unlocking
the attribute:

[Test peripheral:/service001f/char0020]# release-write
[CHG] Attribute /org/bluez/hci1/dev_00_1B_DC_07_31_88/service001f/char0020 WriteAcquired: no
2017-07-05 14:26:01 +03:00
Luiz Augusto von Dentz
b41cf317ac client: Add acquire-write command
This adds acquire-write command which uses D-Bus AcquireWrite methods
to acquire a file descriptor to write to locking the attribute:

[Test peripheral:/service001f/char0020]# acquire-write
[CHG] Attribute /org/bluez/hci1/dev_00_1B_DC_07_31_88/service001f/char0020 WriteAcquired: yes
AcquireWrite success: fd 7 MTU 65
[Test peripheral:/service001f/char0020]# write 00
Attempting to write fd 7

< ACL Data TX: Handle 3585 flags 0x00 dlen 8
      ATT: Write Command (0x52) len 3
        Handle: 0x0021
          Data: 00
2017-07-05 14:26:01 +03:00
Luiz Augusto von Dentz
44bf4d2dba client: Add unregister-descriptor command
This adds unregister-descriptor which can be used to unregister
descriptors registered with register-descriptor:

unregister-descriptor /org/bluez/app/service0xf48150/chrc0xf49a40/desc0xf4d350
[DEL] Descriptor
	/org/bluez/app/service0xf48150/chrc0xf49a40/desc0xf4d350
	8260c653-1a54-426b-9e36-e84c238bc669
	Vendor specific
2017-06-30 12:33:24 +03:00
Luiz Augusto von Dentz
7e41dd2d75 client: Add register-descriptor command
This adds register-descriptor which can be used to register
descriptors to a characteristic registered with register-characteristic:

register-descriptor 8260c653-1a54-426b-9e36-e84c238bc669 read,write
[NEW] Descriptor
	/org/bluez/app/service0x902610/chrc0x91d690/desc0x9095a0
	8260c653-1a54-426b-9e36-e84c238bc669
	Vendor specific
[/org/bluez/app/service0x902610/chrc0x91d690/desc0x9095a0] Enter value: 00
2017-06-30 12:33:23 +03:00
Luiz Augusto von Dentz
5dbe747450 client: Add unregister-characteristic command
This adds unregister-characteristic which can be used to unregister
characteristics registered with register-characteristic:

unregister-characteristic /org/bluez/app/service0xc80150/chrc0xc99960
[DEL] Characteristic
	/org/bluez/app/service0xc80150/chrc0xc99960
	00002a06-0000-1000-8000-00805f9b34fb
	Alert Level
2017-06-30 12:33:22 +03:00
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
21ec1b5105 client: Add generic way to request input from user
This adds rl_prompt_input which can be used by different parts to ask
user input.
2017-06-30 12:12:43 +03:00
Luiz Augusto von Dentz
8dc3d02184 client: Allow register-application without any UUID
This means that GattProfile1 should not be registered but there could still
be services that needs registered with bluetoothd.
2017-06-26 12:42:18 +03:00
ERAMOTO Masaya
de4786090f client: Output a long message by two lines
This outputs the help message by two lines as follows if the string of
a command and a argument is long.

  set-alias <alias>          Set device alias
  select-attribute <attribute/UUID>
                             Select attribute
  attribute-info [attribute/UUID]
                             Select attribute
  read                       Read attribute value
2017-06-19 14:47:04 +03:00
ERAMOTO Masaya
090e626a74 client: Add a description to all commands 2017-06-19 14:47:04 +03:00
ERAMOTO Masaya
18ef642531 client: Compare a input string and each command only once
This compares a input string and each command only once in rl_handler().
2017-06-19 14:47:04 +03:00