From ff33778a87b9d7971a162bc5348fe04affeb8c83 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 19 Feb 2014 18:58:46 +0200 Subject: [PATCH] android/hal-ipc-api: Use variable length for text attributes This prevent having to increase the MTU size just to fit all attributes when in fact some attributes are numbers (3 out of 8) in text format which should not get even close to use 256 bytes defined by bt_rc.h. --- android/hal-ipc-api.txt | 6 ++++-- android/hal-msg.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt index 3422eafae..cf3065e9a 100644 --- a/android/hal-ipc-api.txt +++ b/android/hal-ipc-api.txt @@ -1257,7 +1257,8 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID) Command parameters: Number of values (1 octet) Value # (1 octet) - Value # text (255 octets) + Value # text length (1 octet) + Value # text (variable) ... In case of an error, the error response will be returned. @@ -1266,7 +1267,8 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID) Command parameters: Number of elements (1 octet) Element # (1 octet) - Element # text (255 octets) + Element # text length (1 octet) + Element # text (variable) ... In case of an error, the error response will be returned. diff --git a/android/hal-msg.h b/android/hal-msg.h index 68fee0316..5606a56e9 100644 --- a/android/hal-msg.h +++ b/android/hal-msg.h @@ -837,7 +837,8 @@ struct hal_cmd_avrcp_get_player_attrs { struct hal_avrcp_player_setting_text { uint8_t id; - uint8_t text[255]; + uint8_t len; + uint8_t text[0]; } __attribute__((packed)); #define HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT 0x05