summaryrefslogtreecommitdiff
path: root/plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* plugins/sixaxis: Move device discovery to shared headerBastien Nocera2017-10-271-45/+37
| | | | | | | | | Move the struct containing the Sixaxis-compatible devices to a header shared with the input profiles code, so as to reduce device declaration. Adding support for new devices should be as easy as adding the device's declaration in profiles/input/sixaxis.h
* sixaxis: Ask user whether cable configuration should be allowedBastien Nocera2017-10-271-22/+67
| | | | | | | | | | | | Previously, users doing cable configuration of Sixaxis PS3 controllers would only get asked whether a device was allowed to connect to the computer when switching it to Bluetooth mode: unplugging it, and pressing the PS button. Instead, we should ask the user straight away, through the agent, whether the pad should be allowed to connect. This makes it easier to setup those devices, while keeping security.
* autopair: Don't handle the iCadeBastien Nocera2017-10-171-1/+11
| | | | | | | | | We can't easily enter digits other than 1 through 4 (inclusive) so leave it up to the agent to figure out a good passcode for the iCade. Note that we can not use the VID/PID of the device, as it is not yet known at that point.
* plugins/sixaxis: Remove LEDs handlingBastien Nocera2017-09-271-290/+5
| | | | | It's done in the kernel since 2014 in linux kernel commit 8025087acf9d2b941bae93b3e0967560e7e03e87
* plugins/sixaxis: Use the same device name as the kernelNicolas Werner2017-08-081-1/+1
| | | | | | | Some games check the device name to recognize a playstation controller. This changes the device name, when using a PS3 controller over bluetooth, to match the device name, that is advertised when using the controller via USB.
* plugins: Fix reconnect_interval for cases of improper main.confERAMOTO Masaya2017-07-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two problems: - When main.conf is not found, bluetoothd copies short the default set of reconnecting intervals to reconnect_interval. It does not match the reconnct_interval_len used as the array length. So if a link of device is disconnected, bluetoothd is run over reconnect_interval as time proceeds and will not time out as expected. bluetooothd with --debug option outputed the following log in my box: plugins/policy.c:reconnect_set_timer() attempt 1/7 1 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 2/7 2 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 3/7 0 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 4/7 0 seconds - When ReconnectIntervals in main.conf includes invalid characters, reconnct_interval_len value is bigger than the default array length. So if ReconnectAttempts value in main.conf is bigger than reconnct_interval_len value and a link of device is disconnected, bluetoothd is run over reconnect_interval as time proceeds and will not time out as expected. bluetooothd with --debug option outputed the following log in my box, if ReconnectAttempts value was 28 and ReconnectIntervals was inproper: ... plugins/policy.c:reconnect_set_timer() attempt 6/28 32 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 7/28 64 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 8/28 0 seconds ... plugins/policy.c:reconnect_set_timer() attempt 25/28 1 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 26/28 3 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 27/28 110683472 seconds This fix properly uses the default set of reconnecting intervals.
* autopair: Use unsigned int for passcode stringMarcel Holtmann2017-07-131-2/+2
|
* autopair: Fix PIN string buffer sizeMarcel Holtmann2017-07-111-1/+1
|
* policy: Fix removing reconnect flag while still connectingLuiz Augusto von Dentz2017-03-071-1/+1
| | | | | If a service connects it should stop new attempts but the current ones should continue so reconnection should not be reset.
* policy: Fix not reseting sink sourceLuiz Augusto von Dentz2017-01-241-1/+1
| | | | policy_connect_sink shall reset the sink_timer not source_timer.
* build: Remove gatt-example pluginLuiz Augusto von Dentz2016-11-081-578/+0
| | | | | | This examples can be done over D-Bus already so it makes no sense to have it as a plugin and in fact it currently it doesn't even work since it was never ported to the new code under src/shared.
* policy: Fix not reseting attempts when disconnectedLuiz Augusto von Dentz2016-10-251-0/+2
| | | | | | If the link is disconnected before any profile connects it shall still reset the attempts as the device actually has been connected, otherwise the number of attempts may not be respected.
* plugins/policy: Disable other connect policies while reconnect is activeLuiz Augusto von Dentz2016-07-291-19/+24
| | | | Other policies shall not interfere while reconnect is active.
* plugins/policy: Set list separatorLuiz Augusto von Dentz2016-07-291-0/+2
| | | | Set list separator to ',' as it is used in main.conf.
* plugins/policy: Revert patch 96db78604252eeb17614b9982ced95fd66c6c6fcLuiz Augusto von Dentz2016-07-291-2/+0
| | | | | | Patch 96db78604252eeb17614b9982ced95fd66c6c6fc actually breaks iterating to each attempt since the attempt++ is already done in reconnect_timeout callback.
* policy: Add AutoEnable config optionSzymon Janc2015-09-281-2/+27
| | | | | | | | | | | | | This option is used to configure policy for auto enabling adapters when found. This includes adapters found on start as well as adapters that are plugged in later on. Some distributions use legacy "hciconfig hci0 up" in boot-scripts to automatically enable controllers on start. But that is causing SMP kernel code to not being properly initialized. This patch allows distributions to automatically enable adapters in race free manner even if no agent is provided eg. in login screen.
* policy: Fix not incrementing attemptsLuiz Augusto von Dentz2015-05-071-0/+2
| | | | | The number of attempts and intervals maybe different causing the attempts to not be incremented properly.
* plugins/policy: Fix clang compile errorArman Uguray2015-05-051-4/+4
| | | | | | | | This patch fixes the following error when bluez is compiled with clang: plugins/policy.c:780:6: error: cast from 'int *' to 'size_t *' (aka 'unsigned long *') increases required alignment from 4 to 8 [-Werror,-Wcast-align] (size_t *) &reconnect_intervals_len, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* policy: Add parameters to control reconnectionLuiz Augusto von Dentz2015-04-081-28/+57
| | | | | This adds ReconnectAttempts and ReconnectIntervals so platforms can fine tune the reconnection strategy.
* core/device: Convert temporary flag to boolLuiz Augusto von Dentz2015-03-171-1/+1
|
* plugins/policy: Try reconnect Control/Target servicesMarcin Kraglak2015-03-131-8/+49
| | | | | | | | | | If state of Control/Remote services changed from CONNECTING to DISCONNECTED, and error is set to -EAGAIN, set random timer and try reconnect. This approach is described in AVRCP Spec 1.5 4.1.1: "If both devices open an AVCTP channel at the same time both channels shall be closed and each device shall wait a random time (not more than 1 s and not less than 100ms) and then try to open the AVCTP channel again."
* plugins: Fix local libbluetooth includes orderMarcel Holtmann2015-02-286-1/+14
|
* plugins: Use local libbluetooth includesMarcel Holtmann2015-02-283-6/+9
|
* plugins: Add explicit include for lib/bluetooth.hMarcel Holtmann2015-02-182-0/+2
|
* policy: Fix not removing timersLuiz Augusto von Dentz2015-02-021-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If service becomes unavailable, due to e.g. the device being removed, all the related timers should be removed as well otherwise it may cause crashes such as the following: Invalid read of size 8 at 0x4A6597: btd_device_get_service (device.c:5335) by 0x40F49F: policy_connect_ct (policy.c:112) by 0x4E7F552: ??? (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x4E7EAEA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x4E7EE87: ??? (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x4E7F1B1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x40BACF: main (main.c:631) Address 0x73b9ba8 is 360 bytes inside a block of size 592 free'd at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4E847FE: g_free (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x49C83F: device_free (device.c:624) by 0x4BDB29: remove_interface (object.c:658) by 0x4BE701: g_dbus_unregister_interface (object.c:1382) by 0x4A49DC: btd_device_unref (device.c:5173) by 0x41DC46: avdtp_free (avdtp.c:1138) by 0x41EE09: connection_lost (avdtp.c:1164) by 0x422EA5: session_cb (avdtp.c:2263) by 0x4E7EAEA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x4E7EE87: ??? (in /usr/lib64/libglib-2.0.so.0.4200.1) by 0x4E7F1B1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.1)
* plugins/autopair: Provide descriptive error logGowtham Anandha Babu2014-11-251-2/+2
| | | | Add more description in error logging.
* plugins/sixaxis: Add Sony Navigation ControllerAlex Gal2014-11-071-0/+7
|
* plugins/sixaxis: Add a set_leds_sysfs() functionAntonio Ospite2014-06-081-4/+85
| | | | | | | | | | | | | | | | | | | | | | | | | On recent kernels the hid-sony driver exposes leds class entries in sysfs for setting the Sixaxis LEDs, use this interface and fall back to hidraw in case using sysfs fails (e.g. on older hid-sony versions). Setting the LEDs via sysfs is the preferred way on newer kernels, the rationale behind that is: 1. the Sixaxis uses the same HID output report for setting both LEDs and rumble effects; 2. hid-sony remembers the state of LEDs in order to preserve them when setting rumble effects; 3. when the LEDs are set via hidraw hid-sony has no way to know the new LEDs state and thus can change the LEDs in an inconsistent way when setting rumble effects later. Also require libudev >= 172, this is where udev_enumerate_add_match_parent() has been first introduced. NOTE: using udev_enumerate_add_match_parent() results in a memory leak when enumerating child devices, this has been fixed in udev 207; the commit which fixes the issue is this one: http://cgit.freedesktop.org/systemd/systemd/commit/?id=51cc07576e119dea6e65478eeba9472979fd0936
* plugins/sixaxis: Add a get_leds_data() functionAntonio Ospite2014-06-081-9/+40
| | | | | | | | | Get all the data necessary to set the LEDs in a single function, returning a leds_data structure to be passed as argument to the setup_leds() callback. For now only a 'bitmap' field is used, which is the only thing that set_leds_hidraw() needs.
* plugins/sixaxis: Fix get_js_number() for devices connected via BTAntonio Ospite2014-06-081-8/+25
| | | | | | | | | | | Match hid devices and input devices using HID_UNIQ and UNIQ when these are available, this is the correct way to get matching devices when the controllers are connected via BT (UNIQ refers to the device bdaddr, PHYS is the adapter bdaddr, so matching against PHYS will result in all devices with the same LED number). Fall back to HID_PHYS and PHYS when needed, hid devices do not define HID_UNIQ when connected via USB.
* plugins/sixaxis: Factor out a calc_leds_bitmap() functionAntonio Ospite2014-05-161-12/+25
| | | | This is also in preparation of set_leds_sysfs().
* plugins/sixaxis: Factor out a set_leds_hidraw() functionAntonio Ospite2014-05-161-13/+18
| | | | | | | This is in preparation for a set_leds_sysfs() function. Make set_leds_hidraw() return void, as its return value is never used by the caller: the setup_leds() callback has to always return FALSE.
* plugins/policy: Both !uuids and !uuids[0] mean an empty listJohan Hedberg2014-05-151-3/+7
|
* plugins/policy: Remove reconnect timer in reconnect_reset()Johan Hedberg2014-05-151-0/+5
| | | | | | In the case that the remote starts connecting to us while we're waiting for the timeout to discover we shouldn't just reset the basic time keeping variables but also remove the timer.
* plugins/policy: Add support to retreive ReconnectUUIDs from main.confJohan Hedberg2014-05-151-5/+29
|
* plugins/policy: Rename UUIDs list variable to avoid name collisionsJohan Hedberg2014-05-151-4/+4
|
* plugins/policy: Add exponential backoff for reconnection attemptsJohan Hedberg2014-05-151-7/+23
|
* plugins/policy: Continue reconnections after connect attempt failureJohan Hedberg2014-05-151-0/+47
| | | | | This patch adds support for continuing reconnecting for several more times (up to 3 minutes) even when a connection attempt fails.
* plugins/policy: Add basic reconnection handlingJohan Hedberg2014-05-151-0/+190
|
* Remove unneeded headers includeClaudio Takahasi2014-04-041-1/+0
|
* gatt: Move Characteristic properties to attrib/gatt.hClaudio Takahasi2014-03-251-10/+10
| | | | | | Properties are defined by GATT specification. This patch moves and renames the defines related to Characteristic properties bits from attrib/att.h to attrib/gatt.h
* Replace att_put_u16() by put_le16()Claudio Takahasi2014-03-241-36/+37
|
* 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.
* autopair: Remove time(NULL) fallback when seeding rand()Anderson Lizardo2014-03-051-9/+18
| | | | | | | If /dev/urandom cannot be opened or read, just fail the plugin initialization, as it is very unlikely that a fully working Linux system does not have a working /dev/urandom. This also simplifies the code logic.
* core: Split LE and BR/EDR states for devicesJohan Hedberg2014-02-211-1/+1
| | | | | | | | | | | | For dual mode devices there are several state variables that are independent for each bearer. This patch splits these states up into two separate variable groups in btd_device and tracks the values based on what kind of connection is in question. The information is also used to select which bearer to use with Device1.Connect and Device1.Pair. The basic rule is that the bearer that's not connected/paired is selected, or then the bearer over which the device was last seen is selected.
* core: Fix device_get_name() to always null-terminate what it returnsPetri Gynther2014-02-191-1/+0
| | | | | Fix device_get_name() to null-terminate the name string it returns. Modify all callers as needed.
* plugins: Use full include path for header filesMarcel Holtmann2014-01-256-29/+29
|
* plugins/neard: Use correct service UUID free functionJohan Hedberg2014-01-211-1/+2
|
* neard: Refactor request_oob functionSzymon Janc2014-01-181-23/+20
| | | | This makes function flow easier to follow.
* neard: Set device UUIDs from EIRSzymon Janc2014-01-181-1/+2
| | | | | Handle UUIDs received in EIR from neard in same way as UUIDs received on device discovery.