Commit Graph

363 Commits

Author SHA1 Message Date
Johan Hedberg
f9b170951f Fix HID channel reference count issues
This patch cleans up the reference counting of the HID control and
interrupt channels. Particularly the connection failure cases weren't
properly handled previously.

Based on the original report and patch from Jaikumar Ganesh.
2011-02-07 15:27:03 -08:00
Luiz Augusto von Dentz
291b8885cd Fix use of deprecated glib on input plugin 2011-01-19 13:53:20 +02:00
Vinicius Costa Gomes
50fb53c4a7 Add a way to store the remote device type
Because we need to know the device type (LE, Basic Rate or Dual Mode)
to be able to fully restore the device from storage, we have to store
and load this information to permanent storage.

Note: due to "device_type_t" usage in storage.h, some header includes
needed to be reordered in files which include storage.h.
2010-12-22 13:57:33 +02:00
Johan Hedberg
4efb97bdae Add manager_foreach_adapter()
Ultimately manager_get_adapters shouldn't be needed at all. By
introducing manager_foreach_adapter most instances can be removed.
2010-12-19 13:25:51 +02:00
Johan Hedberg
898e56d749 Fix input disconnect function error return value 2010-12-14 10:51:03 +02:00
Gustavo F. Padovan
74d6c2db9b input: use btd_error_failed() 2010-12-14 10:31:20 +02:00
Gustavo F. Padovan
0d39f2db3c Add btd_error_already_connected() 2010-12-08 22:54:58 +02:00
Gustavo F. Padovan
d1bc7a947c convert error to btd_error_not_supported() 2010-12-08 22:54:56 +02:00
Gustavo F. Padovan
27fffa4aad Add btd_error_busy() 2010-12-07 23:11:10 +02:00
Gustavo F. Padovan
bd3cf4860d Add btd_error_in_progress() 2010-12-07 23:08:58 +02:00
Johan Hedberg
20ccc578c8 Remove unused includes 2010-11-28 13:41:35 +02:00
Johan Hedberg
abe7cd4412 Move ACL encryption functions to hciops 2010-10-26 17:51:41 -04:00
Johan Hedberg
fdc9710b16 Fix minor coding style issues 2010-09-02 23:15:14 +03:00
Bastien Nocera
6f605b8435 Remember fake devices for the daemon's lifetime
This would allow faster reconnection of already known devices,
so that no keypresses would be lost when reconnecting.

We only setup uinput the first time around, which will avoid
problems with devices not disappearing when disconnected.

Based on patch by Ruslan N. Marchenko <rufferson@gmail.com>
2010-09-02 23:11:55 +03:00
Bastien Nocera
5774e8c883 Fix Connected status when PS3 BD remote connects
The PS3 BD remote isn't connectable from the outside,
so the only way to use it with BlueZ is to make it connect. But
the code to create a new connection was never setting the
connected flags on the fake connection, so the remote wrongly
appeared as disconnected even though it was present.
2010-09-02 19:07:57 +03:00
Johan Hedberg
da446f5edd Fix format string warnings for g_dbus_create_error
This patch fixes gcc warnings for "format not a string literal and no
format arguments".
2010-08-19 23:24:42 +03:00
Gustavo F. Padovan
a554d3a656 Fix redundant null check on calling free()
Issues found by smatch static check: http://smatch.sourceforge.net/
2010-06-08 15:57:25 +08:00
Gustavo F. Padovan
8e58667ef0 Move debug() to DBG()
Use the new dynamic debug feature
2010-05-21 18:21:48 +02:00
Gustavo F. Padovan
e891f7df62 Move logging.{c,h} to log.{c,h}
Try to make log stuff more similar to ConnMan and oFono.
2010-05-21 14:40:36 +02:00
Johan Hedberg
78c8da0521 Set HID socket security back to LOW after the BtIO default change
At least mice require a lower security level, however for now this patch
changes the level back to low for all HID sockets.
2010-04-12 01:35:19 +03:00
Bastien Nocera
0e6dfbda8e Remove Sixaxis quirk
The quirk in input/device.c to make the Sixaxis joypad operational
in Bluetooth mode is now available directly in the kernel.
2010-02-05 06:55:10 -08:00
Marcel Holtmann
9184e2eeb7 Update copyright information 2010-01-01 17:08:17 -08:00
Marcel Holtmann
a5b1e3d02c Switch to a full non-recursive build system 2009-08-23 00:40:59 -07:00
Marcel Holtmann
f5f61c23d7 Make all major plugins builtin to simplify debugging 2009-08-09 14:35:39 -07:00
Luiz Augusto von Dentz
7c878f99e7 Make input plugin to use adapter references. 2009-05-27 11:25:25 -03:00
Luiz Augusto von Dentz
c4f3b52e2f Fix bug which cause disconnect watches to run on freed data.
Watches were not being removed when the pointer passed as user_data is freed.
2009-05-04 10:16:46 -03:00
Luiz Augusto von Dentz
8ca76f2e9c Fix bug which prevent input devices to work if bluetoothd is restarted.
In case of bluetoothd being restart or adapter unplugged the devices driver
callback .remove is called to free any data, but the input driver was also
sending the virtual cable unplug which is only necessary for permanent
removal.
2009-04-27 18:09:34 +03:00
Luiz Augusto von Dentz
a381d5342d Make disconnect watch callback to take removal flag.
This should make watches aware of a force disconnection for permanent device
removal making possible to remove any persistent data associate with the
device.
2009-04-27 10:43:29 -03:00
Luiz Augusto von Dentz
f12e4e2783 Make input plugin to use disconnect watches. 2009-04-22 15:41:56 -03:00
Alok Barsode
e050cc3d14 Using # operator to stringify plugin name. 2009-04-21 13:25:35 +01:00
Alok Barsode
2f28c39a63 Add priority field to plugin descriptor definition and load plugins in priority order. 2009-04-21 13:23:51 +01:00
Luiz Augusto von Dentz
d31cee86b0 Make input service to use confirm callback. 2009-04-17 21:02:54 +03:00
Luiz Augusto von Dentz
692b3876f4 Fix dead assignment.
Value stored to 'err' is never read.
2009-04-01 11:59:53 -03:00
Johan Hedberg
8e706e2d4f Convert some not-so-important info logs to debug logs 2009-03-24 12:31:10 +02:00
Alok Barsode
bf6a4a5774 Adding version check for plugins. 2009-03-14 07:11:47 +01:00
Marcel Holtmann
92bd92f851 Use GCC visibility for exporting symbols 2009-03-11 12:02:00 +01:00
Johan Hedberg
1c195ab280 Fix strncpy length parameters to avoid non-nul-terminated strings 2009-02-25 17:48:40 +02:00
Johan Hedberg
895239acf0 Only call g_io_channel_shutdown if the connection was actually successfull 2009-02-24 17:50:04 +02:00
Johan Hedberg
be61ef7476 Only send unplug in case of ENOENT 2009-02-23 14:10:54 +02:00
Johan Hedberg
8a706acad2 Fix virtual cable unplug sending 2009-02-23 14:07:05 +02:00
Johan Hedberg
7acf10a2b7 Reject multiple interrupt or control connect attepts 2009-02-23 13:44:51 +02:00
Johan Hedberg
e77b283923 Require both interrupt and control channels before calling hidp_add_connection 2009-02-23 13:27:05 +02:00
Johan Hedberg
b5645b871d Fix memory leak if btd_request_authorization fails 2009-02-23 13:24:41 +02:00
Johan Hedberg
5285b3f4bf Input plugin fixes and cleanup
This patch fixes all known issues caused by converting the input plugin
to use BtIO.
2009-02-23 10:34:16 +02:00
Johan Hedberg
dc4ecea559 Fix bt_io_connect parameter list 2009-02-22 17:15:29 +02:00
Johan Hedberg
8bca00dadf Fix bt_io_get parameter passing 2009-02-22 16:50:59 +02:00
Johan Hedberg
8fb3fd137f Use correct variable type for the PSM 2009-02-22 15:44:14 +02:00
Luiz Augusto von Dentz
10d6858927 Make use of g_io_channel_shutdown instead of deprecated g_io_channel_close. 2009-02-19 16:23:10 -03:00
Luiz Augusto von Dentz
e777c55aa7 Make use of g_error_free instead of g_clear_error when possible.
g_clear_error make an extra operation (&err = NULL) which is not necessary
when the GError is not reused.
2009-02-19 16:22:48 -03:00
Luiz Augusto von Dentz
c95494ee50 Make input plugin to use BtIO API. 2009-02-19 11:05:10 +02:00