summaryrefslogtreecommitdiff
path: root/src/main.c
Commit message (Collapse)AuthorAgeFilesLines
* main: Rework config option parsingLuiz Augusto von Dentz2023-05-161-364/+386
| | | | | This rework config option parsing adding helper function to make it simpler to parse new options.
* main.conf: Fix parsing of CSIS groupLuiz Augusto von Dentz2023-04-051-5/+5
| | | | There was a typo in the group name using CSIP instead of CSIS.
* main.conf: Add CSIP profile configurable optionsSathish Narasimman2023-03-101-0/+124
| | | | | This introduces option to configure main.conf that can be used to configure co-ordinated set identification profile.
* main: Disable EATT by defaultLuiz Augusto von Dentz2023-03-091-1/+1
| | | | | | EATT is causing some problem with some platforms as they also attempt to configure it may cause a connection collision which needs to be handled by the kernel.
* main.conf: Add SecureConnections optionSimon Mikuda2022-11-211-0/+15
| | | | | | | | | | This introduces SecureConnections option to main.conf that can be used to configure this on adapter initialization. This is useful for: - disable for adapters that have a problems with SecureConnections enabled - if you want to disable CTKD (cross transport key derivation) - add option to enable only SecureConnections
* 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.
* main: Default device_privacy to trueLuiz Augusto von Dentz2022-07-131-0/+2
| | | | | | | | | | | | | | | | 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.'
* main.conf: Split Kernel Experimental UUIDs from ExperimentalLuiz Augusto von Dentz2022-06-141-23/+34
| | | | | This splits kernel experimental UUIDs from D-Bus Experimental interface so they can be controlled indenpendetly.
* main: Add support for CONFIGURATION_DIRECTORY environment variableLuiz Augusto von Dentz2022-04-181-10/+28
| | | | | | | When running as a systemd service the CONFIGURATION_DIRECTORY environment variable maybe set: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
* main.conf: Fix parsing of mode optionsLuiz Augusto von Dentz2022-02-181-3/+12
| | | | | | | | 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
* main.conf: Introduce MaxControllersLuiz Augusto von Dentz2022-02-161-0/+9
| | | | | This introduces MaxControllers which can be used to limit the number of adapters exposed in the system.
* main: add configurable RemoteNameRequestRetryDelay parameterArchie Pusaka2021-11-291-3/+16
| | | | | | | | | | This specifies how long will the userspace ignore a peer with an unknown name after a failed remote name resolving procedure. The peer device can still be connected, this only prevents the remote name resolving procedure retry. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* core: Update default advmon Sampling_Period to 0xFFManish Mandlik2021-11-221-1/+1
| | | | | | | | | Update default Advertisemet Monitor Sampling_Period to 0xFF. It indicates that controller will report only one advertisement per monitoring period for a device. This will help reduce the power consumption drastically. Reviewed-by: Miao-chen Chou <mcchou@google.com>
* main.conf: Rework privacy optionsLuiz Augusto von Dentz2021-11-091-4/+18
| | | | | This reworks privacy options so the limited discoverable is only available when controller mode is set to dual.
* main.conf: Fix Privacy modesLuiz Augusto von Dentz2021-11-011-1/+3
| | | | | | | | | Device privacy 0x01 uses RPA regardless of the discoverable setting thus it conforms to network mode not device mode. Also this improves documentation to state what is the expectation of each mode since it may not have been very clear by just using the terms from the spec.
* main.conf: Allow passing a list of UUIDs to ExperimentalLuiz Augusto von Dentz2021-09-081-8/+100
| | | | | | This allows the user to enable a subset of the experimental features to be enabled instead of all of them and also change -E to work in the same way so a list of UUIDs can also be given at the command line.
* main: Add missing Experimental entry to General optionsLuiz Augusto von Dentz2021-08-161-0/+1
| | | | | When Experimental was introduced it was not added to General option which causes a warning to be printed when it is set.
* core: Add RSSI sampling period in system parameterYun-Hao Chung2021-05-241-0/+20
| | | | | | | | | Add an option in main.conf to configure the default RSSI sampling period for advertisement monitor. Reviewed-by: apusaka@chromium.org Reviewed-by: mmandlik@chromium.org Reviewed-by: mcchou@chromium.org
* src/main: Fix double free strTedd Ho-Jeong An2021-05-211-1/+0
| | | | | | This patch fixes the double free the string. The string variable is always freed within its if statement so no need to free it again in the end.
* core: Fix loading AVDTP optionsYun-Hao Chung2021-05-191-1/+3
| | | | | | | | | | Fix misassigned AVDTP StreamMode option, which causes StreamMode not being set. Fix AVDTP SessionMode option not freed. Reviewed-by: mmandlik@chromium.org Reviewed-by: apusaka@chromium.org Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
* main.conf: Add option to enable experimental featuresLuiz Augusto von Dentz2021-05-141-3/+10
| | | | | | | The adds options Experimental which is the equivalent to -E/--experimental command line option. Fixes https://github.com/bluez/bluez/issues/132
* core: Fix memory leaksSteve Grubb2021-05-141-0/+1
| | | | | | g_key_file_get_string allocates memory that must be freed. asprintf allocates memory that must be freed.
* core: Use timeout_add_secondsFrédéric Danis2021-03-161-3/+4
| | | | | Replace calls to g_timeout_add_seconds() by the timeout_add_seconds() wrapper which takes care of 0 delay.
* main.conf: Enable passing false to DeviceIDLuiz Augusto von Dentz2021-03-051-1/+7
| | | | | | | This adds support for setting DeviceID to false so plaforms can disable DeviceID. Fixes: https://github.com/bluez/bluez/issues/101
* main.conf: Fix using wrong field for PageTimeoutLuiz Augusto von Dentz2020-12-011-1/+1
| | | | The correct field is btd_opts.defaults.br.page_timeout.
* main.conf: Use BR instead of BREDR as group nameLuiz Augusto von Dentz2020-12-011-1/+1
| | | | | This align with latest version of main.conf that does use [BR] instead of [BREDR].
* main.conf: Add option to configure AVDP session/stream channel modesLuiz Augusto von Dentz2020-11-171-0/+45
| | | | | | | This adds a new group AVDTP where platform can configure the preferred L2CAP channel modes for both session (signalling) and stream (transport). For backward compatibility the both SessionMode and StreamMode defaults to basic mode.
* main: Don't warn for unset config optionLuiz Augusto von Dentz2020-11-091-1/+1
| | | | Unset options shall not be printed if debug is not enabled.
* core: Add param to disable interleave scanHoward Chung2020-10-301-0/+7
| | | | This patch adds parameter to enable/disable the interleave scan feature.
* core: Add parmas to set interleaving durationsHoward Chung2020-10-301-0/+12
| | | | | This patch adds parameters to control the durations of allowlist scan and no-filter scan when the kernel is doing interleaving scan.
* core: Rename hcid.h to btd.hLuiz Augusto von Dentz2020-10-291-1/+1
| | | | | Since we use btd term for daemon APIs it makes sense to use it also for the header name instead of hcid.
* core: Rename main_opts to btd_optsLuiz Augusto von Dentz2020-10-291-120/+120
| | | | Use btd_ prefix since this is a daemon API.
* core: Split LE and BR/EDR parametersLuiz Augusto von Dentz2020-10-291-115/+176
| | | | | This splits LE and BR/EDR config parameters and checks main_conf.mode when parsing them.
* 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
* policy: Reconnect audio on controller resumeAbhishek Pandit-Subedi2020-09-141-0/+1
| | | | | | | | During system suspend, all peer devices are disconnected. On resume, HID devices will reconnect but audio devices stay disconnected. As a quality of life improvement, mark audio devices that were disconnected due to suspend and attempt to reconnect them when the controller resumes (after a delay for better co-existence with Wi-Fi).
* main: add configurable refresh_discovery parameterArchie Pusaka2020-08-181-0/+8
| | | | | This is to configure the default behavior of issuing SDP query to update the services upon profile connection.
* main: add missing comma after AlwaysPairableMichael Nosthoff2020-07-271-1/+1
| | | | | | | | | | | | Commit 1880b2990866 ("core: Add AlwaysPairable to main.conf") added a new key to supported_options but didn't add a comma. This leads to the following error message on startup if the key 'PairableTimeout' is pesent: Unknown key PairableTimeout for group General in /etc/bluetooth/main.conf This probably also leads to ignoring the setting. Fixes: 1880b2990866 ("core: Add AlwaysPairable to main.conf")
* device: Add timer for removing temporary devicesLuiz Augusto von Dentz2020-07-151-0/+13
| | | | | | | This adds a timer for how long to keep temporary devices, it is updated everytime the device is seen so devices will be removed even during an active discovery session which means the discovering for a long period will no longer just grow without removing devices that disappeared.
* main: adding missing connection parameter entriesAlain Michaud2020-06-171-0/+16
| | | | | This patch adds the missing connection parameter entries for loading connection parameters from main.conf
* main: Add configurable le autoconnect timeout valueAlain Michaud2020-06-171-0/+5
| | | | This patch adds support for a configurable le autoconnect timer.
* main: Fix logical error when loading controller paramsAlain Michaud2020-06-171-3/+4
| | | | | | Fix logical error when loading configuration parameters from the config file. Without this patch, the maximum allowable value is always used.
* a2dp: Use streaming mode when MPS is enabledLuiz Augusto von Dentz2020-06-101-10/+6
| | | | If MPS is enabled use L2CAP streaming mode for AVDTP channels.
* main: Read default system configuration from the conf fileAlain Michaud2020-06-041-0/+162
| | | | | This change adds support for reading the configurations from the main.conf file.
* main: Fix GATT option parsingSzymon Janc2020-03-311-1/+1
| | | | Key name is Channels.
* core: Add support for setting the number of GATT bearersLuiz Augusto von Dentz2020-03-021-0/+14
| | | | | This adds option to set the numbers of GATT Channels/Bearers to be connected in main.conf.
* core: Add new policy for Just-Works repairinghowardchung@google.com2020-02-181-0/+27
| | | | | | | | | | When kernel find out that the incoming Just-Works pairing is initiated by a paired device, it is user space's responsibility to decide the next action. This patch includes the following: - add JustWorksRepairing policy as an option in main.conf - handle the confirmation request from kernel
* main.conf: Make ReverseServiceDiscovery work with LELuiz Augusto von Dentz2019-06-031-2/+2
| | | | | | This makes ReverseServiceDiscovery work properly with LE connection by disabling the GATT client functionality which makes one able to setup a system to operate in peripheral role only mode.
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-061-0/+1
|
* core: Make use of mainloop_run_with_signalLuiz Augusto von Dentz2018-12-051-61/+3
| | | | This don't require setting up signalfd.
* core: Use mainloop_sd_notify instead of sd_notifyLuiz Augusto von Dentz2018-12-051-40/+11
| | | | | mainloop_sd_notify takes care of sending the messages to NOTIFY_SOCKET and includes the handling of WATCHDOG_USEC as well.