Commit Graph

34 Commits

Author SHA1 Message Date
Johan Hedberg
1a9051e9ee Rename glib-helper to uuid-helper 2014-01-21 14:12:47 +02:00
Ravi kumar Veeramally
a2d6586eff android/hidhost: Remove unnecessary check
HID device will return unsupported or invalid response for unsupported
or invalid get/set protocol request. Need not to check prior to that.
2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
3abb6d368d android/hidhost: Fix connection state notification on profile unregister
Issue found while writing end2end tests. Usually profile unregister is
called when final cleanup of bluetoothd. Freeing connected hid devices
through g_slist_foreach is a asynchronous call. Profile is cleaned up
and and ipc also complete cleanup. But free_hid_devices tries to notify
hal which doesn't exist that time. So behaviour is unexpected.
2014-01-20 16:23:06 +01:00
Szymon Janc
cada0c0896 core: Add flags parameter to bt_search_service
This allows to pass custom SDP flags to sdp_connect.
2014-01-20 15:19:25 +02:00
Szymon Janc
47e30d43c5 android/hidhost: Move set_report parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:32 +02:00
Szymon Janc
33c2a480a8 android/hidhost: Move get_report parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:30 +02:00
Szymon Janc
af6b7bef23 android/hidhost: Move set_protocol parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:28 +02:00
Szymon Janc
81617ffdfc android/hidhost: Move get_protocol parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:05 +02:00
Szymon Janc
9a706710e4 bluetooth/hidhost: Fix using feature event as output event
Rename handle_uhid_event to handle_uhid_output and make it handle only
output events.
2013-12-18 10:01:30 +02:00
Szymon Janc
ffb856322c android: Use G_N_ELEMENTS macro for table elements calculation
It is more common in codebase to use this macro instead of opencoded
(sizeof(foo)/sizeof(foo[0])).
2013-12-03 13:44:04 +02:00
Szymon Janc
24c9fb1e12 android/hidhost: Use generic IPC message handling for commands
Handlers are registered on service register and unregistered on
unregister.
2013-12-02 16:24:02 +02:00
Andrei Emeltchenko
995d19a8d4 android/hidhost: Shutdown ctrl_io channel if intr_io fails
This fix possible memory leak.
2013-11-29 10:29:55 +02:00
Szymon Janc
7624ea2d42 android: Don't pass notification socket on services register
It is no longer needed as proper socket is use by IPC helpers.
2013-11-28 18:02:27 +02:00
Szymon Janc
daf1186c38 android: Use ipc_send_notif for sending notifications 2013-11-28 18:02:26 +02:00
Szymon Janc
6456e15664 android: Remove socket parameter from ipc_send_rsp
Use command socket provided to IPC on init.
2013-11-28 18:02:26 +02:00
Johan Hedberg
497bbf94d0 android/hidhost: Fix misuse of errno 2013-11-19 18:20:13 +02:00
Ravi kumar Veeramally
a3d66e91fa android/hidhost: Handle error case properly in interrupt_connect_cb
In case of conn_err in interrupt_connect_cb, device is freed but
connection status is not notified. Declared a local variable and
handled error case properly in case of conn_err and uhid failures.
Now connection status notified before freeing device.
2013-11-19 18:18:39 +02:00
Ravi kumar Veeramally
b3132fe966 android/hidhost: Free all connected devices in profile cleanup call
This can be easily verified with haltest tool.
2013-11-19 18:15:37 +02:00
Ravi kumar Veeramally
b32461d42d android: Handle multiple init(register) and cleanup(unregister) calls properly
This can be tested with haltest.
2013-11-19 18:15:37 +02:00
Szymon Janc
fc10c55498 android: Improve IPC helper to not send invalid status response
This fix issue with sending invalid success response from several
places where ipc_send_rsp was used for reporting success. Instead of
using using ipc_send for success response, make helper handle that.
2013-11-18 15:17:22 +02:00
Szymon Janc
a332daeba9 android/hidhost: Use adapter address provided on register
There is no need to use bt_adapter_get_address every time local address
is needed.
2013-11-14 14:55:30 +02:00
Andrei Emeltchenko
b17fdd8adb android/hidhost: Use correct error structure 2013-11-13 16:47:39 +02:00
Andrei Emeltchenko
04a1fc903b android/hidhost: Fix memory leak 2013-11-13 16:47:38 +02:00
Ravi kumar Veeramally
d95bae6d86 android/hidhost: Set info request from HAL is not supported
Data from hal_cmd_hidhost_set_info is usefull only when we create
UHID device. Once device is created all the transactions will be
done through the fd. There is no way to use this information
once device is created with HID internals.
2013-11-13 11:26:38 +02:00
Ravi kumar Veeramally
d69ce902b7 android/hidhost: Handle uhid output and feature events
Data read on uhid events output and feature has to be send through
SET_REPORT request to HID device.
2013-11-13 11:26:33 +02:00
Ravi kumar Veeramally
fa0ce2cbb4 android/hidhost: Fix error handling issue incase of G_IO_HUP
Incase of G_IO_HUP on GIOCondtion when hid device disconnected,
GIOCondition is combination of G_IO_IN and G_IO_HUP. Current code
tries to read as soon as it finds G_IO_IN in condition.
Apparently there is no data to read and loop continues.
2013-11-12 15:26:52 +02:00
Ravi kumar Veeramally
ff9e27b9de android/hidhost: Fix uhid create failure case
If uhid open or create fails then notify state and free the device.
Otherwise it replies bogus success return value on connect request.
2013-11-12 15:26:52 +02:00
Ravi kumar Veeramally
651522716f android/hid: Handle virtual unplug event from hid device
If hid host receives the virtual unplug event from hid device
recipient shall destroy or invalidate all bluetooth bonding and
virtual cable information
2013-11-11 10:30:37 +02:00
Johan Hedberg
97a5801394 android/hidhost: Fix up error logs to contain exact error 2013-11-08 15:46:31 +02:00
Ravi kumar Veeramally
e9c52e40fb android/hid: Add virtual unplug implemention in daemon
Send virtual unplug command to hid device and disconnect and remove
hid device details.
2013-11-08 15:28:59 +02:00
Ravi kumar Veeramally
c5408ef4ac android/hid: Add send data implemention in daemon
Send data on interrupt channel on request from hid host.
2013-11-08 15:28:40 +02:00
Ravi kumar Veeramally
bf2e192e3c android/hid: Fix set report data format in daemon
Report data coming to HAL is in ascii format, HAL sends
data in hex to daemon, so convert to binary.
2013-11-08 15:27:36 +02:00
Ravi kumar Veeramally
290f9826a5 android/hid: Rename virtual unplug define and struct
Renaming virtual unplug define and strcut name from VP to more
meaning full.
2013-11-08 11:17:29 +02:00
Szymon Janc
a54747586e android: Rename hid.c to hidhost.c
Name of daemon implementation will match Android HAL name. This will
make code navigation easier as daemon part and HAL library implementation
will be in foo.c and hal-foo.c respectively.
2013-11-07 18:44:57 +02:00