| 04edc077 |
mgmt-tester: Fix ext advertisement handle
Handle has been change to 0x01 not 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 |
Luiz Augusto von Dentz |
5 years ago |
1 file, +21, -21 |
| b6304ef1 |
mgmt-tester: Update set_connectable_off_adv_param
Parameters have been changed in the kernel which now uses the following:
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15
Min advertising interval: 62.500 msec (0x0064)
Max advertising interval: 93.750 msec (0x0096)
Type: Scannable undirected - ADV_SCAN_IND (0x02)
Own address type: Random (0x01)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00) |
Luiz Augusto von Dentz |
5 years ago |
1 file, +21, -21 |
| e4de043e |
mgmt-tester: Print out the HCI received and expected cmd value
This make it simpler to debug when the kernel has been updated and
parameters no longer match: |
Luiz Augusto von Dentz |
5 years ago |
1 file, +3, -1 |
| 64a26d92 |
test-runner: Fix using removed options
This removes -nodefconfig and -balloon which are not longer valid
options:
qemu-system-x86_64: -nodefconfig: invalid option
qemu-system-x86_64: -balloon: invalid option |
Luiz Augusto von Dentz |
5 years ago |
1 file, +0, -2 |
| 16ebd945 |
doc: Add tester.config
This adds tester.config which can be used as a reference to create
kernel images to be run with test-runner. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +48, -0 |
| ba266f7e |
adapter: Fix a crash caused by lingering discovery client pointer
This cleans up the lingering pointer, adapter->client, during powering
off the adapter. The crash occurs when a D-Bus client set Powered
property to false and immediately calls StopDiscovery() when there is
ongoing discovery. As a part of powering off the adapter,
adapter->discovery_list gets cleared, and given that adapter->client
refers to one of the clients in adapter->discovery_list, adapter->client
should be cleared along with it.
(1) Connect to a BT audio device from BT system tray.
(2) Once the audio device is connected, power off BT and immediately
power off the audio device. |
Miao-chen Chou |
5 years ago |
1 file, +8, -1 |
| 25bc7dc9 |
tools/smp-tester: Enable hciemu debug
This enable hciemu debug when debug is enabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +5, -2 |
| d458d4bb |
tools/sco-tester: Enable hciemu debug
This enable hciemu debug when debug is enabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +5, -2 |
| ebe702a3 |
tools/rfcomm-tester: Enable hciemu debug
This enable hciemu debug when debug is enabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +5, -2 |
| ac9f2ad9 |
tools/bnep-tester: Enable hciemu debug
This enable hciemu debug when debug is enabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +5, -2 |
| 4ddc7118 |
tools/mgmt-tester: Enable hciemu debug
This enable hciemu debug when debug is enabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +6, -3 |
| f6f0b36b |
tools/l2cap-tester: Enable hciemu debug
This enable hciemu debug when debug is enabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +5, -2 |
| 31eb3d67 |
emulator/bthost: Add support for LE CIS Request
This enables bthost to act as acceptor of LE CIS Request. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +18, -0 |
| 2caa51ee |
emulator: Fix not gerating proper advertisement
When a btdev instance advertise using the legacy command and the other
instance uses the extended version to scan the report type are not
actually setting the legacy PDU properly. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +25, -0 |
| 2bef85af |
emulator/hciemu: Add debug support
This adds bthost_set_debug which can be used to debug internals of
hciemu. |
Luiz Augusto von Dentz |
5 years ago |
2 files, +53, -0 |
| 3b572018 |
emulator/bthost: Add debug support
This adds bthost_set_debug which can be used to debug internals of
bthost. |
Luiz Augusto von Dentz |
5 years ago |
2 files, +68, -10 |
| 61d7e90a |
emulator/btdev: Add debug support
This adds btdev_set_debug which can be used to debug internals of
btdev. |
Luiz Augusto von Dentz |
5 years ago |
2 files, +57, -47 |
| e313defd |
adv_monitor: Issue Remove Adv Monitor mgmt call
This calls Remove Adv Monitor command to kernel and handles the callback
during a monitor removal initiated by a D-Bus client. This also
registers callback for getting notified on Adv Monitor Removed event, so
that the Adv monitor manager can invalidate the monitor by calling
Release() on its proxy.
The following tests were performed.
- In bluetoothctl console, add a monitor and remove the monitor by its
index and verify the removal in both the output of btmgmt and syslog.
- In bluetoothctl console, add a monitor, remove the monitor via
btmgmt and verify the removal in syslog. |
Alain Michaud |
5 years ago |
1 file, +124, -8 |
| e432fc73 |
adv_monitor: Fix return type of RegisterMonitor() method
This modifies the D-Bus call return type to be asynchronous for
RegisterMonitor() method call.
The following test was performed:
- Enter bluetoothctl, exit the console and re-enter the console without
AlreadyExist error for RegisterMonitor() upon bring-up of the console. |
Miao-chen Chou |
5 years ago |
1 file, +3, -3 |
| cb3f3f51 |
adv_monitor: Implement Add Adv Patterns Monitor cmd handler
- Send the MGMT_OP command to kernel upon registration of a Adv patterns
monitor.
- Call Activate() or Release() to client depending on the reply from
kernel |
Howard Chung |
5 years ago |
1 file, +67, -2 |
| 84ba9780 |
adapter: Clear all Adv monitors upon bring-up
This clears all Adv monitors upon daemon bring-up by issuing
MGMT_OP_REMOVE_ADV_MONITOR command with monitor_handle 0.
The following test was performed:
- Add an Adv Monitor using btmgmt, restart bluetoothd and observe the
monitor got removed. |
Miao-chen Chou |
5 years ago |
1 file, +39, -0 |
| 058ef5a6 |
adv_monitor: Implement RSSI filtering and content matching
This implements the following logic for background scanning.
- Implement RSSI tracking based on high/low RSSI thresholds and timers.
- Create an entry point in adapter to start the matching of Adv based
on all monitors and invoke the RSSI tracking for Adv reporting. |
Manish Mandlik |
5 years ago |
4 files, +467, -44 |
| dc136054 |
shared/ad: Add support of bt_ad_pattern
This adds struct bt_ad_pattern and helpers functions to facilitate
pattern matching. |
Miao-chen Chou |
5 years ago |
2 files, +166, -1 |
| 18144f88 |
adapter: Split loading of BREDR and LE defaults
Avoid loading default parameters for modes that are disabled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +162, -136 |
| 8dfc79da |
core: Fix mistakes of using mgmt_tlv_add_fixed
Fix mistakes on checking the result of mgmt_tlv_add_fixed. |
Howard Chung |
5 years ago |
1 file, +26, -26 |
| 11f4e4c0 |
core: Add param to disable interleave scan
This patch adds parameter to enable/disable the interleave scan feature. |
Howard Chung |
5 years ago |
4 files, +20, -0 |
| 1a8a8e01 |
core: Add parmas to set interleaving durations
This patch adds parameters to control the durations of allowlist scan
and no-filter scan when the kernel is doing interleaving scan. |
Howard Chung |
5 years ago |
4 files, +34, -0 |
| b31e89b6 |
monitor: Add new MGMT adv commands and events to monitor
This change adds the following to packet monitor:
-Add Ext Adv Params command and response
-Add Ext Adv Data command and response
This patch was manually tested by registering advertisements with
various features and verifying in btmon log. |
Daniel Winkler |
5 years ago |
1 file, +65, -0 |
| 664c5544 |
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. |
Daniel Winkler |
5 years ago |
1 file, +1, -0 |
| 3e615796 |
advertising: Expose SupportedCapabilities for advertising
To help our advertising clients understand the device capabilities, this
patch adds a SupportedCapabilities dbus endpoint for the advertising
manager. The primary reason behind this is to provide the valid LE tx
power range the controller supports (populated if controller supports
BT5), so a client can know the valid power range before requesting a tx
power for their advertisement.
I also thought it would be useful to indicate the max advertising data
length and scan response length in this endpoint, since some clients
will find it useful to set their advertising data (currently
experimental feature) or scan response data (possible future feature)
directly.
This patch has been tested on Hatch (BT5 support) and Kukui (No BT5
support) chromebooks to verify that the dbus endpoint contains the
correct data. |
Daniel Winkler |
5 years ago |
1 file, +35, -0 |
| f63c569f |
advertising: Query LE TX range at manager initialization
This patch calls the new MGMT command to get controller capabilities,
and parses the min and max LE tx power range when the manager is
initialized. This will be used to populate a client-facing dbus entry so
that the client will know the advertising capabilities of the controller
before registering an advertisement.
This patch is tested by manually verifying the data is parsed correctly
from the MGMT response. |
Daniel Winkler |
5 years ago |
5 files, +77, -10 |
| cf7795a6 |
advertising: Use new mgmt interface for advertising add
This patch allows bluetoothd to use the new extended advertising add
mgmt interface if it is available. The new interface will be used by
default, as it allows the client to set advertising intervals, and tx
power if the controller and kernel support extended advertising.
Each new registered advertisement will submit two requests to kernel;
the first sets the advertising parameters for the advertising instance,
and the second sets the advertising data and scan response for the
instance.
The parameters MGMT request will return the tx power selected by the
controller (if applicable), which is propagated to the client via a dbus
Set method.
Note: This patch also fixes a small bug in the packet monitor, where the
tx power value 0xff is considered as "Host has no preference". However,
the spec states this value to be 0x7f. It is corrected in this patch
This change has been tested extensively on Hatch (extended advertising)
and Kukui (no extended advertising) chromebooks. Manual tests do the
following:
- Configure advertisement with custom intervals, tx power with valid and
invalid values and combinations
- Ensure that with valid parameters, they are propagated and set in hci
requests. With invalid parameters, ensure that the registration fails.
Automatic tests verify 25 advertising usage scenarios involving single
and multi-advertising registration, over-registration, parameter
validation, etc. These tests don't test new intervals and tx power, but
validate that the new MGMT interface does not regress compatibility in
these 25 scenarios. |
Daniel Winkler |
5 years ago |
3 files, +237, -17 |
| d9455119 |
advertising: Parse intervals and tx power from adv
This change adds parsers for the advertising intervals and tx power
properties of the LEAdvertisement1 object. It validates that each field
adheres to the 5.2 spec, and that min and max intervals are compatible
with each other, i.e. that min interval is less than max interval.
A note here for maintainers: The tx power that is sent in the hci
parameter command is an int8_t, but as far as I can tell, there is no
clean way to use a signed 8-bit integer in dbus. The dbus byte type
seems incompatible with negative values in high-level languages (python)
without awkward usage manipulation on the client side. For this reason,
I chose to use an int16_t type for the tx power dbus field, which is
then downcasted to the int8_t in bluetoothd, which at least makes the
signed-ness of the type crystal clear to the dbus client that uses it.
This change is manually verified by ensuring the intervals and tx power
parameters are correctly parsed from the LEAdvertisement1 object, and
that the parse fails if the parameters are incorrect or not compatible
with each other. |
Daniel Winkler |
5 years ago |
1 file, +111, -0 |
| 657abc0e |
advertising: Detect if extended advertising mgmt commands are supported
We need to know if kernel supports the new MGMT interface. To do so, we
check the return from adapter's MGMT_OP_READ_COMMANDS call for the new
commands. This will later be used to route our requests for new
advertisements.
The change is tested by manually verifying that the correct MGMT
commands are used when the feature is and is not available in kernel. |
Daniel Winkler |
5 years ago |
4 files, +12, -0 |
| 838cafe4 |
doc/mgmt-api: Update controller capabilities MGMT command in mgmt-api
This patch changes Read Security Info MGMT to be called Read Controller
Capabilities Command |
Daniel Winkler |
5 years ago |
1 file, +15, -6 |
| b0899380 |
doc/mgmt-api: Add new Advertising MGMT interfaces to mgmt-api
This patch adds the following to mgmt-api:
- Add Extended Advertising Parameters Command
- Add Extended Advertising Data Command |
Daniel Winkler |
5 years ago |
1 file, +217, -0 |
| 66abcfb3 |
doc/advertising-api: update API with new interface
This updates the advertising documentation to include the following
features:
LE Advertising Manager:
- New SupportedCapabilities property
LE Advertisement:
- New min/max interval properties
- New tx power property |
Daniel Winkler |
5 years ago |
1 file, +48, -0 |
| a443c408 |
monitor: Decode Remove ADV Monitor
Add support for Remove Advertisement Monitor MGMT command and event.
@ MGMT Command: Remove Advertisement Monitor (0x0053) plen 2
Handle: 1
@ MGMT Event: Advertisement Monitor Added (0x002c) plen 2
Handle: 1
@ MGMT Event: Command Complete (0x0001) plen 5
Remove Advertisement Monitor (0x0053) plen 2
Status: Success (0x00)
Handle: 1 |
Howard Chung |
5 years ago |
1 file, +28, -0 |
| 9f0d8b82 |
monitor: Decode Add ADV monitor command
Add support for Add Advertisement Monitor MGMT command and event.
@ MGMT Command: Add Advertisement Monitor (0x0052) plen 69
Number of patterns: 2
Pattern 1:
AD type: 0
Offset: 1
Length: 2
Value : ...
Pattern 2:
AD type: 1
Offset: 10
Length: 4
Value : ...
@ MGMT Event: Advertisement Monitor Added (0x002b) plen 2
Handle: 1
@ MGMT Event: Command Complete (0x0001) plen 5
Add Advertisement Monitor (0x0052) plen 2
Status: Success (0x00)
Handle: 1 |
Howard Chung |
5 years ago |
1 file, +48, -0 |
| d0acb17d |
monitor: Decode ADV Monitor read feature command
Add support for Read Advertisement Monitor Features mgmt operation.
@ MGMT Command: Read Advertisement Monitor Features (0x0051) plen 0
@ MGMT Event: Command Complete (0x0001) plen 20
Read Advertisement Monitor Features (0x0051) plen 17
Status: Success (0x00)
Supported Features: 0x00000000
Enabled Features: 0x00000000
Max number of handles: 32
Max number of patterns: 16
Number of handles: 2
Handle: 1
Handle: 3 |
Howard Chung |
5 years ago |
1 file, +48, -0 |
| c4ef8f8d |
core: Rename hcid.h to btd.h
Since we use btd term for daemon APIs it makes sense to use it also
for the header name instead of hcid. |
Luiz Augusto von Dentz |
5 years ago |
16 files, +140, -140 |
| 01d035d3 |
core: Rename main_opts to btd_opts
Use btd_ prefix since this is a daemon API. |
Luiz Augusto von Dentz |
5 years ago |
10 files, +237, -237 |
| 8c637366 |
core: Split LE and BR/EDR parameters
This splits LE and BR/EDR config parameters and checks main_conf.mode
when parsing them. |
Luiz Augusto von Dentz |
5 years ago |
5 files, +429, -426 |
| d2e6c9ed |
shared/mgmt: Add mgmt_tlv_add_fixed
This adds mgmt_tlv_add_fixed macro which can be used to add fixed sized
value. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +3, -0 |
| 91877958 |
mgmt: Add support of mgmt TLV API
This adds API to send multiple TLVs to kernel, it is useful for
mgmt set system config command. |
Howard Chung |
5 years ago |
2 files, +103, -0 |
| 76c8c7a5 |
tools/mesh-cfgclient: Fix errors found by static analysis
This fixes a NULL pointer dereference error in subscription_cmd().
Also re-order calling sequence for l_free() & l_queue_remove()
in msg_recvd(): even though technically it is not a bug to pass
a value of a freed pointer to l_queue_remove(), it's a poor form
and confuses the analyzer. |
Inga Stotland |
5 years ago |
1 file, +7, -8 |
| c954096a |
audio/media: Destroy transport if SetConfiguration fails
set_configuration creates a transport before calling SetConfiguration on
the MediaEndpoint1 DBus interface. If this DBus call fails the
transport sticks around while it should instead be cleaned up.
When the peer retries or reconnects (in case of BlueZ which cuts the
connection due to a missing recount [1]) set_configuration finds this
old transport and returns FALSE. The peer will never succeed this call
unless it randomly decides to call clear_configuration or BlueZ is
restarted.
[1]: https://marc.info/?l=linux-bluetooth&m=160364326629847&w=2 |
Marijn Suijten |
5 years ago |
1 file, +16, -2 |
| c18829a8 |
avdtp: Fix not setting timeout when reconfiguring
When reconfiguring a codec avdtp_close will be used which resets
dc_timeout which can cause early disconnection if the new
configuration fails making it impossible to try other configurations. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +1, -0 |
| ef96b9ad |
emulator: Fix not setting CIG ID properly |
Luiz Augusto von Dentz |
5 years ago |
1 file, +1, -1 |
| a9bf6a2a |
lib: Fix using spaces to align BT_PKT_STATUS |
Luiz Augusto von Dentz |
5 years ago |
1 file, +1, -1 |