This adds proper decoding for UUID properties with usage of
bt_uuidstr_to_str so it can print the 'friendly' name as bellow:
bluetoothctl# transport.show /org/bluez/hci0/dev_94_DB_56_F7_F2_88/sep4/fd0
Transport /org/bluez/hci0/dev_94_DB_56_F7_F2_88/sep4/fd0
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
...
This makes command discoverable to print a warning if
discoverable-timeout is not set(0):
[bluetooth]# discoverable-timeout 0
[bluetooth]# Changing discoverable-timeout 0 succeeded
[bluetooth]# [CHG] Controller 4C:49:6C:44:F5:E7 DiscoverableTimeout: 0x00000000 (0)
[bluetooth]# discoverable on
Warning: setting discoverable while discoverable-timeout not set(0) is not recommended
This adds the initial implementation for the assistant menu in
bluetoothctl, to detect and print MediaAssistant objects.
The current BAP Broadcast Assistant implementation can be tested
by running bluetoothctl, connecting to a BASS Server, scanning
a Broadcast Source that is streaming a number of BISes with
audio capabilities matching the capabilities of the peer device,
and noticing the MediaAssistant objects being created:
client/bluetoothctl
[bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes
[bluetooth]# AdvertisementMonitor path registered
[bluetooth]# scan on
[bluetooth]# [NEW] Device 00:60:37:94:A6:A3 00-60-37-94-A6-A3
[bluetooth]# connect 00:60:37:94:A6:A3
Attempting to connect to 00:60:37:94:A6:A3
[CHG] Device 00:60:37:94:A6:A3 Connected: yes
[00-60-37-94-A6-A3]# Connection successful
[00-60-37-94-A6-A3]# [NEW] Device 15:65:78:B6:52:F6 15-65-78-B6-52-F6
[00-60-37-94-A6-A3]# [NEW] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis1
[00-60-37-94-A6-A3]# [NEW] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis2
[00-60-37-94-A6-A3]# scan off
[00-60-37-94-A6-A3]# Diovery stopped
[00-60-37-94-A6-A3]# disconnect
Attempting to disconnect from 00:60:37:94:A6:A3
[00-60-37-94-A6-A3]# Successful disconnected
[CHG] Device 00:60:37:94:A6:A3 Connected: no
[bluetooth]# [DEL] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis1
[bluetooth]# [DEL] Assistant
/org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis2
Error: ALLOC_FREE_MISMATCH (CWE-762): [#def37]
client/main.c:2108:2: alloc: Allocation of memory which must be freed using "g_free".
client/main.c:2108:2: assign: Assigning: "desc" = "g_strdup_printf("\x1b[0;94m[%s]\x1b[0m# ", attr)".
client/main.c:2111:2: free: Calling "free" frees "desc" using "free" but it should have been freed using "g_free".
2109|
2110| bt_shell_set_prompt(desc);
2111|-> free(desc);
2112| }
2113|
Error: CPPCHECK_WARNING (CWE-788): [#def36]
client/main.c:833: error[ctuArrayIndex]: Array index out of bounds; 'argv' buffer size is 0 and it is accessed at offset 1.
831| const char **opt;
832|
833|-> if (!strcmp(argv[1], "help")) {
834| for (opt = arg_table; opt && *opt; opt++)
835| bt_shell_printf("%s\n", *opt);
unregister-includes command takes two parameters service uuid and
included service uuid, since the space between them is missing,
the menu option is not working.
When two uuids separated with space is given, it is throwing error.
The "scan bredr" and "scan le" commands are broken right now because the
transport filter gets set, but not actually invalidated.
Invalidate the filter with `filter.set = false` so that it actually gets
updated when set_discovery_filter() is called afterwards.
This adds "auto" capability which behaves like "on" but instead of
asking user to confirm/autorize it automatically accepts, which is
not secure to be used thus a warning is printed when user selects it.
Usage:
[bluetoothctl]# agent auto
Warning: setting auto response is not secure, it bypass user
confirmation/authorization, it shall only be used for test automation.
or
client/bluetoothctl -a auto
This adds support for advertise.rsi command which can be used to request
the generation of RSI and include it as part of advertising data:
[bluetooth]# advertise.rsi --help
Show/Enable/Disable RSI to be advertised
Usage:
rsi [on/off]
[bluetooth]# advertise.rsi
RSI: on
[bluetooth]# advertise on
...
Advertising object registered
Tx Power: off
Name: off
Appearance: off
Discoverable: on
RSI: on
[bluetooth]#
This allows gatt.select-attribute local to select from the registered
attributes:
[bluetooth]# gatt.select-attribute local /org/bluez/app/service0/chrc0
[/org/bluez/app/service0/chrc0]# gatt.write 0x01
[CHG] Attribute /org/bluez/app/service0/chrc0 (%UUID) written
[/org/bluez/app/service0/chrc0]# gatt.read
01 .
[/org/bluez/app/service0/chrc0]# gatt.select-attribute local
/org/bluez/app/service0/chrc1
[/org/bluez/app/service0/chrc1]# gatt.write 0x01
[CHG] Attribute /org/bluez/app/service0/chrc1 (%UUID) written
[/org/bluez/app/service0/chrc1]# gatt.read
01 .
[/org/bluez/app/service0/chrc1]#
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>
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>
Thid adds support to show command to print ExperimentalFeatures property:
[bluetooth]# show
Controller ...
Experimental: BlueZ Experimental LL p.. (15c0a148-c273-11ea-b3de-0242ac130004)
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>
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>
This patch adds the new "SupportedCapabilities" property to the
bluetoothctl "show" view.
The change is tested by verifying bluetoothctl shows the desired
properties.
This patch implements some basic functions for ADV monitor in
bluetoothctl
[bluetooth]# show
...
Advertisement Monitor Features:
SupportedMonitorTypes: or_patterns
This adds support for reading the Roles property through bluetootctl's
show option.
[bluetooth]# show
...
Roles: central
Roles: peripheral
Roles: central-peripheral
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)
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
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.
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
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
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