summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatya Calloji <satyac@broadcom.com>2013-08-01 03:11:11 -0700
committerJohn Du <johnldu@google.com>2013-08-16 12:32:55 -0700
commitfe9728dfa18eabbf4e5bce9cecb6524b9158fb13 (patch)
tree67daf91f3a37a994395e4922a1cc204fdb271e56
parentb98448119351df9ec7453e0ae92ea408b02294db (diff)
downloadlibhardware-fe9728dfa18eabbf4e5bce9cecb6524b9158fb13.tar.gz
Add support for AbsoluteVolume
Add support for AbsoluteVolume in HAL bug 9595622 Change-Id: Iaf08b81b61aa07ebaa83f4bd6cc9e82171947aa1 Conflicts: include/hardware/bt_rc.h
-rwxr-xr-xinclude/hardware/bt_rc.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/include/hardware/bt_rc.h b/include/hardware/bt_rc.h
index 0898133c..d4555437 100755
--- a/include/hardware/bt_rc.h
+++ b/include/hardware/bt_rc.h
@@ -30,6 +30,13 @@ __BEGIN_DECLS
typedef uint8_t btrc_uid_t[BTRC_UID_SIZE];
typedef enum {
+ BTRC_FEAT_NONE = 0x00, /* AVRCP 1.0 */
+ BTRC_FEAT_METADATA = 0x01, /* AVRCP 1.3 */
+ BTRC_FEAT_ABSOLUTE_VOLUME = 0x02, /* Supports TG role and volume sync */
+ BTRC_FEAT_BROWSE = 0x04, /* AVRCP 1.4 and up, with Browsing support */
+} btrc_remote_features_t;
+
+typedef enum {
BTRC_PLAYSTATE_STOPPED = 0x00, /* Stopped */
BTRC_PLAYSTATE_PLAYING = 0x01, /* Playing */
BTRC_PLAYSTATE_PAUSED = 0x02, /* Paused */
@@ -114,6 +121,10 @@ typedef struct {
uint8_t text[BTRC_MAX_ATTR_STR_LEN];
} btrc_element_attr_val_t;
+/** Callback for the controller's supported feautres */
+typedef void (* btrc_remote_features_callback)(bt_bdaddr_t *bd_addr,
+ btrc_remote_features_t features);
+
/** Callback for play status request */
typedef void (* btrc_get_play_status_callback)();
@@ -151,6 +162,12 @@ typedef void (* btrc_get_element_attr_callback) (uint8_t num_attr, btrc_media_at
*/
typedef void (* btrc_register_notification_callback) (btrc_event_id_t event_id, uint32_t param);
+/* AVRCP 1.4 Enhancements */
+/** Callback for volume change on CT
+** volume: Current volume setting on the CT (0-127)
+*/
+typedef void (* btrc_volume_change_callback) (uint8_t volume, uint8_t ctype);
+
/** Callback for passthrough commands */
typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state);
@@ -158,6 +175,7 @@ typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state);
typedef struct {
/** set to sizeof(BtRcCallbacks) */
size_t size;
+ btrc_remote_features_callback remote_features_cb;
btrc_get_play_status_callback get_play_status_cb;
btrc_list_player_app_attr_callback list_player_app_attr_cb;
btrc_list_player_app_values_callback list_player_app_values_cb;
@@ -167,6 +185,7 @@ typedef struct {
btrc_set_player_app_value_callback set_player_app_value_cb;
btrc_get_element_attr_callback get_element_attr_cb;
btrc_register_notification_callback register_notification_cb;
+ btrc_volume_change_callback volume_change_cb;
btrc_passthrough_cmd_callback passthrough_cmd_cb;
} btrc_callbacks_t;
@@ -229,10 +248,19 @@ typedef struct {
btrc_notification_type_t type,
btrc_register_notification_t *p_param);
+ /* AVRCP 1.4 enhancements */
+
+ /**Send current volume setting to remote side. Support limited to SetAbsoluteVolume
+ ** This can be enhanced to support Relative Volume (AVRCP 1.0).
+ ** With RelateVolume, we will send VOLUME_UP/VOLUME_DOWN opposed to absolute volume level
+ ** volume: Should be in the range 0-127. bit7 is reseved and cannot be set
+ */
+ bt_status_t (*set_volume)(uint8_t volume);
+
/** Closes the interface. */
void (*cleanup)( void );
} btrc_interface_t;
__END_DECLS
-#endif /* ANDROID_INCLUDE_BT_RC_H */ \ No newline at end of file
+#endif /* ANDROID_INCLUDE_BT_RC_H */