Skip to contentSkip to conversation

android/hal-ipc-api: Add Get Play Status Response

PATCH In review Luiz Augusto von Dentz 2 participants 10 messages Feb 12, 2014 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/9 android/hal-ipc-api: Add Get Play Status Response

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 30 +++++++++++++++++++++++++++++-
 android/hal-msg.h       | 16 ++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +29 -1
index ad5d192..01c2e81 100644
@@ -1174,7 +1174,35 @@ Bluetooth Remote Control HAL (ID 8)
 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 	Opcode 0x00 - Error response
-	Opcode 0x01 - Get Play Status command/response
+
+		Response parameters: Status (1 octet)
+
+		Valid status values: 0x01 = Fail
+		                     0x02 = Not ready
+		                     0x03 = No memory
+		                     0x04 = Busy
+		                     0x05 = Done (already completed)
+		                     0x06 = Unsupported
+		                     0x07 = Parameter invalid
+		                     0x08 = Unhandled
+		                     0x09 = Authentication failure
+		                     0x0a = Remote device down
+
+	Opcode 0x01 - Get Play Status Response command/response
+
+		Command parameters: Status (1 octet)
+		                    Duration (4 octets)
+		                    Position (4 octets)
+
+		In case of an error, the error response will be returned.
+
+		Valid status values: 0x00 = Stopped
+		                     0x01 = Playing
+		                     0x02 = Paused
+		                     0x03 = Fwd seek
+		                     0x04 = Rev seek
+		                     0xff = Error
+
 	Opcode 0x02 - List Player Application Attributes command/response
 	Opcode 0x03 - List Player Application Values command/response
 	Opcode 0x04 - Get Player Application Values command/response
android/hal-msg.h +16 -0
index 6ef00f9..82cd3f5 100644
@@ -783,3 +783,19 @@ struct hal_ev_handsfree_unknown_at {
 } __attribute__((packed));
 
 #define HAL_EV_HANDSFREE_HSP_KEY_PRESS	0x90
+
+/* AVRCP HAL API */
+
+#define HAL_AVRCP_PLAY_STATUS_STOPPED	0x00
+#define HAL_AVRCP_PLAY_STATUS_PLAYING	0x01
+#define HAL_AVRCP_PLAY_STATUS_PAUSED	0x02
+#define HAL_AVRCP_PLAY_STATUS_FWD_SEEK	0x03
+#define HAL_AVRCP_PLAY_STATUS_REV_SEEK	0x04
+#define HAL_AVRCP_PLAY_STATUS_ERROR	0xff
+
+#define HAL_OP_AVRCP_GET_PLAY_STATUS	0x01
+struct hal_cmd_avrcp_get_play_status {
+	uint8_t status;
+	uint32_t duration;
+	uint32_t position;
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#1 lore raw

PATCH 2/9 android/hal-ipc-api: Add List Player Attributes Response

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 14 +++++++++++++-
 android/hal-msg.h       | 11 +++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +13 -1
index 01c2e81..ae58fda 100644
@@ -1203,7 +1203,19 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 		                     0x04 = Rev seek
 		                     0xff = Error
 
-	Opcode 0x02 - List Player Application Attributes command/response
+	Opcode 0x02 - List Player Attributes Response command/response
+
+		Command parameters: Number of attributes (1 octet)
+		                    Attribute # (1 octet)
+		                    ...
+
+		In case of an error, the error response will be returned.
+
+		Valid attributes: 0x01 = Equalizer
+		                  0x02 = Repead
+		                  0x03 = Shuffle
+		                  0x04 = Scan
+
 	Opcode 0x03 - List Player Application Values command/response
 	Opcode 0x04 - Get Player Application Values command/response
 	Opcode 0x05 - Get Player Application Attributes Text command/response
android/hal-msg.h +11 -0
index 82cd3f5..4a438d1 100644
@@ -799,3 +799,14 @@ struct hal_cmd_avrcp_get_play_status {
 	uint32_t duration;
 	uint32_t position;
 } __attribute__((packed));
+
+#define HAL_AVRCP_PLAYER_ATTR_EQUALIZER	0x01
+#define HAL_AVRCP_PLAYER_ATTR_REPEAT	0x02
+#define HAL_AVRCP_PLAYER_ATTR_SHUFFLE	0x03
+#define HAL_AVRCP_PLAYER_ATTR_SCAN	0x04
+
+#define HAL_OP_AVRCP_LIST_PLAYER_ATTRS	0x02
+struct hal_cmd_avrcp_list_player_attrs {
+	uint8_t number;
+	uint8_t attrs[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#2 lore raw

PATCH 3/9 android/hal-ipc-api: Add List Player Values Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 9 ++++++++-
 android/hal-msg.h       | 6 ++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +8 -1
index ae58fda..2e4ecbe 100644
@@ -1216,7 +1216,14 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 		                  0x03 = Shuffle
 		                  0x04 = Scan
 
-	Opcode 0x03 - List Player Application Values command/response
+	Opcode 0x03 - List Player Values Response command/response
+
+		Command parameters: Number of values (1 octet)
+		                    Value # (1 octet)
+		                    ...
+
+		In case of an error, the error response will be returned.
+
 	Opcode 0x04 - Get Player Application Values command/response
 	Opcode 0x05 - Get Player Application Attributes Text command/response
 	Opcode 0x06 - Get Player Application Values Text command/response
android/hal-msg.h +6 -0
index 4a438d1..2dcdafc 100644
@@ -810,3 +810,9 @@ struct hal_cmd_avrcp_list_player_attrs {
 	uint8_t number;
 	uint8_t attrs[0];
 } __attribute__((packed));
+
+#define HAL_OP_AVRCP_LIST_PLAYER_VALUES	0x03
+struct hal_cmd_avrcp_list_player_values {
+	uint8_t number;
+	uint8_t values[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#3 lore raw

PATCH 4/9 android/hal-ipc-api: Add Get Player Attributes Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 12 +++++++++++-
 android/hal-msg.h       | 11 +++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +11 -1
index 2e4ecbe..27060d5 100644
@@ -1224,7 +1224,17 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 		In case of an error, the error response will be returned.
 
-	Opcode 0x04 - Get Player Application Values command/response
+	Opcode 0x04 - Get Player Values Response command/response
+
+		Command parameters: Number of attributes (1 octet)
+		                    Attribute # (1 octet)
+		                    Value # (1 octet)
+		                    ...
+
+		In case of an error, the error response will be returned.
+
+		Valid attributes: Same as in List Player Attributes
+
 	Opcode 0x05 - Get Player Application Attributes Text command/response
 	Opcode 0x06 - Get Player Application Values Text command/response
 	Opcode 0x07 - Get Element Attributes Text command/response
android/hal-msg.h +11 -0
index 2dcdafc..753f5a3 100644
@@ -816,3 +816,14 @@ struct hal_cmd_avrcp_list_player_values {
 	uint8_t number;
 	uint8_t values[0];
 } __attribute__((packed));
+
+struct hal_avrcp_player_attr_value {
+	uint8_t attr;
+	uint8_t value;
+} __attribute__((packed));
+
+#define HAL_OP_AVRCP_GET_PLAYER_ATTRS	0x04
+struct hal_cmd_avrcp_get_player_attrs {
+	uint8_t number;
+	struct hal_avrcp_player_attr_value attrs[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#4 lore raw

PATCH 5/9 android/hal-ipc-api: Add Get Player Attributes Text Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 13 ++++++++++++-
 android/hal-msg.h       | 11 +++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +12 -1
index 27060d5..496851c 100644
@@ -1235,7 +1235,18 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 		Valid attributes: Same as in List Player Attributes
 
-	Opcode 0x05 - Get Player Application Attributes Text command/response
+	Opcode 0x05 - Get Player Attributes Text Response command/response
+
+		Command parameters: Number of attributes (1 octet)
+		                    Attribute # (1 octet)
+		                    Attribute # text length (1 octet)
+		                    Attribute # text (variable)
+		                    ...
+
+		In case of an error, the error response will be returned.
+
+		Valid attributes: Same as in List Player Attributes
+
 	Opcode 0x06 - Get Player Application Values Text command/response
 	Opcode 0x07 - Get Element Attributes Text command/response
 	Opcode 0x08 - Set Player Attributes Value command/response
android/hal-msg.h +11 -0
index 753f5a3..2891a3a 100644
@@ -827,3 +827,14 @@ struct hal_cmd_avrcp_get_player_attrs {
 	uint8_t number;
 	struct hal_avrcp_player_attr_value attrs[0];
 } __attribute__((packed));
+
+struct hal_avrcp_player_setting_text {
+	uint8_t id;
+	uint8_t text[255];
+} __attribute__((packed));
+
+#define HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT	0x05
+struct hal_cmd_avrcp_get_player_attrs_text {
+	uint8_t number;
+	struct hal_avrcp_player_setting_text attrs[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#5 lore raw

PATCH 6/9 android/hal-ipc-api: Add Get Player Values Text Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 10 +++++++++-
 android/hal-msg.h       |  6 ++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +9 -1
index 496851c..c8f5557 100644
@@ -1247,7 +1247,15 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 		Valid attributes: Same as in List Player Attributes
 
-	Opcode 0x06 - Get Player Application Values Text command/response
+	Opcode 0x06 - Get Player Values Text Response command/response
+
+		Command parameters: Number of values (1 octet)
+		                    Value # (1 octet)
+		                    Value # text (255 octets)
+		                    ...
+
+		In case of an error, the error response will be returned.
+
 	Opcode 0x07 - Get Element Attributes Text command/response
 	Opcode 0x08 - Set Player Attributes Value command/response
 	Opcode 0x09 - Register Notification command/response
android/hal-msg.h +6 -0
index 2891a3a..280c28c 100644
@@ -838,3 +838,9 @@ struct hal_cmd_avrcp_get_player_attrs_text {
 	uint8_t number;
 	struct hal_avrcp_player_setting_text attrs[0];
 } __attribute__((packed));
+
+#define HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT	0x06
+struct hal_cmd_avrcp_get_player_values_text {
+	uint8_t number;
+	struct hal_avrcp_player_setting_text values[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#6 lore raw

PATCH 7/9 android/hal-ipc-api: Add Get Element Attributes Text Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 19 +++++++++++++++++--
 android/hal-msg.h       | 14 ++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)
android/hal-ipc-api.txt +17 -2
index c8f5557..7c90928 100644
@@ -1256,8 +1256,23 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 		In case of an error, the error response will be returned.
 
-	Opcode 0x07 - Get Element Attributes Text command/response
-	Opcode 0x08 - Set Player Attributes Value command/response
+	Opcode 0x07 - Get Element Attributes Text Response command/response
+
+		Command parameters: Number of elements (1 octet)
+		                    Element # (1 octet)
+		                    Element # text (255 octets)
+		                    ...
+
+		In case of an error, the error response will be returned.
+
+		Valid elements: 0x01 = Title
+		                0x02 = Artist
+		                0x03 = Album
+		                0x04 = Track Number
+		                0x05 = Number of Tracks
+		                0x06 = Genre
+		                0x06 = Duration
+
 	Opcode 0x09 - Register Notification command/response
 
 	Opcode 0x81 - Get Play Status notification
android/hal-msg.h +14 -0
index 280c28c..9f3c2a1 100644
@@ -844,3 +844,17 @@ struct hal_cmd_avrcp_get_player_values_text {
 	uint8_t number;
 	struct hal_avrcp_player_setting_text values[0];
 } __attribute__((packed));
+
+#define HAL_AVRCP_MEDIA_ATTR_TITLE		0x01
+#define HAL_AVRCP_MEDIA_ATTR_ARTIST		0x02
+#define HAL_AVRCP_MEDIA_ATTR_ALBUM		0x03
+#define HAL_AVRCP_MEDIA_ATTR_TRACK_NUM		0x04
+#define HAL_AVRCP_MEDIA_ATTR_NUM_TRACKS		0x05
+#define HAL_AVRCP_MEDIA_ATTR_GENRE		0x06
+#define HAL_AVRCP_MEDIA_ATTR_DURATION		0x07
+
+#define HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT	0x07
+struct hal_cmd_avrcp_get_element_attrs_text {
+	uint8_t number;
+	struct hal_avrcp_player_setting_text values[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#7 lore raw

PATCH 8/9 android/hal-ipc-api: Add Set Player Attributes Value Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 8 ++++++++
 android/hal-msg.h       | 5 +++++
 2 files changed, 13 insertions(+)
android/hal-ipc-api.txt +8 -0
index 7c90928..b977957 100644
@@ -1273,6 +1273,14 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 		                0x06 = Genre
 		                0x06 = Duration
 
+	Opcode 0x08 - Set Player Attributes Value Response command/response
+
+		Command parameters: Status (1 octet)
+
+		In case of an error, the error response will be returned.
+
+		Valid status values: Same as in Get Play Status Response
+
 	Opcode 0x09 - Register Notification command/response
 
 	Opcode 0x81 - Get Play Status notification
android/hal-msg.h +5 -0
index 9f3c2a1..42b08cd 100644
@@ -858,3 +858,8 @@ struct hal_cmd_avrcp_get_element_attrs_text {
 	uint8_t number;
 	struct hal_avrcp_player_setting_text values[0];
 } __attribute__((packed));
+
+#define HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE	0x08
+struct hal_cmd_avrcp_set_player_attrs_value {
+	uint8_t status;
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
author maintainer
#8 lore raw

PATCH 9/9 android/hal-ipc-api: Add Register Notification Response

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 19 ++++++++++++++++++-
 android/hal-msg.h       | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +18 -1
index b977957..c1609c9 100644
@@ -1281,7 +1281,24 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 		Valid status values: Same as in Get Play Status Response
 
-	Opcode 0x09 - Register Notification command/response
+	Opcode 0x09 - Register Notification Response command/response
+
+		Command parameters: Event (1 octet)
+		                    Type (1 octet)
+		                    Data length (1 octet)
+		                    Data (variable)
+
+		In case of an error, the error response will be returned.
+
+		Valid event values: 0x01 = Status Changed
+		                    0x02 = Track Changed
+		                    0x03 = Track Reached End
+		                    0x04 = Track Reached Start
+		                    0x05 = Position Changed
+		                    0x08 = Setting Changed
+
+		Valid type values : 0x00 = Interim
+		                    0x01 = Changed
 
 	Opcode 0x81 - Get Play Status notification
 	Opcode 0x82 - List Player Application Attributes notification
android/hal-msg.h +18 -0
index 42b08cd..ca1f6b5 100644
@@ -863,3 +863,21 @@ struct hal_cmd_avrcp_get_element_attrs_text {
 struct hal_cmd_avrcp_set_player_attrs_value {
 	uint8_t status;
 } __attribute__((packed));
+
+#define HAL_AVRCP_EVENT_STATUS_CHANGED		0x01
+#define HAL_AVRCP_EVENT_TRACK_CHANGED		0x02
+#define HAL_AVRCP_EVENT_TRACK_REACHED_END	0x03
+#define HAL_AVRCP_EVENT_TRACK_REACHED_START	0x04
+#define HAL_AVRCP_EVENT_POSITION_CHANGED	0x05
+#define HAL_AVRCP_EVENT_SETTING_CHANGED		0x08
+
+#define HAL_AVRCP_EVENT_TYPE_INTERIM		0x00
+#define HAL_AVRCP_EVENT_TYPE_CHANGED		0x01
+
+#define HAL_OP_AVRCP_REGISTER_NOTIFICATION	0x09
+struct hal_cmd_avrcp_register_notification {
+	uint8_t event;
+	uint8_t type;
+	uint8_t len;
+	uint8_t data[0];
+} __attribute__((packed));
Signature · 1 line
1.8.5.3
#9 lore raw
In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 62 lines · On Wednesday 12 of February 2014 16:48:06 Luiz Augusto von Dentz wrote:

From: Luiz Augusto von Dentz <[email protected]>

---
 android/hal-ipc-api.txt | 30 +++++++++++++++++++++++++++++-
 android/hal-msg.h       | 16 ++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
android/hal-ipc-api.txt +29 -1
index ad5d192..01c2e81 100644
@@ -1174,7 +1174,35 @@ Bluetooth Remote Control HAL (ID 8)
 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 	Opcode 0x00 - Error response
-	Opcode 0x01 - Get Play Status command/response
+
+		Response parameters: Status (1 octet)
+
+		Valid status values: 0x01 = Fail
+		                     0x02 = Not ready
+		                     0x03 = No memory
+		                     0x04 = Busy
+		                     0x05 = Done (already completed)
+		                     0x06 = Unsupported
+		                     0x07 = Parameter invalid
+		                     0x08 = Unhandled
+		                     0x09 = Authentication failure
+		                     0x0a = Remote device down
+
+	Opcode 0x01 - Get Play Status Response command/response
+
+		Command parameters: Status (1 octet)
+		                    Duration (4 octets)
+		                    Position (4 octets)
+
+		In case of an error, the error response will be returned.
+
+		Valid status values: 0x00 = Stopped
+		                     0x01 = Playing
+		                     0x02 = Paused
+		                     0x03 = Fwd seek
+		                     0x04 = Rev seek
+		                     0xff = Error
+
 	Opcode 0x02 - List Player Application Attributes command/response
 	Opcode 0x03 - List Player Application Values command/response
 	Opcode 0x04 - Get Player Application Values command/response
android/hal-msg.h +6 -0
index 6ef00f9..82cd3f5 100644
@@ -783,3 +783,19 @@ struct hal_ev_handsfree_unknown_at {
 } __attribute__((packed));
 
 #define HAL_EV_HANDSFREE_HSP_KEY_PRESS	0x90
+
+/* AVRCP HAL API */
+
+#define HAL_AVRCP_PLAY_STATUS_STOPPED	0x00
+#define HAL_AVRCP_PLAY_STATUS_PLAYING	0x01
+#define HAL_AVRCP_PLAY_STATUS_PAUSED	0x02

android/hal-msg.h struct hal_ev_handsfree_unknown_at { · line 801

Quoted 10 lines
android/hal-msg.h +10 -0
+#define HAL_AVRCP_PLAY_STATUS_FWD_SEEK	0x03
+#define HAL_AVRCP_PLAY_STATUS_REV_SEEK	0x04
+#define HAL_AVRCP_PLAY_STATUS_ERROR	0xff
+
+#define HAL_OP_AVRCP_GET_PLAY_STATUS	0x01
+struct hal_cmd_avrcp_get_play_status {
+	uint8_t status;
+	uint32_t duration;
+	uint32_t position;
+} __attribute__((packed));

All patches in this set have been applied, thanks.

Signature · 2 lines
BR
Szymon Janc