diff --git a/profiles/audio/a2dp-codecs.h b/profiles/audio/a2dp-codecs.h
index 3dc31cb..0f44b10 100644
--- a/profiles/audio/a2dp-codecs.h
+++ b/profiles/audio/a2dp-codecs.h
#endif
typedef struct {
- uint8_t vendor_id[4];
- uint8_t codec_id[2];
+ uint32_t vendor_id;
+ uint16_t codec_id;
} __attribute__ ((packed)) a2dp_vendor_codec_t;
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index cabdd66..c9dac9a 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
local_codec = (a2dp_vendor_codec_t *) capabilities;
- if (memcmp(remote_codec->vendor_id, local_codec->vendor_id,
- sizeof(local_codec->vendor_id)))
+ if (btohl(remote_codec->vendor_id) != btohl(local_codec->vendor_id))
return FALSE;
- if (memcmp(remote_codec->codec_id, local_codec->codec_id,
- sizeof(local_codec->codec_id)))
+ if (btohs(remote_codec->codec_id) != btohs(local_codec->codec_id))
return FALSE;
- DBG("vendor 0x%02x%02x%02x%02x codec 0x%02x%02x",
- remote_codec->vendor_id[0], remote_codec->vendor_id[1],
- remote_codec->vendor_id[2], remote_codec->vendor_id[3],
- remote_codec->codec_id[0], remote_codec->codec_id[1]);
+ DBG("vendor 0x%08x codec 0x%04x", btohl(remote_codec->vendor_id),
+ btohs(remote_codec->codec_id));
return TRUE;
}
diff --git a/tools/avinfo.c b/tools/avinfo.c
index a4deaac..e7747db 100644
--- a/tools/avinfo.c
+++ b/tools/avinfo.c
{
printf("\tMedia Codec: Vendor Specific A2DP Codec");
- printf("\n\t\tVendor ID 0x%02x%02x%02x%02x", vendor->vendor_id[0],
- vendor->vendor_id[1], vendor->vendor_id[2],
- vendor->vendor_id[3]);
+ printf("\n\t\tVendor ID 0x%08x", btohl(vendor->vendor_id));
- printf("\n\t\tVendor Specific Codec ID 0x%02x%02x\n",
- vendor->codec_id[0], vendor->codec_id[1]);
+ printf("\n\t\tVendor Specific Codec ID 0x%04x\n",
+ btohs(vendor->codec_id));
}
static void print_mpeg24(a2dp_mpeg_t *mpeg)