diff options
author | Mike Lockwood <lockwood@google.com> | 2014-06-02 16:20:51 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2014-06-13 09:09:58 -0700 |
commit | 7da4cb8b6f9e99b1c003d8aada8a36c1ce977313 (patch) | |
tree | ca3ea648b0af24723b0405526c050d2d19ee8218 /include/hardware/bt_rc.h | |
parent | 1beebfc39b0b500fe8fd6ee562f52b06ccf63c9f (diff) | |
download | hardware_libhardware-7da4cb8b6f9e99b1c003d8aada8a36c1ce977313.zip hardware_libhardware-7da4cb8b6f9e99b1c003d8aada8a36c1ce977313.tar.gz hardware_libhardware-7da4cb8b6f9e99b1c003d8aada8a36c1ce977313.tar.bz2 |
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
Diffstat (limited to 'include/hardware/bt_rc.h')
-rw-r--r-- | include/hardware/bt_rc.h | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/include/hardware/bt_rc.h b/include/hardware/bt_rc.h index 277d9c8..c565c48 100644 --- a/include/hardware/bt_rc.h +++ b/include/hardware/bt_rc.h @@ -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 */ |