gatt_db_attribute_notify was only accepting passing the Characteristic
Declaration instead of accepting its value as well,
gatt_db_service_foreach_desc also have similar limitation so both have
been updated to allow working with both value and declaration.
Instead of parsing the command line, which can contain a shell script,
run using /bin/sh so it allows more complex command line to be tested:
sudo tools/test-runner -l -d -k <pathto/bzImage> --
'client/bluetoothctl power on && sleep 2 && client/bluetoothctl power
off'
This adds an option (-l/--emulator) to start btvirt before processing
the command which is convenient to runs tools like bluetoothctl:
sudo tools/test-runner -l -d -k <pathto/bzImage> --
client/bluetoothctl power on
With use of UHID_CREATE2 the code needs to wait for UHID_START in order
to know if the reports are numbered or not.
Fixes: https://github.com/bluez/bluez/issues/298
Include sys/types.h to avoid the following build failure on musl raised
since commit fb57ad9b9d:
In file included from src/shared/queue.c:15:
./src/shared/util.h:106:1: error: unknown type name 'ssize_t';
did you mean 'size_t'?
106 | ssize_t util_getrandom(void *buf, size_t buflen, unsigned int flags);
| ^~~~~~~
| size_t
Fixes:
- http://autobuild.buildroot.org/results/83eaeb3863040645409f5787fdbdde79385c5257
In a connection without outgoing traffic, conn->tx_num will remain 0.
In this case, conn->tx_pkt_med should be simply 0 without calculating
"conn->tx_bytes / conn->tx_num".
This was likely to happen, for example, when "btmon -w btsnoop.log"
was launched in the middle of a LE mouse connection, and a number of
incoming ACL Data RX were received as the mouse movements. When
running "btmon -a btsnoop.log", it would encounter this error.
Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Yun-Hao Chung <howardchung@chromium.org>
Reviewed-by: Shuo-Peng Liao <deanliao@chromium.org>
This sometimes causes the Track to be schedule while some metadata are
still pending, also don't remove the Duration from track when updating
its metadata since Duration is typically updated by player status rather
than metadata.
Fixes: https://github.com/bluez/bluez/issues/291
This patch sets the pointer to null after free since the g_free(p)
doesn't set the pointer to NULL.
This is reported by the Coverity.
Fixes: 7e7d826aa1 ("gobex: Print error if data cannot be written")
This patch fixes the following runtime error:
$ sudo ./monitor/btmon -w test.btsnoop
Bluetooth monitor ver 5.63
src/shared/btsnoop.c:339:18: runtime error: left shift of 65535 by 16 places cannot be represented in type 'int'
This replace the use of g_key_file_get_integer, which is limited to
only decimal values, to g_key_file_get_string and then use strtol to
convert the string value to integer.
Fixes: https://github.com/bluez/bluez/issues/293
The bdaddr of an adapter is used for its unique storage path so having
multiple adapters with the same address would likely cause problems
with its storage as they would be shared.
Enable battery provider dbus interface BatteryProviderManager1 for
non-LE controllers, so external clients like pipewire can provide
battery information for bluetooth headsets on non-LE controllers.
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
This adds a third argument to connect command so a channel can be passed
to CreateSession which is useful since it possible to force a specific
RFCOMM channel.
When the GError variable is freeed with g_error_free(), it is not set to
NULL and reusing the same variable again can cause the seg_fault because
it is still pointing the old memory address which is freed.
This patch relaces the g_error_free() to g_clear_error() which frees the
variable and set it to NULL if the variable is used in the function
again.
Fixes: 4ad622d592 ("profiles/a2dp: Fix unchecked return value")
When the GError variable is freeed with g_error_free(), it is not set to
NULL and reusing the same variable again can cause the seg_fault because
it is still pointing the old memory address which is freed.
This patch relaces the g_error_free() to g_clear_error() which frees the
variable and set it to NULL if the variable is used in the function
again.
Fixes: 6a154cd080 ("device: Fix unchecked return value")
When the GError variable is freeed with g_error_free(), it is not set to
NULL and reusing the same variable again can cause the seg_fault because
it is still pointing the old memory address which is freed.
This patch relaces the g_error_free() to g_clear_error() which frees the
variable and set it to NULL if the variable is used in the function
again.
Fixes: 2287c517ca ("adapter: Fix unchecked return value")
Fixes: https://github.com/bluez/bluez/issues/276
Calling btd_adapter_remove_device from device_remove_connection can
cause a crash, so instead of removing it immediatelly this set a the
temporary timeout to 0.
Fixes: https://github.com/bluez/bluez/issues/290