| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
"secondary" isn't an array of pointers, so the iterator can never be
NULL.
|
|
|
|
| |
Add support for bt_vcp_set_debug and replace the exisiting DBG.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following warnings:
src/shared/gatt-db.c:1339:2: warning: Undefined or garbage value
returned to caller [core.uninitialized.UndefReturn]
return data.num_of_res;
^~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-db.c:725:5: warning: Access to field 'handle' results
in a dereference of a null pointer
service->attributes[0]->handle == handle)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following warnings:
src/gatt-database.c:3541:14: warning: Value stored to 'iface' during
its initialization is never read [deadcode.DeadStores]
const char *iface = g_dbus_proxy_get_interface(proxy);
^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gatt-database.c:3542:14: warning: Value stored to 'path' during
its initialization is never read [deadcode.DeadStores]
const char *path = g_dbus_proxy_get_path(proxy);
^~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
| |
CCC shall always have some permission set.
|
|
|
|
|
|
|
| |
CCC shall always have both Read and Write permissions set in addition to
what application set.
Fixes: https://github.com/bluez/bluez/issues/399
|
|
|
|
| |
This adds initial code for Volume Control Profile.
|
|
|
|
|
| |
This makes use of gatt_db_attribute_get_ccc to locate a CCC of a given
attribute.
|
|
|
|
|
| |
Users of tester.h shall also include io.h, including io.h by default may
cause errors if has been previously included.
|
|
|
|
|
| |
Users of bap.h shall also include io.h, including io.h by default may
cause errors if has been previously included.
|
|
|
|
|
| |
If the stream is already in idle state do not attempt to disable it
again.
|
|
|
|
|
| |
bt_bap_detach shall always unregister the disconnect callback otherwise
the session pointer may still be accessible.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This property should allow any program to show whether an adapter is in
the process of being turned on.
As turning on an adapter isn't instantaneous, it's important that the UI
reflects the transitional state of the adapter's power, and doesn't
assume the device is already turned on but not yet working, or still off
despite having requested for it to be turned on, in both cases making
the UI feel unresponsive.
This can also not be implemented in front-ends directly as, then,
the status of an adapter wouldn't be reflected correctly in the Settings
window if it's turned on in the system menu. Implementing it in the
front-ends would also preclude from having feedback about the state of
the adapter when bluetoothd is the one powering up the adapter after the
rfkill was unblocked.
See https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/issues/121
and the original https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5773
|
|
|
|
|
|
| |
Instead of only replying to D-Bus requests with an error saying the
adapter is blocked, keep track of the rfkill being enabled or disabled
so we know the rfkill state of the adapter at all times.
|
|
|
|
|
|
|
|
|
| |
This fixes the following error:
src/shared/shell.c:1135:19: warning: Null pointer passed to 1st
parameter expecting 'nonnull'
data.timeout = atoi(optarg);
^~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
| |
This was found by checkpatch in previous commit:
WARNING:SPACING: Unnecessary space before function pointer arguments
124: FILE: src/shared/bap.h:123:
+ int (*select) (struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
Do the same for (*config) and (*clear) for consistence.
|
|
|
|
|
|
|
| |
This adds the remote endpoint path to the dictionary sent in
SelectProperties.
It allows audio application to know for which remote endpoint the call is
done and so for which it should act as an initiator.
|
|
|
|
|
| |
This sets enmpty string ("") when argument don't set any optarg so the
application can tell when an option was set or not.
|
|
|
|
| |
This adds the definition for LC3 codec capabilities and configuration.
|
|
|
|
| |
This adds initial code for Basic Audio Profile.
|
|
|
|
|
| |
This adds btd_adapter_find_device_by_fd that lookup a device by a fd
socket destination address.
|
|
|
|
|
|
|
| |
Application can now encode an error code into the D-Bus reply error
message (0x80-0x9f).
Fixes: https://github.com/bluez/bluez/issues/380
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We set the pending settings flag when sending MGMT_SETTING_*
commands to the MGMT layer and clear them when receiving a
successful reply, but we don't clear them when receiving an error
reply. This might cause a setting to be stuck in pending state.
Therefore, also clear the pending flag when receiving error.
Furthermore, this patch also postpones setting the pending flag
until we queue the MGMT command in order to avoid setting it too
soon but we return early.
This was caught during power off test, where MGMT_OP_SET_POWERED
returns Authentication Failed because disconnection takes too long.
Future attempts to switch power will then be ignored.
< HCI Command: Disconnect (0x01|0x0006) plen 3 #17916 [hci0] 12.502908
Handle: 512
Reason: Remote Device Terminated due to Power Off (0x15)
> HCI Event: Command Status (0x0f) plen 4 #17917 [hci0] 12.503185
Disconnect (0x01|0x0006) ncmd 1
Status: Success (0x00)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0001} [hci0] 14.519491
Set Powered (0x0005)
Status: Authentication Failed (0x05)
= bluetoothd: Failed to set mode: Authentication Failed (0x05) 14.520042
= bluetoothd: adapter /org/bluez/hci0 set power to 0 14.813533
> HCI Event: Disconnect Complete (0x05) plen 4 #17918 [hci0] 16.509043
Status: Success (0x00)
Handle: 512
Reason: Connection Timeout (0x08)
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
|
|
|
|
|
|
| |
This fixes not setting initiator flag properly when MGMT connect event
has not been processed yet but ATT is already connected or is in
progress.
|
|
|
|
|
| |
According to the Bluetooth product specification list, the allocated
UUID for "Microphone Control" is 0x184D, not 0x184C.
|
|
|
|
| |
This makes sure the flags are supported before attempting to set it.
|
|
|
|
|
| |
This adds tester_setup_io which can be used to add a PDU list in the
form of iovec.
|
|
|
|
|
|
|
|
| |
device.trusted is a user preference which controls if the devices needs
to be authorized or not so the plugin shall not overwrite it and instead
just honor what user has set and skip authorizing if already trusted.
Fixes: https://github.com/bluez/bluez/issues/372
|
|
|
|
|
| |
This adds btd_ prefix to device_is_trusted so it can be used by
plugins.
|
|
|
|
|
|
|
| |
If the profile is registered and marked to auto-connect it shall
automatically be connected whenever a device is already connected.
Fixes: https://github.com/bluez/bluez/issues/370
|
|
|
|
|
| |
This adds support for setting ISO Socket experimental UUID which
enables the use of BTPROTO_ISO on the system.
|
|
|
|
|
| |
This adds BlueZ experimental ISO Socket UUID to uuid128_table so it is
decoded by the likes of btmon.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If privacy mode is not strictly set to network set it to device
otherwise network mode would prevent reconnections if the the identity
address is used:
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 6, Part B page 2837-2838
'The Host specifies the privacy mode to be used with each peer
identity on the resolving list. If it specifies that device privacy
mode is to be used, then the Controller shall accept both the peer's
device Identity Address and a resolvable private address generated by
the peer device using its distributed IRK. Otherwise, network privacy
mode is used: the Controller shall only accept resolvable private
addresses generated by the peer device using its distributed IRK.'
|
|
|
|
|
|
|
|
|
|
|
| |
The existing code assumes that, if a device supports advertising monitor
offload, DEVICE_FOUND events can be ignored since the kernel will send
ADV_MONITOR_DEVICE_FOUND events instead. Unfortunately, these new events
were added in 5.18, but offload was added in 5.12. This patch adds a
check on the MGMT API version so we can process the older DEVICE_FOUND
events when the new events are not supported.
Fixes: https://github.com/bluez/bluez/issues/357
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__time_t is not a portable data type, and can cause sign mismatch on
some compares.
Fixes:
CC src/bluetoothd-device.o
src/device.c: In function ‘device_is_name_resolve_allowed’:
src/device.c:4092:17: error: comparison of integer expressions of
different signedness: ‘__time_t’ {aka ‘long int’} and
‘long unsigned int’ [-Werror=sign-compare]
if (now.tv_sec >= device->name_resolve_failed_time +
^~
cc1: all warnings being treated as errors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bt_uuid_t is defined as a byte array, so it can cause alignment errors
on some architectures, when the two 64 bit halves are treated as u64s.
This patch ensures proper alignment across all architectures.
Fixes:
src/adapter.c: In function ‘bt_uuid_hash’:
src/adapter.c:3617:8: error: cast increases required alignment of
target type [-Werror=cast-align]
val = (uint64_t *)&uuid_128.value.u128;
^
cc1: all warnings being treated as errors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[bluetooth]# connect 40:EF:4C:0C:11:F0
Attempting to connect to 40:EF:4C:0C:11:F0
[CHG] Device 40:EF:4C:0C:11:F0 Connected: yes
Connection successful
[CHG] Device 40:EF:4C:0C:11:F0 ServicesResolved: yes
[UFO]# remove 40:EF:4C:0C:11:F0
[CHG] Device 40:EF:4C:0C:11:F0 ServicesResolved: no
Device has been removed
[CHG] Device 40:EF:4C:0C:11:F0 Connected: no
[bluetooth]# info 40:EF:4C:0C:11:F0
Device 40:EF:4C:0C:11:F0 (public)
Name: UFO
Alias: UFO
Class: 0x00240418
Icon: audio-headphones
Paired: yes
Trusted: no
Blocked: no
Connected: no
LegacyPairing: no
UUID: Headset
UUID: Audio Sink
UUID: A/V Remote Control Target
UUID: A/V Remote Control
UUID: Handsfree
UUID: Phonebook Access Server
|
|
|
|
| |
This documents -K/--kernel experimental features options.
|
|
|
|
|
| |
This splits kernel experimental UUIDs from D-Bus Experimental interface
so they can be controlled indenpendetly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2450
• If extended advertising PDU types are being used (bit 4 = 0) then:
The advertisement shall not be both connectable and scannable.
So instead this attempts to set name as part of Advertising Data rather
then setting it as Scan Response:
bluetoothctl> advertise.secondary 2M
bluetoothctl> advertise.name Intel-3
bluetoothctl> advertise on
< HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25
Handle: 0x01
Properties: 0x0001
Connectable
Min advertising interval: 1280.000 msec (0x0800)
Max advertising interval: 1280.000 msec (0x0800)
Channel map: 37, 38, 39 (0x07)
Own address type: Public (0x00)
Peer address type: Public (0x00)
Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
TX power: Host has no preference (0x7f)
Primary PHY: LE 1M (0x01)
Secondary max skip: 0x00
Secondary PHY: LE 2M (0x02)
SID: 0x00
Scan request notifications: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 5
LE Set Extended Advertising Parameters (0x08|0x0036) ncmd 1
Status: Success (0x00)
TX power (selected): 7 dbm (0x07)
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 4
Handle: 0x01
Operation: Complete extended advertising data (0x03)
Fragment preference: Minimize fragmentation (0x01)
Data length: 0x00
@ MGMT Event: Command Complete (0x0001) plen 7
Add Extended Advertising Parameters (0x0054) plen 4
Status: Success (0x00)
Instance: 1
TX power: 7 dbm (0x07)
Available adv data len: 31
Available scan rsp data len: 31
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Data (0x08|0x0037) ncmd 1
Status: Success (0x00)
@ MGMT Command: Add Extended Advertising Data (0x0055) plen 23
Instance: 1
Advertising data length: 12
Name (complete): Intel-3
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported
Scan response length: 0
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 16
Handle: 0x01
Operation: Complete extended advertising data (0x03)
Fragment preference: Minimize fragmentation (0x01)
Data length: 0x0c
Name (complete): Intel-3
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Data (0x08|0x0037) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Extended Scan Response Data (0x08|0x0038) plen 4
Handle: 0x01
Operation: Complete scan response data (0x03)
Fragment preference: Minimize fragmentation (0x01)
Data length: 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Scan Response Data (0x08|0x0038) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
Extended advertising: Enabled (0x01)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x01
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
Status: Success (0x00)
@ MGMT Event: Command Complete (0x0001) plen 4
Add Extended Advertising Data (0x0055) plen 1
Status: Success (0x00)
Instance: 1
|
|
|
|
|
| |
This adds connectable flag to state so it can be used to detect which is
the last seen connectable bearer.
|
|
|
|
|
| |
This patch fixes the issue not deleting the device folder when the
device is removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If there is a pending notify multiple the code was not removing before
freeing the object causing the following crash:
Invalid read of size 8
at 0x4A3D10: notify_multiple (gatt-server.c:1703)
by 0x4D05F0: timeout_callback (timeout-glib.c:25)
by 0x4956900: ??? (in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x49560AE: g_main_context_dispatch
(in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x49AB307: ??? (in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x49557C2: g_main_loop_run
(in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x4D0A34: mainloop_run (mainloop-glib.c:66)
by 0x4D0F2B: mainloop_run_with_signal (mainloop-notify.c:188)
by 0x2B0CD1: main (main.c:1276)
Address 0x6ca35c8 is 136 bytes inside a block of size 144 free'd
at 0x48470E4: free (vg_replace_malloc.c:872)
by 0x415E73: gatt_server_cleanup (device.c:698)
by 0x415E73: attio_cleanup (device.c:715)
by 0x47745B: queue_foreach (queue.c:207)
by 0x490C54: disconnect_cb (att.c:701)
by 0x4CF4AF: watch_callback (io-glib.c:157)
by 0x49560AE: g_main_context_dispatch
(in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x49AB307: ??? (in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x49557C2: g_main_loop_run
(in /usr/lib64/libglib-2.0.so.0.7000.5)
by 0x4D0A34: mainloop_run (mainloop-glib.c:66)
by 0x4D0F2B: mainloop_run_with_signal (mainloop-notify.c:188)
by 0x2B0CD1: main (main.c:1276)
|
|
|
|
|
| |
This enables storing the local (adapter) GATT database which later will
be used by btmon to decode GATT handles.
|
|
|
|
|
| |
This adds helper functions to store and load from/to file so they can
get reused by the likes of gatt-database.c and btmon.
|
|
|
|
|
|
|
|
| |
If device uses RPA it shall only enable wakeup if RPA Resolution has
been enabled otherwise it cannot be programmed in the acceptlist which
can cause suspend to fail.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215768
|
|
|
|
|
| |
This makes gatt_db_attribute_get_char_data work with Characteristic
Value rather than only with Characteristic Declaration.
|
|
|
|
|
|
| |
This adds initiator argument to service_accept so profiles accepting
the connection can use btd_service_is_initiator to determine if the
connection was initiated locally (central) or remotely (peripheral).
|
|
|
|
|
|
|
|
|
|
|
|
| |
After connect the Bluetooth mouse, open two Bluetoothctl at the same time,
when remove the mouse, quickly go to power off,
try to paired the mouse again when I was power on,
found that the error 0x13 was always reported.
try to connect directly,can connect successfully.
but use the info command to query the information of the mouse
and find that the pairing status of the mouse is No.
so I try to delete the paired information in the kernel
through the "* cancel_pairing()" interface.
|