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.
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>
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
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
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.
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.
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>
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.
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>
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.
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)
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
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 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'