summaryrefslogtreecommitdiff
path: root/lib/mgmt.h
Commit message (Collapse)AuthorAgeFilesLines
* mgmt: Use BIT macro when defining bitfieldsLuiz Augusto von Dentz2023-02-131-56/+61
| | | | | This makes use of BIT macro when defining bitfields which makes it clearer what bit it is toggling.
* lib: Add defines for MGMT setting bits for CIS feature supportPauli Virtanen2023-02-131-0/+2
|
* lib: Add defines of new MGMT opcodes and eventsBrian Gix2022-09-221-0/+6
| | | | | Populated new opcodes and events into static mgmt_ev and mgmt_op string arrays.
* lib: Add mgmt opcodes and events for MeshBrian Gix2022-09-011-0/+47
|
* advertising: Fix attempting to set scan_rspLuiz Augusto von Dentz2022-06-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* mgmt: Add NAME_REQUEST_FAILED flag for device_found eventArchie Pusaka2021-11-291-3/+4
| | | | | | | | Report failure when resolving remote name to userspace. This is useful so the userspace can make an informed decision when to retry name resolving procedure. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* lib: Add definitions of the Adv Monitor Device Found/Lost eventsManish Mandlik2021-11-221-0/+18
| | | | | | | | This patch adds definitions of the new Advertisement Monitor Device Found and Device Lost events to indicate that the controller has started/stopped tracking a particular device. Reviewed-by: Miao-chen Chou <mcchou@google.com>
* adapter: Set Device Privacy ModeLuiz Augusto von Dentz2021-11-091-1/+2
| | | | | This adds support for setting Device Privacy flag when enabled in main.conf via Privacy = device,limited-device.
* lib: Inclusive language changesArchie Pusaka2021-09-211-1/+1
| | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", and "accept list". Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* lib: Align mgmt header with documentTedd Ho-Jeong An2021-05-261-1/+6
| | | | | This patch updates the mgmt header to align with the mgmt api document (doc/mgmt-api.txt)
* mgmt: Add missing opcodes to mgmt_opLuiz Augusto von Dentz2021-05-241-0/+3
| | | | This adds the missing opcodes to mgmt_op so they are properly decoded.
* advertising: Create and use scannable adv param flagDaniel Winkler2021-03-221-0/+1
| | | | | | | | | | | | | | | In order for the advertising parameters hci request to indicate that an advertising set uses a scannable PDU, we pass a scannable flag along with the initial parameters MGMT request. This flag is populated based on the existence of any scan response data requested by the client. Without this patch, a broadcast advertisement with a scan response will either be rejected by the controller, or will ignore the requested scan response. The patch is tested by performing the above and confirming that the scan response is retrievable from a peer as expected. Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* advertising: Add SupportedFeatures to LEAdvertisingManager1Daniel Winkler2021-03-171-0/+2
| | | | | | | | | | | | | | The new SupportedFeatures member tells advertising clients whether the platform has hardware support for advertising or capability to set tx power of advertisements. Additionally, fix small typo in "secondary_exists" function name. Change is tested on hatch and kukui chromebooks by using dbus-send to verify that SupportedFeatures always exists, and is only populated when extended advertising is available. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* lib/mgmt: Adding Add Adv Patterns Monitor RSSI opcodeArchie Pusaka2021-01-151-0/+15
| | | | The new op is to utilize RSSI in advertisement monitor
* advertising: Query LE TX range at manager initializationDaniel Winkler2020-10-291-4/+10
| | | | | | | | | | | 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.
* advertising: Use new mgmt interface for advertising addDaniel Winkler2020-10-291-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* advertising: Detect if extended advertising mgmt commands are supportedDaniel Winkler2020-10-291-0/+4
| | | | | | | | | | 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.
* lib: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- GPL-2.0-or-later : 18 GPL-2.0-only : 1 License: GPL-2.0-or-later lib/sco.h lib/sdp.c lib/a2mp.h lib/uuid.h lib/bluetooth.h lib/hidp.h lib/rfcomm.h lib/hci.c lib/sdp.h lib/sdp_lib.h lib/bluetooth.c lib/mgmt.h lib/hci.h lib/uuid.c lib/l2cap.h lib/bnep.h lib/hci_lib.h lib/cmtp.h License: GPL-2.0-only lib/amp.h
* mgmt: Add controller suspend and resume eventsAbhishek Pandit-Subedi2020-08-311-0/+14
| | | | Add the controller suspend and resume events.
* device: Support marking a device with wake allowedAbhishek Pandit-Subedi2020-07-071-0/+2
| | | | | | | | | | | | | | | | If a device is allowed to wake the host system from suspend, it should be marked as wake allowed. We add support for a new property that is sent to the kernel via set device flags mgmt op. We also add the dbus endpoint to allow the wake allowed setting to be controlled. In order for wake allowed to be set, the profile must also support wake. This setting isn't exposed to the user but must be set by profiles that intend to support wake from suspend. If a device is connecting for the first time, it will be marked WakeAllowed if the profile supports it. On subsequent reloads of bluez, the stored setting "WakeAllowed" will be used to override any other setting.
* mgmt: Add mgmt op and events for device flagsAbhishek Pandit-Subedi2020-07-071-0/+31
| | | | Add Get Device Flags, Set Device Flags and Device Flags Changed.
* lib: Correct the string for a mgmt opMiao-chen Chou2020-06-171-1/+1
| | | | | This corrects the string of MGMT_OP_ADD_ADV_PATTERNS_MONITOR to match mgmt-api.txt.
* lib: Correct the name command definitionMiao-chen Chou2020-06-161-1/+1
| | | | | | This renames MGMT_OP_ADD_ADV_MONITOR to MGMT_OP_ADD_ADV_PATTERNS_MONITOR as this command is only used for patterns.
* mgmt: syncing configuration commands to the documentation.Alain Michaud2020-06-121-11/+19
| | | | | This patch simply fixes the definition names (and corresponding implemenation) to the adopted documentation.
* lib: Add definitions for advertisement monitor featuresMiao-chen Chou2020-06-111-0/+51
| | | | | | | | | | This adds the following command opcodes, event codes and the corresponding structures. - MGMT_OP_READ_ADV_MONITOR_FEATURES - MGMT_OP_ADD_ADV_PATTERNS_MONITOR - MGMT_OP_REMOVE_ADV_MONITOR - MGMT_EV_ADV_MONITOR_ADDED - MGMT_EV_ADV_MONITOR_REMOVED
* mgmt: Add load default system configuration definitionsAlain Michaud2020-06-041-0/+20
| | | | This change adds the load default system configuration definitions
* lib: Add structures and constants for experimental feature supportMarcel Holtmann2020-05-061-1/+30
|
* lib: Fixing opcode definition orderAlain Michaud2020-05-051-8/+8
| | | | Fixing what looks like a bad merge in the opcode order.
* lib: Add details for reading security information commandMarcel Holtmann2020-04-021-0/+7
|
* lib: Add missing text for wideband speech commandMarcel Holtmann2020-04-021-0/+1
|
* lib: Adding definitions for Wide Band Speech configurationAlain Michaud2020-03-051-1/+4
| | | | | This change adds the corresponding user space definition for wide band speech.
* lib: Adding missing op_code string conversionAlain Michaud2020-01-171-0/+1
| | | | Adding the missing string conversion for MGMG_OP_SET_BLOCKED_KEYS.
* lib: MGMT_OP_SET_BLOCKED_KEYS Api definitionsAlain Michaud2020-01-161-0/+15
| | | | Adding the required definitions for the MGMT_OP_SET_BLOCKED_KEYS Api.
* btmgmt: Add BREDR PHYs in PHY Configuration commandsJaganath Kanakkassery2018-11-281-11/+21
| | | | | | | | | | This basically adds BREDR packet types also in the PHY confiuration commands & events and makes the PHYs 32 bit so that it can be extended in future. This also add configurable PHYs in the GetPhy command wherein only those can be selected or deselected in SetPhy. This also adds LE prefix for LE phys to make it more descriptive
* btmgmt: Add support for setting PHY in add-advJaganath Kanakkassery2018-06-181-0/+3
|
* btmgmt: Add PHY configuration get/set commandsJaganath Kanakkassery2018-06-181-0/+33
|
* lib/mgmt: Add Set Appearance command definitionMichał Narajowski2016-09-181-0/+6
|
* lib: Add structs and defines for extended controller informationMarcel Holtmann2016-08-291-0/+19
|
* mgmt: Add support for Start Limited DiscoveryJohan Hedberg2016-01-051-0/+2
|
* lib: Add data structures for Get Advertising Size Information commandMarcel Holtmann2015-11-231-0/+13
|
* lib/mgmt: Update string tablesJohan Hedberg2015-11-231-4/+6
|
* lib: Add macros for advertising instance flagsArman Uguray2015-03-251-0/+8
| | | | | This patch adds macro definitions for possible advertising instance flags that can be passed to the "Add Advertising" mgmt command.
* lib: Provide data structures for Add/Remove AdvertisingArman Uguray2015-03-241-0/+33
| | | | | This patch provides data structures and opcodes for the Add/Remove Advertising commands and the Advertising Added/Removed events.
* lib: Add management event strings for advertising added/removedMarcel Holtmann2015-03-161-0/+2
|
* lib: Add mgmt event for local out-of-band data update notificationMarcel Holtmann2015-03-161-0/+8
|
* lib/mgmt: Update mgmt command string-lookup tableJohan Hedberg2015-03-161-7/+9
|
* lib: Provide data structures for local OOB extended data commandMarcel Holtmann2015-03-141-1/+10
|
* lib: Use single mgmt structure for legacy local OOB dataMarcel Holtmann2015-03-141-6/+2
|
* lib: Add response structure for advertising features commandMarcel Holtmann2015-03-141-0/+11
|
* lib: Change field name from class_of_dev to dev_classMarcel Holtmann2015-03-141-1/+1
|