mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-14 10:21:49 +00:00
avrcp: rename enum item
This commit is contained in:
parent
5d5682b540
commit
20c6ab9585
@ -152,7 +152,7 @@ typedef enum {
|
||||
AVRCP_MEDIA_ATTR_GENRE,
|
||||
AVRCP_MEDIA_ATTR_SONG_LENGTH_MS,
|
||||
AVRCP_MEDIA_ATTR_DEFAULT_COVER_ART,
|
||||
AVRCP_MEDIA_ATTR_RESERVED = 0x0009,
|
||||
AVRCP_MEDIA_ATTR_NUM = 0x0009,
|
||||
AVRCP_MEDIA_ATTR_NONE = 0x7FFF
|
||||
} avrcp_media_attribute_id_t;
|
||||
|
||||
|
@ -73,7 +73,7 @@ static int avrcp_browsing_controller_send_get_folder_items_cmd(uint16_t cid, avr
|
||||
attribute_count = AVRCP_MEDIA_ATTR_ALL; // 0
|
||||
break;
|
||||
default:
|
||||
attribute_count = count_set_bits_uint32(connection->attr_bitmap & ((1 << AVRCP_MEDIA_ATTR_RESERVED)-1));
|
||||
attribute_count = count_set_bits_uint32(connection->attr_bitmap & ((1 << AVRCP_MEDIA_ATTR_NUM)-1));
|
||||
attributes_to_copy = attribute_count;
|
||||
break;
|
||||
}
|
||||
@ -120,7 +120,7 @@ static int avrcp_browsing_controller_send_get_item_attributes_cmd(uint16_t cid,
|
||||
attribute_count = 0;
|
||||
break;
|
||||
default:
|
||||
attribute_count = count_set_bits_uint32(connection->attr_bitmap & ((1 << AVRCP_MEDIA_ATTR_RESERVED)-1));
|
||||
attribute_count = count_set_bits_uint32(connection->attr_bitmap & ((1 << AVRCP_MEDIA_ATTR_NUM)-1));
|
||||
attributes_to_copy = attribute_count;
|
||||
break;
|
||||
}
|
||||
|
@ -1322,7 +1322,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
||||
|
||||
static void avrcp_controller_handle_can_send_now(avrcp_connection_t * connection){
|
||||
// identifier (9) + num attributes (1) + attributes (4 * num attributes)
|
||||
uint8_t get_element_attributes_command[9+8*((AVRCP_MEDIA_ATTR_RESERVED-AVRCP_MEDIA_ATTR_TITLE) + 1)];
|
||||
uint8_t get_element_attributes_command[9+8*((AVRCP_MEDIA_ATTR_NUM-AVRCP_MEDIA_ATTR_TITLE) + 1)];
|
||||
uint16_t pos;
|
||||
uint16_t num_attributes_index;
|
||||
uint8_t i;
|
||||
@ -1359,7 +1359,7 @@ static void avrcp_controller_handle_can_send_now(avrcp_connection_t * connection
|
||||
// and the AttributeID field is omitted
|
||||
connection->data[num_attributes_index] = 0;
|
||||
pos++;
|
||||
for (i = 0; i < (uint8_t)AVRCP_MEDIA_ATTR_RESERVED - (uint8_t)AVRCP_MEDIA_ATTR_TITLE; i++){
|
||||
for (i = 0; i < (uint8_t)AVRCP_MEDIA_ATTR_NUM - (uint8_t)AVRCP_MEDIA_ATTR_TITLE; i++){
|
||||
if ((connection->controller_element_attributes & (1<<i)) != 0){
|
||||
// every attribute is 4 bytes long
|
||||
big_endian_store_32(connection->data, pos, AVRCP_MEDIA_ATTR_TITLE + i);
|
||||
@ -1863,7 +1863,7 @@ uint8_t avrcp_controller_get_element_attributes(uint16_t avrcp_cid, uint8_t num_
|
||||
|
||||
if (connection->state != AVCTP_CONNECTION_OPENED) return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
|
||||
if (num_attributes >= AVRCP_MEDIA_ATTR_RESERVED) {
|
||||
if (num_attributes >= AVRCP_MEDIA_ATTR_NUM) {
|
||||
return ERROR_CODE_INVALID_HCI_COMMAND_PARAMETERS;
|
||||
}
|
||||
|
||||
@ -1875,7 +1875,7 @@ uint8_t avrcp_controller_get_element_attributes(uint16_t avrcp_cid, uint8_t num_
|
||||
uint16_t attributes_set = 0;
|
||||
for (i = 0; i < num_attributes; i++){
|
||||
// ignore invalid attribute ID and "get all attributes"
|
||||
if (AVRCP_MEDIA_ATTR_ALL < attributes[i] && attributes[i] < AVRCP_MEDIA_ATTR_RESERVED){
|
||||
if (AVRCP_MEDIA_ATTR_ALL < attributes[i] && attributes[i] < AVRCP_MEDIA_ATTR_NUM){
|
||||
attributes_set |= 1 << (attributes[i] - AVRCP_MEDIA_ATTR_TITLE);
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ static void avrcp_target_emit_respond_vendor_dependent_query(btstack_packet_hand
|
||||
// returns number of bytes stored
|
||||
static uint16_t avrcp_target_pack_single_element_header(uint8_t * buffer, avrcp_media_attribute_id_t attr_id, uint16_t attr_value_size){
|
||||
btstack_assert(attr_id > AVRCP_MEDIA_ATTR_ALL);
|
||||
btstack_assert(attr_id < AVRCP_MEDIA_ATTR_RESERVED);
|
||||
btstack_assert(attr_id < AVRCP_MEDIA_ATTR_NUM);
|
||||
uint16_t pos = 0;
|
||||
big_endian_store_32(buffer, pos, attr_id);
|
||||
big_endian_store_16(buffer, pos + 4, RFC2978_CHARSET_MIB_UTF8);
|
||||
@ -164,7 +164,7 @@ static uint16_t avrcp_now_playing_info_value_len_with_headers(avrcp_connection_t
|
||||
uint16_t playing_info_len = 0;
|
||||
|
||||
uint8_t i;
|
||||
for ( i = (uint8_t)AVRCP_MEDIA_ATTR_ALL + 1; i < (uint8_t) AVRCP_MEDIA_ATTR_RESERVED; i++){
|
||||
for ( i = (uint8_t)AVRCP_MEDIA_ATTR_ALL + 1; i < (uint8_t) AVRCP_MEDIA_ATTR_NUM; i++){
|
||||
avrcp_media_attribute_id_t attr_id = (avrcp_media_attribute_id_t) i;
|
||||
|
||||
if ((connection->target_now_playing_info_attr_bitmap & (1 << attr_id)) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user