Luiz Augusto von Dentz
21b1bd698b
android/AVDTP: Strip dependencies
...
This strips AVDTP code of any dependency of core and btio to make it
transport agnostic.
2013-11-25 16:50:31 +02:00
Luiz Augusto von Dentz
e40bfde22e
android: Add copy of current AVDTP implemention
...
These files are not added to any makefile on purpose because they still
have external dependencies.
2013-11-25 15:59:28 +02:00
Andrei Emeltchenko
a7f01b2e1b
android/socket: Add error printing possible close() failure
2013-11-25 15:37:17 +02:00
Andrei Emeltchenko
407789abea
android/socket: Use default sec_level for listen
...
Set default security level low for OPP and SPP and medium for PBAP and MAS.
Default security level would be low for listening without profile.
2013-11-25 15:36:25 +02:00
Andrei Emeltchenko
1c2efb5093
android/hal-utils: Fix possible NULL pointer dereference
2013-11-25 15:34:15 +02:00
Andrei Emeltchenko
ed7452fbbf
android/socket: Refactor socket send_fd function
...
Make code cleaner and initialize local cmsg buffer to zeroes.
2013-11-25 15:32:31 +02:00
Andrei Emeltchenko
b975a903fb
android/hal-sock: Print bdaddr on connect
2013-11-25 15:32:14 +02:00
Andrei Emeltchenko
d84ffb05e3
android/socket: Support listen() with supplied chan number
...
No profile is assigned in this case. There is a possibility to use
Serial Port Profile.
2013-11-25 15:32:07 +02:00
Andrei Emeltchenko
27d036281a
android/socket: Add SPP SDP record
2013-11-25 15:30:42 +02:00
Andrei Emeltchenko
980ffed8d7
android/socket: Add PBAP SDP record
...
This adds SDP service record like shown below:
Service Name: OBEX Phonebook Access Server
Service RecHandle: 0x10002
Service Class ID List:
"Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
"RFCOMM" (0x0003)
Channel: 15
"OBEX" (0x0008)
Profile Descriptor List:
"Phonebook Access" (0x1130)
Version: 0x0100
2013-11-25 15:30:33 +02:00
Andrei Emeltchenko
58ab9edb8a
android/socket: Add SPP uuid to profile table
2013-11-25 15:30:24 +02:00
Andrei Emeltchenko
b1e23ebd37
android/socket: Add MAS uuid to profile table
2013-11-25 15:30:13 +02:00
Andrei Emeltchenko
30d49b2b3a
android/socket: Add OPP SDP record
...
This adds SDP record for OPP shown below:
Service Name: OBEX Object Push
Service RecHandle: 0x10002
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"RFCOMM" (0x0003)
Channel: 9
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100
2013-11-25 15:29:58 +02:00
Andrei Emeltchenko
181158d8e6
android/socket: Add general service create/remove function
...
create_record function from profile is used to create SDP service record.
The record is removed from rfsock cleanup function.
2013-11-25 15:29:15 +02:00
Andrei Emeltchenko
cb2fdb2f53
android/socket: Close file descriptor after sending
2013-11-25 15:28:29 +02:00
Andrei Emeltchenko
7a9c4622e4
android/socket: Send connect signal to Android framework
...
Android framework expects connect signal to be sent when
remote device is connected.
2013-11-25 15:28:01 +02:00
Andrei Emeltchenko
c8226366a8
android/socket: Send RFCOMM channel to framework
...
Framework expects channel to be send.
2013-11-25 15:27:00 +02:00
Andrei Emeltchenko
a1deeaf589
android/socket: Implement HAL connect call
...
HAL connect uses similar event handlers like listen call.
2013-11-25 15:26:03 +02:00
Andrei Emeltchenko
9b33ebad23
android/socket: Parse SDP response and connect
...
Parse SDP response, find RFCOMM channel and connect.
2013-11-25 15:25:52 +02:00
Andrei Emeltchenko
044baf78ef
android/bluetooth: Fix memory leak
2013-11-25 14:51:08 +02:00
Jakub Tyszkowski
47536a57a9
android/pics: Add PTS PICS for DID
...
PTS PICS for DID, targeting Android 4.4.
2013-11-25 14:47:40 +02:00
Jakub Tyszkowski
9942252e00
android/pics: Add PTS PICS for PAN
...
PTS PICS for PAN, targeting Android 4.4.
2013-11-25 14:47:40 +02:00
Szymon Janc
034e30e642
android/hal-bluetooth: Use static memory for enum convertion
...
There is no need to use dynamic allocation for enum properties
convertion. Each property type can be present only once in properties
callback so using static allocation is safe. This also remove need
for cleanup properties after HAL callback is called making code
simpler.
2013-11-25 14:45:59 +02:00
Andrei Emeltchenko
71e455c8b9
android/haltest: Zero initialize cmsg buffer
2013-11-21 16:43:40 +02:00
Andrei Emeltchenko
e73bd888be
android/ipc: Zero initialize cmsg buffer
...
This fixes valgrind warnings:
...
Syscall param sendmsg(msg.msg_control) points to uninitialised byte(s)
...
2013-11-21 16:43:38 +02:00
Luiz Augusto von Dentz
ee750796da
android/a2dp: Cleanup devices on unregister
...
This cleanup any existing devices in bt_a2dp_unregister
2013-11-21 10:15:51 +02:00
Andrei Emeltchenko
7ee3686348
android/socket: Implement socket connect HAL method
...
First step is to query remote device for RFCOMM channel.
2013-11-20 15:10:53 +02:00
Andrei Emeltchenko
002a64f595
android/socket: Notify channel to Android framework
...
Android framework expects to receive channel number as int.
2013-11-20 15:10:45 +02:00
Andrei Emeltchenko
34c4ae9ad8
android/socket: Send accept signal to Android framework
...
Android expects to get accept signal over file descriptor which was
set during listen HAL call.
2013-11-20 15:10:17 +02:00
Andrei Emeltchenko
cfc5e2ae33
android/socket: Implement RFCOMM events
...
Copy data from RFCOMM socket to Android framework. Consider splice
in the future.
2013-11-20 15:10:03 +02:00
Andrei Emeltchenko
601cfc775e
android/socket: Implement Android RFCOMM stack events
...
Handle events from Android framework. Write everything to real RFCOMM
socket. Consider splice() in the future.
2013-11-20 15:09:02 +02:00
Andrei Emeltchenko
1698ccf997
android/socket: Implement socket accepted event
...
When we get accepted event we create rfcomm slot and start listening
for events from Android framework and from RFCOMM real socket.
2013-11-20 15:08:03 +02:00
Andrei Emeltchenko
9795183df9
android/socket: Implement listen on RFCOMM socket
...
Handle HAL socket listen call. Create RFCOMM socket and wait for events.
2013-11-20 15:07:35 +02:00
Andrei Emeltchenko
7c44d6a7c7
android/socket: Add get RFCOMM default channel
...
RFCOMM default channel is the same like in other BlueZ code, it is
defined in src/profile.c
2013-11-20 15:03:36 +02:00
Ravi kumar Veeramally
52ce60f4c9
android/hal-pan: Fix order of event handler registration
...
IPC message handler determines handler offset with
opcode = msg->opcode - HAL_MINIMUM_EVENT. But here order is misplaced.
2013-11-20 09:41:38 +02:00
Ravi kumar Veeramally
eb53ab4746
android/hal-a2dp: Fix expected size of A2DP events
2013-11-20 09:40:23 +02:00
Johan Hedberg
23200acf0a
android: Fix expected size of hal_ev_ssp_request
2013-11-19 22:35:47 +02:00
Johan Hedberg
356d103644
android/build: Add PICS files to EXTRA_DIST
2013-11-19 18:34:19 +02:00
Johan Hedberg
031bd3f56e
android/pics: Fix line lengths
2013-11-19 18:33:10 +02:00
Jakub Tyszkowski
4c67683a34
android: Add PTS PICS for HID
...
PTS PICS for HID, targeting Android 4.4.
2013-11-19 18:30:49 +02:00
Jakub Tyszkowski
64e07b2233
android: Add PTS PICS for GAP
...
PTS PICS for GAP, targeting Android 4.4.
2013-11-19 18:30:47 +02:00
Szymon Janc
3e0b74007b
android/hal-bluetooth: Remove not needed check in get_adapter_property
...
Properties types are verified on daemon side and proper error is
returned on wrong type. No need to double check that on HAL side.
2013-11-19 18:26:46 +02:00
Szymon Janc
2399cd19e6
android/hal-bluetooth: Remove not needed check in set_adapter_property
...
Properties types are verified on daemon side and proper error is
returned on wrong type. No need to double check that on HAL side.
2013-11-19 18:24:49 +02:00
Szymon Janc
d090b7b8e5
android/hal-bluetooth: Handle dut mode receive event
...
Pass received data to callback if it is present.
2013-11-19 18:24:34 +02:00
Szymon Janc
a293f0e8f4
android/hal-bluetooth: Remove not needed __func__ from debug print
...
DBG macro already adds function name to print output.
2013-11-19 18:24:12 +02:00
Szymon Janc
697405ef01
android/hal-bluetooth: Add support for dut mode send command
...
This is used to send test HCI commands when DUT mode is enabled.
2013-11-19 18:22:43 +02:00
Szymon Janc
2fcb0e3903
android/hal-bluetooth: Add support for dut mode configure command
...
This command is used to enter or exit DUT mode.
2013-11-19 18:22:33 +02:00
Szymon Janc
b43aac26d2
android/hal-bluetooth: Add support for get remote service record cmd
2013-11-19 18:21:57 +02:00
Szymon Janc
d99a0d216f
android/hal-bluetooth: Add support for set remote device property cmd
...
This command is used to set remote device property of specified type.
2013-11-19 18:21:22 +02:00
Szymon Janc
598f60cbd3
android/hal-bluetooth: Add support for get remote device properties cmd
...
This command is used to get all properties of remote device.
2013-11-19 18:21:11 +02:00
Szymon Janc
c916ed5ff2
android/hal-bluetooth: Add support for get remote device property cmd
...
This command is used to get remote device property of specifided type.
2013-11-19 18:20:48 +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
Ravi kumar Veeramally
699c946daf
android/hal-pan: Return error in case of unsupported PAN roles
2013-11-19 18:15:37 +02:00
Szymon Janc
d00e259514
android/hal: Check if command socket was shutdown by peer
...
This will allow to print proper error before exiting.
2013-11-19 16:42:02 +02:00
Szymon Janc
bf8c55f3de
android/hal-a2dp: Use generic IPC message handling for events
...
Register handlers on service init and unregister on cleanup.
2013-11-19 16:42:02 +02:00
Szymon Janc
8fd569476b
android/hal-pan: Use generic IPC message handling for events
...
Register handlers on service init and unregister on cleanup.
2013-11-19 16:42:02 +02:00
Szymon Janc
a54c1e9259
android/hal-hidhost: Use generic IPC message handling for events
...
Register handlers on service init and unregister on cleanup.
2013-11-19 16:42:01 +02:00
Szymon Janc
c58070eb1e
android/hal-bluetooth: Register IPC message handlers
...
Register handlers on service init. Since this requires all handlers to
be registered (unknown opcode is considered IPC error) missing handlers
stubs are provided.
2013-11-19 16:42:01 +02:00
Szymon Janc
d7f2a7916f
android/hal: Add initial code for IPC message handlers
...
This will allow to register and unregister handlers for IPC messages
Basic sanity check will be done in common code. Commands with variable
length will be verified against minimum size only.
2013-11-19 16:42:01 +02:00
Andrei Emeltchenko
07ff7758fd
android/hal-sock: Print bdaddr string instead of pointer
2013-11-19 16:06:13 +02:00
Ravi kumar Veeramally
0a5ae04d8e
android/pan: Fix wrong struct parameter in disconnect function call
2013-11-19 15:23:20 +02:00
Andrei Emeltchenko
e818990935
android/A2DP: Use sdp_data_free for freeing sdp data types
2013-11-19 12:15:51 +02:00
Andrei Emeltchenko
fafd7c20b1
android/A2DP: trivial: Use NULL for zero pointer
2013-11-19 12:15:19 +02:00
Andrei Emeltchenko
2022b92090
android: trivial: Add comment making code consistent
2013-11-19 11:16:11 +02:00
Andrei Emeltchenko
bde65270e3
android/socket: Add connect signal to socket
...
Connect signal is used to pass information to framework that socket
is accepted.
2013-11-19 11:15:49 +02:00
Szymon Janc
5a8313a473
android/hal: Verify command status response before processing
...
This makes HAL IPC code verify error reply before processing it. It
also verify if success status was reported according to IPC spec.
2013-11-18 15:17:24 +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
Andrei Emeltchenko
f9d15c95af
android/a2dp: Use NULL for zero pointer
2013-11-18 13:04:22 +02:00
Andrei Emeltchenko
7d777eda20
android/socket: Use static local adapter address
2013-11-18 10:42:37 +02:00
Andrei Emeltchenko
e94a667739
android/hal-sock: Add debug flag printing
2013-11-18 10:42:18 +02:00
Szymon Janc
2e86eac876
android: Refactor update_found_device function
...
This makes function flow easier to follow and understand. Besides that
it also fix issue with sending to many bytes if some prop were not
present in EIR.
2013-11-16 20:22:03 +02:00
Szymon Janc
51012a0104
android: Fix sending invalid remote device property event
...
Remote device property event has variable length, pass whole event
length to ipc_send, not only header.
2013-11-16 20:22:01 +02:00
Szymon Janc
ff7246fb8f
android: Fix sending remote device property if name is not present
...
This fix missing bdaddr to string convertion if name was NULL. This
was resulting in using undefined dst value.
2013-11-16 20:21:59 +02:00
Lukasz Rymanowski
ba310d7f90
android: Change TODO with explaining comment
2013-11-15 20:23:38 +02:00
Lukasz Rymanowski
e623075212
android: Update bond state on auth and connect failed
2013-11-15 20:22:23 +02:00
Lukasz Rymanowski
818d532ba3
android: Cache device name on device list.
2013-11-15 20:20:51 +02:00
Lukasz Rymanowski
e9d43a87fa
android: Update bond state on incoming bonding
...
Before sending any ssp request or pin code request up to HAL library we
need to send bond state change with bonding state. Otherwise incoming
bonding is not correctly handled by Bluetooth.apk.
In this patch also device list has been added in order to e.g track
bonding state.
Note: For incoming paring (security mode 3) there is a need to send
HAL_EVE_REMOTE_DEVICE_PROPS before HAL_EV_PIN_REQUEST.
It is because Android will crash due to bug in pinRequestCallback
function in java. Android checks if device is already in HashMap and if
not then creates device, but forget to use that one, but instead do
operations on NULL. By sending HAL_BOND_STATE_BONDING event it works
better but we have race issue. It is because new device is added to
HashMap not in callback context but later after BONDING msg will be
received by BondStateMachine. If it happens before pin_request_cb hits
java then we are fine, otherwise not. So for that reason we send
HAL_EV_REMOTE_DEVICE_PROPS so in the java handler class new device will
be added to HashMap in the callback context.
In ssp case we don't have this problem as we send device found once acl
is created.
2013-11-15 20:19:50 +02:00
Szymon Janc
e30125fa92
android: Fix not storing adapter index in index added event
...
If controller was addded after daemon start its index was not stored
resulting in mgmt commands to be always send to MGMT_INDEX_NONE index.
2013-11-15 14:44:10 +02:00
Ravi kumar Veeramally
32776f33d2
android/hal-ipc: Add pan notification call to hal-ipc dispatch handler
2013-11-15 12:02:39 +02:00
Ravi kumar Veeramally
017aa01531
android/pan: Fix wrong HAL service id
2013-11-15 12:02:36 +02:00
Luiz Augusto von Dentz
711331d28f
android/a2dp: Add implementation of SDP record
...
This adds the following record:
Service Name: Audio Source
Service RecHandle: 0x10001
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x103
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0103
2013-11-14 17:27:48 +02:00
Johan Hedberg
d311204d6d
android/build: Remove unnecessary mentions of source files in EXTRA_DIST
2013-11-14 15:57:27 +02:00
Johan Hedberg
4fc1a0cfd1
android/build: Add missing header files to android_haltest_SOURCES
2013-11-14 15:57:03 +02:00
Szymon Janc
9ad9540f7d
android: Rename bluetooth service functions to match service name
...
Make public functions match service name.
2013-11-14 14:58:16 +02:00
Szymon Janc
c060fc6976
android: Rename adapter.c to bluetooth.c
...
Match service name that is implemened in that file. This will also
keep convention of foo.c and hal-foo.c implementing remote parts of
same service.
2013-11-14 14:57:56 +02:00
Szymon Janc
3419cd2118
android: Remove not needed bt_adapter_get_address function
...
All services receive adapter address on init so there is no need for
this function. Removing it will also help keeping services not depend
on adapter service.
2013-11-14 14:55:30 +02:00
Szymon Janc
3be6d4a82f
android: Report adapter address in adapter_ready callback
...
Adapter is not going to change while daemon is running so its address
can be stored after init is complete.
2013-11-14 14:55:30 +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
Szymon Janc
cd1dd51f79
android: Don't use static pointer for storing adapter_ready callback
...
There is no need to keep ready callback for daemon lifetime as it is
not used after reporting adapter being ready. Use mgmt library feature
for passing user data so that static pointer is not needed.
2013-11-14 14:55:30 +02:00
Szymon Janc
e809154eba
android: Move adapter initialization to adapter.c
...
There is no need to handle that in main.c. Also this removes mgmt
interface dependency from adapter API as all mgmt commands are handled
from adapter code.
Startup and shutdown timeouts handling is left in main.c.
2013-11-14 14:55:30 +02:00
Szymon Janc
73e110b5b0
android: Make adapter static
...
Only one controller is used so there is no need to keep it as allocable
structure. This will also make memory management simpler and more
correct eg. adapter was never free.
Elements not directly related to adapter are kept outside of adapter
structure.
2013-11-14 14:55:30 +02:00
Luiz Augusto von Dentz
41599b1d3b
android/a2dp: Add initial implementation of HAL_OP_A2DP_DISCONNECT
2013-11-14 14:25:39 +02:00
Luiz Augusto von Dentz
9cb73c97f8
android/a2dp: Add initial implementation of HAL_OP_A2DP_CONNECT
2013-11-14 14:25:24 +02:00
Luiz Augusto von Dentz
46c8cd97fc
android/a2dp: Add initial implementation of socket handling
...
This adds initial code to handle incoming connection and notifying
connection states.
2013-11-14 14:20:53 +02:00
Luiz Augusto von Dentz
230211cd25
android/hal-a2dp: Add defines for possible connection states
2013-11-14 14:19:11 +02:00
Luiz Augusto von Dentz
cfcbbf8f86
android/hal-a2dp: Add implemention of .cleanup
2013-11-14 14:19:02 +02:00
Luiz Augusto von Dentz
ad5813bcd5
android/hal-a2dp: Add implemention of .init
2013-11-14 14:18:59 +02:00
Luiz Augusto von Dentz
f10e740f21
android/hal-a2dp: Use conn_state instead of connection_state
...
This is shorter and more consistent with other HAL such as HID.
2013-11-14 14:18:51 +02:00
Andrei Emeltchenko
d39e947a1f
android/debug: Move debug functions to hal-utils.c
...
Debug functions will be used by HALs and haltest.
2013-11-14 10:27:15 +02:00
Szymon Janc
7d699101e2
android: Core service should be always registered
...
Core service is used to register other services and shall be always
consider registered.
2013-11-13 19:46:01 +02:00
Szymon Janc
33d823d2ee
android: Shutdown if IPC command for unregistered service is received
...
Sending commands to not registered services is violation of IPC spec
and should result in daemon shutdown.
2013-11-13 19:43:21 +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
a7579647d7
android/pan: Handle connection and control state notifications
2013-11-13 13:15:11 +02:00
Ravi kumar Veeramally
fcf2331ada
android/pan: Add notify method to PAN notifications
2013-11-13 11:27:50 +02:00
Ravi kumar Veeramally
ab8a2ab554
android: Fix opcode parameter type from uint16_t to uint8_t
2013-11-13 11:27:46 +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
c1693c614e
android/hidhost: Remove deprecated idle opcode from ipc document
...
Idle time is deprecated in HID_SPEC1_1. So get and set idle time api's
are removed and not implemented. But callback is left out in Android
bt_hh.h. Generally this callback needs to be called when HAL requests
get and set idle time calls with status. So the method calls itself
removed, no point to implement this callback.
Also update GET_REPORT and VIRTUAL_UNPLUG opcode values.
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
7e673560e5
android/pan: Add PAN cleanup interface implementation
2013-11-12 19:02:19 +02:00
Ravi kumar Veeramally
68255433d6
android/pan: Add PAN related defines and event struct to hsl-msg header
2013-11-12 19:01:12 +02:00
Szymon Janc
51ac375db0
android: Register DeviceID record when adapter is initialized
...
Register DeviceID SDP record and update local UUIDs after DeviceID
information is passed to kernel.
2013-11-12 18:59:30 +02:00
Marcin Kraglak
8612cbc529
android: Add support for getting UUIDs property
...
This method will call adapter_properties_cb with uuids of
adapter. Method is called also when uuid is added or removed.
2013-11-12 18:59:15 +02:00
Marcin Kraglak
498bfa7aa8
android: Clear adapter uuids during initialization
...
Clear adapter uuids during init. We have to do it before
other profiles will be able to register sdp records and add
their uuids.
2013-11-12 18:59:07 +02:00
Szymon Janc
e0e8c7a941
android: Remove not needed include
...
bt_uuid_t is not used so lib/uuid.h doesn't need to be included.
2013-11-12 18:59:02 +02:00
Marcin Kraglak
cab374f7e8
android: Add and remove sdp records and uuids
...
This is api for adding and removing sdp records and uuids
via mgmt interface. Local profiles have to store handle to
own records to remove them in cleanup. Additionally list of
uuids is created in bt_adapter struct.
2013-11-12 18:58:09 +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
Lukasz Rymanowski
19f49964b5
android: Update HAL with device info on incoming connection
...
Make sure Android have information about connecting remote device. This
is needed for example to show device name on incoming bonding request.
2013-11-12 15:05:09 +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
Andrei Emeltchenko
69a33fbf2a
android/hal-utils: Make hal-utils functions return const string
2013-11-08 16:21:41 +02:00
Andrei Emeltchenko
bec0539ba9
androi/haltest: Make debug functions return const string
2013-11-08 16:21:14 +02:00
Szymon Janc
0d45c38c00
android: Fix error handling in adapter_ready
...
On error negative value is passed to adapter_ready callback. This fix
passing negative error code to strerror.
2013-11-08 16:15:06 +02:00
Andrei Emeltchenko
c93a3fc89f
android/hal-sock: Add UUID debug print in socket HAL
...
Socket HAL uses uint8_t * strings which are of size bt_uuid_t.
2013-11-08 15:57:26 +02:00
Andrei Emeltchenko
d18c36e232
android/debug: Convert uuid helper to use uint8_t buffer
...
At this moment Android uses uint8_t * and bt_uuid_t for representing
UUID for different HALs. Convert debug helper to use uint8_t * string.
2013-11-08 15:57:25 +02:00
Johan Hedberg
97a5801394
android/hidhost: Fix up error logs to contain exact error
2013-11-08 15:46:31 +02:00
Andrei Emeltchenko
5af8d164ac
android: Create debug hal-utils helpers
...
Create hal-utils helpers which helps to decode packets Android
sends through HAL interface.
2013-11-08 15:40:25 +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
cb54bd85e9
android/hid: Fill send data command struct in hal-hidhost
2013-11-08 15:28:17 +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
20a830495f
android/hid: Fill send data command struct in hal-hidhost
2013-11-08 15:23:31 +02:00
Jerzy Kasenberg
fcd2812197
android/client: Add ssp key confirmation helper
...
This patch adds handling of ssp_request_cb that prints prompt
asking user if pass key matches. User does not need to type:
bluetooth ssp_reply address BT_SSP_VARIANT_PASSKEY_CONFIRMATION 1 key
2013-11-08 15:13:06 +02:00
Jerzy Kasenberg
72c31efadf
android/client: Add pin handling for bind
...
This patch ask user for ping in pin_request_cb, which does
what otherwise would be required to manually type
bluetooth pin_reply address pin.
2013-11-08 15:13:04 +02:00
Jerzy Kasenberg
037632dc24
android/client: Add prompting for answer
...
This patch allows to switch to prompt mode where user will be asked
to supply some information.
2013-11-08 15:13:03 +02:00
Jerzy Kasenberg
b07cff3c6b
android/client: Split terminal_process_char
...
This patch changes the way input characters are handled in function
terminal_process_char from big switch statement to smaller functions.
No functionality is changed in this patch.
Splitting to smaller functions will make easier to change behaviour
of terminal for prompt handling when user will be asked for something
and history substitution or auto completion will not be used.
2013-11-08 15:13:01 +02:00
Jerzy Kasenberg
316ddc8b96
android/client: Add command line arguments
...
This patch adds command line argument parsing.
Options added:
-h, --help
-n, --no-init - disable initialization of interfaces
--version
2013-11-08 15:13:00 +02:00
Jerzy Kasenberg
df3b6c7dc0
android/client: Initialize all interfaces at start
...
Patch adds function that initializes all HAL interfaces.
2013-11-08 15:12:58 +02:00
Jerzy Kasenberg
464d9b64af
android/client: Add NELEM macro for count elements
...
NELEM macro will be used in several places.
2013-11-08 15:12:57 +02:00
Jerzy Kasenberg
507c457d3c
android/client: Export get_interface_method
...
This method will be used outside tab completion.c.
2013-11-08 15:12:55 +02:00
Marcin Kraglak
d5932ba1e6
android: Fix PAN service registration
...
A2DP service was registered instead of PAN.
2013-11-08 12:46:03 +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
Andrei Emeltchenko
79e90ad1b5
android/ipc: Fix crash when sending file descriptor
...
Since CMSG_FIRSTHDR is defined as shown below:
((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
it return NULL if msg_controllen is not defined. Accessing
that pointer result in daemon crash.
2013-11-08 11:00:49 +02:00
Ravi kumar Veeramally
c7d4ffd327
android/hid: Handle virtual unplug notification in HID HAL
2013-11-08 10:37:39 +02:00
Ravi kumar Veeramally
70a7c773c8
android/hid: Add hid event virtual unplug structure to HAL msg headers
2013-11-08 10:30:26 +02:00
Ravi kumar Veeramally
3e60caf677
android/hid: Add missing parameters in send data struct in HAL headers
2013-11-08 10:29:37 +02:00
Ravi kumar Veeramally
f180e868c4
android/hid: Add missing hid send data parameters in ipc document
2013-11-08 10:29:21 +02:00
Ravi kumar Veeramally
9f35898555
android/hid: Remove fixed number of hid set report data length in ipc doc
...
HAL receives data in ascii format but it should be in hex format. So remove
fixed size of report data length and depend on report length parameter.
2013-11-08 10:29:06 +02:00
Johan Hedberg
49f051b6b6
android: Remove unnecessary allocations of fixed-size buffers
2013-11-07 22:39:26 +02:00
Jakub Tyszkowski
5965a309ea
android: Fix sending remote device name property
...
Android use the full string returned even if terminated with '\0'.
2013-11-07 21:50:14 +02:00
Jakub Tyszkowski
229d416ed6
android: Remove redundant command complete callback
...
This patch removes command complete callback used only for verbose error
reporting.
2013-11-07 21:49:09 +02:00
Szymon Janc
bdbe86efab
android/hal: Use hidhost instead of hh in hidhost HAL
...
Match functions names to HAL name. Where not needed hh prefix is
removed.
2013-11-07 18:45:06 +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
Szymon Janc
5ca1face1a
android: Rename hidhost HAL related IPC API to match service name
...
Use 'Android HAL name' string from IPC doc as base for names.
2013-11-07 18:44:35 +02:00
Lukasz Rymanowski
d0da2fb3d8
android: Add set/get for discovery timeout
...
Android handles discoverable timeout in Settings app, however still
expects BT stack to maintain this value so we should do it as well.
Otherwise we will get some unexpected behaviour. For now we keep
discovery_timeout only during runtime, but we need to move it to some
local storage once we will have it.
Note: That since Android Settings up handles timer there is no reason to
use discovery timer we have in kernel.
2013-11-07 18:42:10 +02:00
Szymon Janc
931eb9f16d
android/hal: Use a2dp instead of av in a2dp HAL
...
Match functions names to HAL name. Where not needed av prefix is
removed.
2013-11-07 17:59:01 +02:00
Szymon Janc
f42a2bafa3
android/hal: Rename hal-av.c to hal-a2dp.c
...
Name of HAL 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 17:58:54 +02:00
Szymon Janc
d842e88a47
android: Rename a2dp HAL related IPC API to match service name
...
Use 'Android HAL name' string from IPC doc as base for names.
2013-11-07 17:58:39 +02:00
Andrei Emeltchenko
14924cd24b
android/ipc: Fix receiving file descriptors
...
It does make sense iterate over !NULL controll headers. This fixes
the bug that file descriptors cannot be send over IPC.
2013-11-07 17:14:15 +02:00
Lukasz Rymanowski
817177ef1d
android: Use BASELEN define for property changed
2013-11-07 17:07:24 +02:00
Szymon Janc
fd02ec9d91
android: Use payload member to access message data
...
This make it similar to other places in code.
2013-11-07 17:06:05 +02:00
Szymon Janc
fb1e40d65c
android: Remove includes from adapter.h
...
This is internal header and dependencies should be included in
respective .c files.
2013-11-07 17:05:57 +02:00
Szymon Janc
052e481adc
android: Pass notification socket fd to service handlers
...
IPC helpers were converted to accept socket, not GIOChannel so there
is no need of passing former to handlers.
2013-11-07 17:05:47 +02:00
Szymon Janc
32f29761bf
android: Make IPC helpers accept file descriptor
...
There is no need to pass GIOChannel as writes are done immediately.
2013-11-07 17:05:07 +02:00
Andrei Emeltchenko
718032446a
android/hal: Rename hal_op_sock_listen to hal_cmd_sock_listen
...
This makes structures consistent with the rest of the code.
2013-11-07 10:09:54 +02:00
Andrei Emeltchenko
20002d0a37
android/hal-sock: Check socket type in connect
...
Only RFCOMM sockets are supported in Android.
2013-11-07 10:09:40 +02:00
Lukasz Rymanowski
dfe8ac32fd
android: Change name for get_disc_timeout
...
Change name to get_discoverable_timeout. Previous name could be
confusing with disconnection timeout.
2013-11-07 10:08:05 +02:00
Johan Hedberg
48eb05b0b0
android: Remove useless device.{c,h} files
2013-11-06 16:39:55 +02:00
Marcin Kraglak
645da8e857
android: Implement class of device property callback
...
This will send adapter property with class of device
to notification socket.
2013-11-06 13:32:07 +02:00
Johan Hedberg
63d32200d3
android: Fix struct variable alignments in IPC header
2013-11-06 10:35:58 +02:00
Johan Hedberg
9d4ec54095
android/hid: Fix unnecessary second check for cmd->buf_size value
2013-11-06 10:33:31 +02:00
Johan Hedberg
b8bc9c1b27
android/hid: Fix get report buffer size variable name
2013-11-06 10:31:31 +02:00
Johan Hedberg
9af81f5b9e
android/hid: Fix camelcase variable names
2013-11-06 10:29:25 +02:00
Ravi kumar Veeramally
ff8dad2942
android/hid: Align hal hid struct variables properly
2013-11-06 10:27:10 +02:00
Ravi kumar Veeramally
8c7daf5389
android/hid: Handle uhid events
...
Handling few uhid events and described scenarios. OUTPUT and
FEATURE events are not yet handled.
2013-11-06 10:26:58 +02:00
Ravi kumar Veeramally
1aee093b3e
android/hid: Handle invalid parameters in HAL
2013-11-06 10:26:36 +02:00
Ravi kumar Veeramally
aac7c55133
android/hid: Replace header checking magic number with defines
2013-11-06 10:26:25 +02:00
Ravi kumar Veeramally
62fe761a72
android/hid: Handle get report notification in HAL
2013-11-06 10:26:16 +02:00
Ravi kumar Veeramally
a74dec7475
android/hid: Implement hid set report in daemon
...
This patch requests hid device to set report.
2013-11-06 10:25:13 +02:00
Ravi kumar Veeramally
93f04d5a33
android/hid: Add missing set report parameters to ipc document
2013-11-06 10:24:43 +02:00
Ravi kumar Veeramally
e8b0c8f13d
android/hid: Implement hid get report in daemon
...
This patch requests hid device report and reads reply
message and sends notification to HAL.
2013-11-06 10:18:01 +02:00
Ravi kumar Veeramally
125099108f
android/hid: Add hid event get report structure to HAL msg headers
2013-11-06 10:17:52 +02:00
Ravi kumar Veeramally
868e069fc1
android/hid: Handle protocol mode notification in HAL
2013-11-06 10:17:23 +02:00
Ravi kumar Veeramally
bf0031a50b
android/hid: Implement hid set protocol in daemon
...
This patch requests hid device to set protocol mode and reads
reply message and sends notification to HAL.
2013-11-06 10:16:41 +02:00
Ravi kumar Veeramally
176ac66b0c
android/hid: Implement hid get protocol in daemon
...
This patch requests hid device protocol mode and reads reply
message and sends notification to HAL.
2013-11-06 10:15:46 +02:00
Johan Hedberg
80a2ea61f2
android: Use more common 'failed' label instead of 'error'
2013-11-06 10:12:13 +02:00
Szymon Janc
40fb9b2032
android: Add option to specify controller index to use
...
This will be usefull while testing on Linux where more controllers
can be present.
2013-11-06 10:10:14 +02:00
Szymon Janc
6dc9321e2e
android: Stop mainloop if reading index list failed
...
If reading index list failed mainloop should be stopped since adapter
init guard timer is not yet running.
2013-11-06 10:08:15 +02:00
Szymon Janc
8a98e083b8
android: Stop mainloop if reading version failed
...
If reading mgmt version failed or kernel supported version is to old
mainloop should be stopped.
2013-11-06 10:07:54 +02:00
Szymon Janc
81c0c34ef6
android: Remove mgmt_version and mgmt_revision static variables
...
There is no need to keep those as Android daemon is expecting new
enough kernel to operate.
2013-11-06 10:07:47 +02:00
Szymon Janc
9d89bb121b
android: Require at least 1.3 version of mgmt interface
...
Android daemon is not providing old kernels compatibility features.
2013-11-06 10:07:37 +02:00
Marcin Kraglak
c17cf38ecf
android: Pass found uuids to remote_device_properties_cb
...
Send remote device's uuids in remote_device_properties_cb.
This patch will pack found uuids to buffer containing property
with list of uuids and send it to notification socket.
2013-11-05 18:23:03 +02:00
Marcin Kraglak
4b9e1d80a9
android: Fetch remote device uuids after pairing
...
Android framework expects list of bonded device's uuids.
Start sdp query after setting bond state to BOND_STATE_BONBED.
2013-11-05 18:22:40 +02:00
Marcin Kraglak
1ee0b2f9f9
android: Initial implementation of get_remote_services
...
This patch implements method to retrieve remote device sdp records.
Caching struct is implemented for adding fetched uuids to list.
sdp_req_list will contain list of devices which are asked for records.
Function get_remote_services will check if device is on list, and will
start sdp procedure.
2013-11-05 18:20:46 +02:00
Luiz Augusto von Dentz
cd8bbd29f4
android/hid: Fix passing wrong adapter address to bt_io_listen
2013-11-05 15:21:27 +02:00
Jerzy Kasenberg
ef0609cc15
android/client: Fix build for android 4.3
...
Chagnes in HAL interface from 4.3 to 4.4 result in build failure:
target thumb C: haltest <=
external/bluetooth/bluez/android/client/if-gatt.c
external/bluetooth/bluez/android/client/if-gatt.c:225:1:
error: unknown type name 'btgatt_gatt_id_t'
This patch allows to build GATT for Android 4.3 (api level 18).
2013-11-05 14:55:37 +02:00
Ravi kumar Veeramally
5de2f26a11
android/hid: Add hid event proto mode structure to hal msg headers
2013-11-05 14:52:34 +02:00