Move AVRCP controller support to a different HAL interface

This allows us to add a new BluetoothProfile subclass for
the AVRCP controller role independent of the existing AVRCP target support.

Change-Id: I504bbf58a88808d1a884266992ae0c635c62aca1
This commit is contained in:
Mike Lockwood 2014-06-02 16:20:51 -07:00
parent 1beebfc39b
commit 7da4cb8b6f
2 changed files with 33 additions and 10 deletions

View file

@ -47,6 +47,7 @@ __BEGIN_DECLS
#define BT_PROFILE_GATT_ID "gatt"
#define BT_PROFILE_AV_RC_ID "avrcp"
#define BT_PROFILE_AV_RC_CTRL_ID "avrcp_ctrl"
/** Bluetooth Address */
typedef struct {

View file

@ -171,11 +171,7 @@ 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);
typedef void (* btrc_passthrough_rsp_callback) (int id, int key_state);
typedef void (* btrc_connection_state_callback) (int state, bt_bdaddr_t *bd_addr);
/** BT-RC callback structure. */
/** BT-RC Target callback structure. */
typedef struct {
/** set to sizeof(BtRcCallbacks) */
size_t size;
@ -191,11 +187,9 @@ typedef struct {
btrc_register_notification_callback register_notification_cb;
btrc_volume_change_callback volume_change_cb;
btrc_passthrough_cmd_callback passthrough_cmd_cb;
btrc_passthrough_rsp_callback passthrough_rsp_cb;
btrc_connection_state_callback connection_state_cb;
} btrc_callbacks_t;
/** Represents the standard BT-RC interface. */
/** Represents the standard BT-RC AVRCP Target interface. */
typedef struct {
/** set to sizeof(BtRcInterface) */
@ -263,12 +257,40 @@ typedef struct {
*/
bt_status_t (*set_volume)(uint8_t volume);
bt_status_t (*send_pass_through_cmd) (uint8_t key_code, uint8_t key_state);
/** Closes the interface. */
void (*cleanup)( void );
} btrc_interface_t;
typedef void (* btrc_passthrough_rsp_callback) (int id, int key_state);
typedef void (* btrc_connection_state_callback) (bool state, bt_bdaddr_t *bd_addr);
/** BT-RC Controller callback structure. */
typedef struct {
/** set to sizeof(BtRcCallbacks) */
size_t size;
btrc_passthrough_rsp_callback passthrough_rsp_cb;
btrc_connection_state_callback connection_state_cb;
} btrc_ctrl_callbacks_t;
/** Represents the standard BT-RC AVRCP Controller interface. */
typedef struct {
/** set to sizeof(BtRcInterface) */
size_t size;
/**
* Register the BtRc callbacks
*/
bt_status_t (*init)( btrc_ctrl_callbacks_t* callbacks );
/** send pass through command to target */
bt_status_t (*send_pass_through_cmd) ( bt_bdaddr_t *bd_addr, uint8_t key_code, uint8_t key_state );
/** Closes the interface. */
void (*cleanup)( void );
} btrc_ctrl_interface_t;
__END_DECLS
#endif /* ANDROID_INCLUDE_BT_RC_H */