summaryrefslogtreecommitdiff
path: root/android/hal-avrcp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-02-19 18:58:49 +0200
committerSzymon Janc <szymon.janc@gmail.com>2014-02-19 19:17:15 +0100
commit5aa5117647fc4bea877079bdbafb0044c8c3c74a (patch)
treeba3bdc31013a5f825be21f1a354754c782c2686b /android/hal-avrcp.c
parent604acf4a34778c5e6eaf304986a78bd35485161b (diff)
downloadbluez-5aa5117647fc4bea877079bdbafb0044c8c3c74a.tar.gz
android/hal-avrcp: Add .list_player_app_attr_rsp implementation
Diffstat (limited to 'android/hal-avrcp.c')
-rw-r--r--android/hal-avrcp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/android/hal-avrcp.c b/android/hal-avrcp.c
index 9937a1137..9735c2278 100644
--- a/android/hal-avrcp.c
+++ b/android/hal-avrcp.c
@@ -18,6 +18,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
+#include <stdlib.h>
#include "hal-log.h"
#include "hal.h"
@@ -74,6 +75,33 @@ static bt_status_t get_play_status_rsp(btrc_play_status_t status,
sizeof(cmd), &cmd, 0, NULL, NULL);
}
+static bt_status_t list_player_app_attr_rsp(int num_attr,
+ btrc_player_attr_t *p_attrs)
+{
+ char buf[BLUEZ_HAL_MTU];
+ struct hal_cmd_avrcp_list_player_attrs *cmd = (void *) buf;
+ size_t len;
+
+ DBG("");
+
+ if (!interface_ready())
+ return BT_STATUS_NOT_READY;
+
+ if (num_attr < 0)
+ return BT_STATUS_PARM_INVALID;
+
+ len = sizeof(*cmd) + num_attr;
+ if (len > BLUEZ_HAL_MTU)
+ return BT_STATUS_PARM_INVALID;
+
+ cmd->number = num_attr;
+ memcpy(cmd->attrs, p_attrs, num_attr);
+
+ return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP,
+ HAL_OP_AVRCP_LIST_PLAYER_ATTRS,
+ len, cmd, 0, NULL, NULL);
+}
+
static void cleanup()
{
struct hal_cmd_unregister_module cmd;
@@ -97,6 +125,7 @@ static btrc_interface_t iface = {
.size = sizeof(iface),
.init = init,
.get_play_status_rsp = get_play_status_rsp,
+ .list_player_app_attr_rsp = list_player_app_attr_rsp,
.cleanup = cleanup
};