summaryrefslogtreecommitdiff
path: root/src/adapter.h
Commit message (Collapse)AuthorAgeFilesLines
* adapter: Add support for experimental flagLuiz Augusto von Dentz2023-05-161-0/+5
| | | | | This adds experimental field to btd_adapter_driver so the plugin can indicate drivers that depends on experimental to be enabled.
* adapter: Add function for checking adapter settingsPauli Virtanen2023-02-131-0/+2
| | | | Add function for checking adapter current settings.
* adapter: Keep track of whether the adapter is rfkill'edBastien Nocera2022-09-011-0/+1
| | | | | | 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.
* adapter: Add btd_adapter_find_device_by_fdLuiz Augusto von Dentz2022-08-291-0/+1
| | | | | This adds btd_adapter_find_device_by_fd that lookup a device by a fd socket destination address.
* adapter: Add support for setting ISO Socket experimental featureLuiz Augusto von Dentz2022-07-221-0/+1
| | | | | This adds support for setting ISO Socket experimental UUID which enables the use of BTPROTO_ISO on the system.
* device: Fix enabling wake support without RPA ResolutionLuiz Augusto von Dentz2022-05-121-0/+10
| | | | | | | | 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
* Listen and process remote name resolving failureArchie Pusaka2021-11-291-0/+1
| | | | | | | When Remote Name Resolve ends with failure, record this occurrence and prevent remote name resolving for the same device for some time. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* adv_monitor: Receive the Device Found/Lost eventsManish Mandlik2021-11-221-0/+8
| | | | | | | | | | | | | This patch registers callback functions to receive the Advertisement Monitor Device Found and Device Lost events. It also disables software based filtering whenever controller offloading support is available. Test performed: - Verified by logs that the MSFT Monitor Device is received from the controller and the bluetoothd is notified whenever the controller starts/stops monitoring a device. Reviewed-by: Miao-chen Chou <mcchou@google.com>
* adapter: Set Device Privacy ModeLuiz Augusto von Dentz2021-11-091-2/+7
| | | | | This adds support for setting Device Privacy flag when enabled in main.conf via Privacy = device,limited-device.
* src: Inclusive language changesArchie Pusaka2021-09-211-2/+2
| | | | | | | | | | | | 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", "accept list", and "reject list". Note that some suggestions come from https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf Also use "primary" to refer the global mgmt struct. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* core: add adapter and device allowed_uuid functionsYun-Hao Chung2021-08-041-0/+8
| | | | | | | This implements functions in src/adapter.c and src/device.c for plugins setting a list of allowed services. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* core: add device callbacks to adapter driverYun-Hao Chung2021-08-041-3/+11
| | | | | | | | | This adds the following callbacks to btd_adapter_driver. device_added: called when a device is added to the adapter device_removed: called when a device is removed from the adapter device_resolved: called when all services of the device have been resolved.
* adapter: Add a public function to find a device by pathSonny Sasaka2020-11-301-0/+2
| | | | | | | The public function is motivated by the Battery Provider API code which needs to probe whether a device exists. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* advertising: Query LE TX range at manager initializationDaniel Winkler2020-10-291-0/+1
| | | | | | | | | | | 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: Detect if extended advertising mgmt commands are supportedDaniel Winkler2020-10-291-0/+1
| | | | | | | | | | 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.
* src: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- LGPL-2.1-or-later : 62 GPL-2.0-or-later : 51 BSD-2-Clause : 2 License: LGPL-2.1-or-later src/adv_monitor.c src/adv_monitor.h src/shared/mainloop-glib.c src/shared/btp.c src/shared/tester.c src/shared/btsnoop.c src/shared/gatt-helpers.h src/shared/log.h src/shared/util.h src/shared/mainloop-ell.c src/shared/hci-crypto.c src/shared/mainloop.c src/shared/hfp.h src/shared/mainloop-notify.c src/shared/io-mainloop.c src/shared/btsnoop.h src/shared/uhid.h src/shared/util.c src/shared/ringbuf.c src/shared/btp.h src/shared/shell.h src/shared/io-glib.c src/shared/queue.h src/shared/gatt-server.h src/shared/crypto.c src/shared/crypto.h src/shared/io-ell.c src/shared/timeout-glib.c src/shared/mgmt.c src/shared/gatt-db.c src/shared/mainloop-notify.h src/shared/hfp.c src/shared/timeout-ell.c src/shared/shell.c src/shared/hci.c src/shared/log.c src/shared/ringbuf.h src/shared/gatt-helpers.c src/shared/queue.c src/shared/tty.h src/shared/timeout-mainloop.c src/shared/tester.h src/shared/gap.h src/shared/mgmt.h src/shared/gatt-db.h src/shared/uhid.c src/shared/mainloop.h src/shared/timeout.h src/shared/att-types.h src/shared/pcap.c src/shared/gap.c src/shared/att.c src/shared/pcap.h src/shared/hci.h src/shared/gatt-client.h src/shared/io.h src/shared/gatt-client.c src/shared/ad.c src/shared/att.h src/shared/gatt-server.c src/shared/hci-crypto.h src/shared/ad.h License: GPL-2.0-or-later src/attrib-server.h src/advertising.h src/textfile.c src/attrib-server.c src/uinput.h src/log.h src/eir.h src/sdpd.h src/sdpd-request.c src/service.h src/sdpd-database.c src/adapter.h src/plugin.h src/uuid-helper.h src/plugin.c src/main.c src/sdp-xml.c src/error.h src/oui.c src/device.c src/agent.h src/sdp-client.c src/oui.h src/device.h src/gatt-database.c src/error.c src/backtrace.c src/sdpd-server.c src/adapter.c src/log.c src/agent.c src/backtrace.h src/sdp-xml.h src/hcid.h src/dbus-common.h src/uuid-helper.c src/storage.c src/profile.c src/advertising.c src/storage.h src/dbus-common.c src/profile.h src/sdpd-service.c src/eir.c src/sdp-client.h src/gatt-database.h src/gatt-client.h src/rfkill.c src/gatt-client.c src/service.c src/textfile.h License: BSD-2-Clause src/shared/ecc.h src/shared/ecc.c
* adapter: Add btd_ prefix to has_kernel_featureLuiz Augusto von Dentz2020-09-151-1/+1
| | | | APIs exposed to plugins shall have btd_ prefix.
* device: don't wait for timeout if RemoveDevice is calledArchie Pusaka2020-09-151-0/+2
| | | | | | | | | | | | | | | RemoveDevice on adapter interface used to remove a device, even when the device is connected. However, since the introduction of the new 30 seconds timeout when setting a device as temporary, RemoveDevice doesn't immediately remove a connected device, but only disconnects it and waits for the timer to expire before effectively removes it. This patch removes the device as soon as it gets disconnected, provided the disconnection is triggered by a call to RemoveDevice. The regular timeout still applies for other cases. Tested manually by calling RemoveDevice on a connected device, and with ChromeOS autotest setup.
* adapter: Handle controller resume and notify driversAbhishek Pandit-Subedi2020-09-141-0/+2
| | | | | | Register for controller resume notification and notify the adapter drivers when it occurs. Also adds the resume event kernel feature to make sure the kernel supports this event.
* adapter: Refactor kernel feature globalsAbhishek Pandit-Subedi2020-09-141-0/+9
| | | | | Move all the kernel specific feature globals into a single kernel_features bitfield and replace all uses with the bitfield instead.
* adapter: Remove indirect dependency of headersMiao-chen Chou2020-09-141-0/+3
| | | | | Given that adapter.h refers symbols from lib/bluetooth.h and lib/sdp.h, these two headers should be included directly in adapter.h.
* device: Support marking a device with wake allowedAbhishek Pandit-Subedi2020-07-071-1/+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.
* Fix storage for adapters without public addressSzymon Janc2018-03-071-0/+1
| | | | | Since those have adapter folder prefixed with "static-" this needs to be taken into account when storing data.
* device: Fix bearer selection with single mode controllerSzymon Janc2018-03-061-0/+1
| | | | | | | | | | | If remote device is dual mode and advertises without "BR/EDR flag not supported" set than device is marked as supporting BR/EDR even if controller is doing LE only. This results in bluetoothd trying to connect over BR/EDR since this is prefered transport if none is connected. Fix this by checking if adapter supports specified technology before doing heuristic transport selection.
* advertising: Configure discoverable flag based on adapter settingsSzymon Janc2018-02-091-0/+1
| | | | | Until now advertising as peripheral was always setting General Discoverable flag set. With this patch this is set based on adapter discoverable setting.
* adapter: Add btd_request_authorization_cable_configured()Bastien Nocera2017-10-271-0/+2
| | | | | | | | | | | | Add btd_request_authorization_cable_configured() function to allow cable configured devices to ask the user straight away about whether the device should be allowed to connect to the computer. This allows us to ask the user at the time of the USB connection and initial setup, rather than when the first Bluetooth connection is made. The fact that the device might not be connected to the adapter when this event is triggered is mentioned in the Agent API docs.
* core: Fix passing correct local address type to ATT socketJohan Hedberg2016-11-111-0/+1
|
* gatt-database: Fix GATT object orderingOlivier Martin2016-03-071-0/+1
| | | | | | | | There is no guarantee the objects returned by GetManagedObjects are ordered in the required order which is Service, Characteristic Descriptor due to their respective dependencies. This change ensures the objects are processed in the correct order.
* core: Use local libbluetooth includesMarcel Holtmann2015-02-281-5/+1
|
* core: adapter: Initialize GATT databaseArman Uguray2015-02-181-0/+2
| | | | | | This patch adds code that initializes a btd_gatt_database for a btd_adapter. Also added is the btd_adapter_get_database getter function.
* core: Remove unnecessary LE connect for kernels that don't need itJohan Hedberg2014-11-031-0/+2
| | | | | | | | | | | | | From mgmt version 1.4 onward the ATT server socket gets appropriate notifications also for outgoing connections triggered by mgmt_pair_device. This patch adds a check for the mgmt version to not unnecessarily create the LE client socket first. For now this also fixes a potential race condition in the kernel where the socket connect LE scan disabling will fail because of a preceding mgmt_stop_discovery trying to do the same thing. Since mgmt commands (unlike the socket connect) are serialized the race cannot happen with the mgmt_stop_discover + mgmt_pair_device combination.
* core: Add subscription API for Manufacturer Specific DataAlfonso Acosta2014-10-251-0/+10
| | | | | | | | This patch allows plugins to be notified whenever an adapter receives Manufacturer Specific Data in the advertising reports from a device. This can happen when new device is discovered or when we autoconnect to it.
* core: Remove always_pairable featureJohan Hedberg2014-07-301-1/+0
| | | | | | We've decided to have pairable (soon to be renamed to bondable) always set after all, so neither the always_pairable variable nor the AlwaysPairable config option is needed.
* core: Expose adapter API to enable/disable pairable modeJohan Hedberg2014-07-181-0/+1
|
* core: Add non-temporary BR/EDR devices to the kernel whitelistJohan Hedberg2014-07-161-0/+4
| | | | | | We want to be able to accept connections from all non-temporary devices. We should pass these devices kernels that support the BR/EDR whitelist (through the Add Device mgmt command).
* core: Add separate functions for auto-connect kernel devicesMarcel Holtmann2014-06-301-0/+4
|
* core: Export API for tracking connection failuresJohan Hedberg2014-05-151-0/+4
| | | | This will be used by the reconnection policy logic.
* core: Add API to monitor device disconnectionsJohan Hedberg2014-05-151-0/+4
| | | | | | This patch adds an API to monitor devices disconnections, including the reason for the disconnection. It paves the way to allow creating a policy for reconnecting when disconnected.
* core: Update btd_adapter_find_device to also match the address typeJohan Hedberg2014-03-221-1/+2
| | | | This is necessary to do accurate matching for LE devices.
* core: Move private structs from adapter.h to adapter.cJohan Hedberg2014-02-201-18/+0
|
* core: Use bool instead of uint8_t for LTK master/slave variableJohan Hedberg2014-02-141-1/+1
|
* core: Rename adapter_remove_device to btd_adapter_remove_devicePetri Gynther2014-01-271-0/+3
| | | | Allow this symbol to be exported and usable from external plugins.
* Rename adapter_find_device to btd_adapter_find_deviceSzymon Janc2013-11-271-1/+1
| | | | Allow this symbol to be exported and usable from external plugins.
* Rename adapter_get_address to btd_adapter_get_addressSzymon Janc2013-11-271-1/+1
| | | | Allow this symbol to be exported and usable from external plugins.
* Rename adapter_get_device to btd_adapter_get_deviceSzymon Janc2013-11-271-1/+1
| | | | Allow this symbol to be exported and usable from external plugins.
* core: Remove leftover adapter_get_default()Claudio Takahasi2013-10-181-1/+0
|
* adapter: Handle removing of SDP recordsSzymon Janc2013-09-231-1/+1
| | | | | Make adapter in charge of updating SDP database. This allow to decouple SDP of code used for notifying adapters about SDP database change.
* adapter: Handle adding new SDP recordsSzymon Janc2013-09-231-1/+2
| | | | | Make adapter in charge of updating SDP database. This allow to decouple SDP of code used for notifying adapters about SDP database change.
* core: Avoid unnecessary gboolean on pincode callback APIAnderson Lizardo2013-06-131-1/+1
| | | | | Use standard "bool" type instead. Callers in plugins/* are fixed on the same commit to avoid compilation errors.
* core: Retry bonding attempt until the iterator reaches the endAlex Deymo2013-05-101-0/+3
| | | | | | | | | | | | | | | | This patch splits the bonding process in an interative process consisting of one or more "bonding attempts". The user/agent starts a new "bonding" that may involve several rounds of "bonding attempts" with the device before it gets back to the user/agent. Some functions were split in two parts to reflect this change. When a bonding attempt fails with an authentication error and a pin code was provided, a new bonding attempt is initiated (after a short delay) to retry with the next function (or next call to the same function) in the pincode callback list. If no pin code was provided to the device, no retry is attempted and the authentication error is returned to the client. This effectively allows a plugin try different pincodes for the same device during the same bonding.