Commit Graph

32 Commits

Author SHA1 Message Date
Andrei Emeltchenko
b3c8fbbb66 android/socket: Make profile struct const
We are not supposed to change profile structure, make it const.
2013-11-26 17:43:27 +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
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
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
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
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
7d777eda20 android/socket: Use static local adapter address 2013-11-18 10:42:37 +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
Luiz Augusto von Dentz
d661ba725c android: Add the missing HAVE_CONFIG_H check daemon files 2013-11-04 12:10:31 +02:00
Luiz Augusto von Dentz
bcbbe2d1f3 android/socket: Log not implemented HAL functions
This makes it easier to spot which functions the HAL is calling.
2013-11-01 16:40:40 +02:00
Marcin Kraglak
a56aeec37d android: Initial implementation of socket interface
Add stub implementation of socket interace on daemon side.
2013-10-31 10:30:00 +02:00
Szymon Janc
9f696ad971 android: Add initial code for socket service
Only handle register/unregister for now.
2013-10-23 14:26:40 +03:00