Commit Graph

85 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
8faada31a6 android/avrcp-lib: Add support for parsing GetCapabilities PDU 2014-03-17 14:53:32 +02:00
Luiz Augusto von Dentz
b67d790e51 android/avrcp-lib: Change API to register callbacks instead of PDU handlers
This adds avrcp_register_player function to register callbacks for
requests and responses, the fundamental difference is that the
callbacks are called after the original PDU is parsed and the parameter
are converted to host byte order making us able to unit test the
parsing itself.
2014-03-17 14:53:32 +02:00
Andrei Emeltchenko
981d27fc93 android/avrcp: Add avrcp_set_addressed_player() function 2014-03-13 13:20:33 +02:00
Andrei Emeltchenko
b2f7927776 android/avrcp: Add avrcp_send_passthrough function
This function allows to send AVRCP vendor unique commands.
2014-03-13 13:07:44 +02:00
Andrei Emeltchenko
55899e97d4 android/avrcp: Add avrcp_get_element_attributes() function 2014-03-10 14:20:51 +02:00
Luiz Augusto von Dentz
29f45ef1da android/avrcp-lib: Add avrcp_set_volume function
This adds avrcp_set_volume function which can be used to send
SetAbsoluteVolume PDUs.
2014-03-07 23:23:39 +02:00
Luiz Augusto von Dentz
039f4e9a41 android/avrcp-lib: Add avrcp_register_notification function
This adds avrcp_register_notification which can be used to send
RegisterNotification PDUs.
2014-03-07 23:23:39 +02:00
Andrei Emeltchenko
e0497dd8ce android/avrcp: Add avrcp_get_play_status() function 2014-03-06 17:36:10 +02:00
Luiz Augusto von Dentz
acf7c2a966 android/avrcp-lib: Move command functions together 2014-03-05 10:28:37 +02:00
Andrei Emeltchenko
a6a224592d android/avrcp: Add avrcp_set_player_value() function 2014-03-05 10:28:36 +02:00
Andrei Emeltchenko
47c5cd74a4 android/avrcp: Add avrcp_get_current_player_value() function 2014-03-05 10:28:36 +02:00
Luiz Augusto von Dentz
f50ec3dadd android/avrcp-lib: Add avrcp_register_notification_rsp function
This function can be used to generate RegisterNotification response PDUs.
2014-03-04 11:32:44 +02:00
Luiz Augusto von Dentz
bcc3728974 android/avrcp-lib: Add avrcp_get_element_attrs_rsp function
This function can be used to generate GetElementAttributes response PDUs.
2014-03-04 11:32:43 +02:00
Luiz Augusto von Dentz
5dce69dd21 android/avrcp-lib: Add avrcp_get_play_status_rsp function
This function can be used to generate GetPlayStatus response PDUs.
2014-03-04 11:32:43 +02:00
Luiz Augusto von Dentz
44b0c9f1ed android/avrcp-lib: Make IEEEID_BTSIG public 2014-03-04 11:32:43 +02:00
Luiz Augusto von Dentz
ccebe1ffa1 android/avrcp-lib: Make hton24 and ntoh24 public
This avoids duplicating those function everytime.
2014-03-04 11:32:43 +02:00
Luiz Augusto von Dentz
b82332a07a android/avrcp-lib: Add pressed status to passthrough handler callback
This adds pressed status to passthrough handler callback which is
required by Android HAL for certain keys such as fast forward and rewind.
2014-03-04 11:32:43 +02:00
Luiz Augusto von Dentz
6727058328 android/avrcp-lib: Fix not passing user data of passthrough callback 2014-03-04 11:32:42 +02:00
Luiz Augusto von Dentz
9350da3d4d android/avrcp-lib: Embed response code into handler table
This makes the handlers code simpler as they don't need to care about
the response or reject opcode.
2014-03-04 11:32:42 +02:00
Luiz Augusto von Dentz
024b631ad0 android/avrcp-lib: Rework handler callback parameters
This rework handler callback parameters to make it able to return
proper error such as -EAGAIN to implement asynchronous responses.
2014-03-04 11:32:42 +02:00
Luiz Augusto von Dentz
7efeeb014e android/avctp: Make handler return ssize_t
This makes possible to return errors such as -EAGAIN to indicate the
request would block and a response will be sent asynchronously.
2014-03-04 11:32:42 +02:00
Luiz Augusto von Dentz
ec6e9a9e13 android/avrcp-lib: Add avrcp_send function
This adds avrcp_send function which can be used to response to
outstanding requests.
2014-03-04 11:32:42 +02:00
Szymon Janc
4262d6e10f android/avrcp-lib: Fix destroy callback handling
AVRCP destroy callback was directly passed as AVCTP destroy callback
resulting in struct avrcp not being freed on remote disconnect.

This fix following Valgrind report:

931 (36 direct, 895 indirect) bytes in 1 blocks are definitely lost in
     loss record 53 of 55
   at 0x4896DC8: calloc (in /system/lib/valgrind/
     vgpreload_memcheck-arm-linux.so)
   by 0x48C5DB7: g_malloc0 (gmem.c:189)
   by 0x118671: avrcp_new (avrcp-lib.c:219)
   by 0x117D4F: connect_cb (avrcp.c:346)
   by 0x12068B: connect_cb (btio.c:232)
   by 0x48BD9C7: g_io_unix_dispatch (giounix.c:166)
   by 0x48C2CCB: g_main_context_dispatch (gmain.c:2539)
   by 0x48C2ED9: g_main_context_iterate.isra.19 (gmain.c:3146)
   by 0x48C3167: g_main_loop_run (gmain.c:3340)
   by 0x10BA03: main (main.c:490)
2014-03-03 16:11:18 +02:00
Szymon Janc
c9f5b795cc android/avrcp-lib: Fix not freeing tx buffer on AVRCP shutdown 2014-03-03 11:12:46 +02:00
Marcel Holtmann
537dba6265 android: Fix ntoh24 and hton24 for big endian platforms 2014-03-01 12:01:21 -08:00
Andrei Emeltchenko
b0d2871a18 android/avrcp: Implement get player attributes text 2014-02-28 11:02:15 +02:00
Andrei Emeltchenko
2fdd6528a5 android/avrcp: Add list player attributes command 2014-02-28 11:02:15 +02:00
Andrei Emeltchenko
c1977e7f3c android/avrcp: Refactor get_caps() to allow parameter
Allow passing parameter specifying capability ID.
2014-02-28 10:59:00 +02:00
Andrei Emeltchenko
99af839d74 android/avrcp: Fix passing wrong len
When handling vendor dependent PDUs len was passed in wrong order to
callback function. It is really wrong to pass such a parameter and
expect that callbacks would handle it.
2014-02-26 18:26:04 +01:00
Andrei Emeltchenko
0da74a1afc unit/avrcp: Add /TP/CFG/BV-02-C test
Test verifies that the Target responds to Get Capability request.
2014-02-26 18:26:04 +01:00
Andrei Emeltchenko
ded70b727e android/avrcp: Add avrcp_get_capabilities request
Implement avrcp_get_capabilities() request through
avrcp_send_vendordep_req(). avctp_send_req() is not exported so we use
the functions which are exported by AVCTP code.
2014-02-26 18:26:03 +01:00
Luiz Augusto von Dentz
3dd85709ac android/avrcp-lib: Add avrcp_set_passthrough_handlers
This adds avrcp_set_passthrough_handlers which can be used to set
pass-through PDU handlers table and user data.
2014-02-24 13:34:18 +01:00
Luiz Augusto von Dentz
8656a965de android/avrcp-lib: Add avrcp_set_control_handlers
This adds avrcp_set_control_handlers which can be used to set control
PDU handlers table and user data.
2014-02-24 13:33:59 +01:00
Luiz Augusto von Dentz
2b0a3f5c7c android/avrcp-lib: Rename AVCTP session to conn 2014-02-24 13:33:51 +01:00
Andrei Emeltchenko
4351d46804 android: Add initial AVRCP common code
The patch makes AVRCP to be transport agnostic so that it can be used in
with socket pair to build unit tests.

The idea is that all AVRCP specific logic will stay on avrcp-lib until it
receives proper unit tests and then eventually will be used by audio
plugin as well.
2014-02-20 13:57:55 +02:00