From e00800b81712635aade50201cfc3e6eca8b53ae0 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 31 Aug 2007 15:01:12 +0000 Subject: Fix endianess problem. --- audio/a2dp.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'audio/a2dp.h') diff --git a/audio/a2dp.h b/audio/a2dp.h index 6a966302..e0d1c2f6 100644 --- a/audio/a2dp.h +++ b/audio/a2dp.h @@ -47,6 +47,8 @@ #define A2DP_ALLOCATION_SNR (1 << 1) #define A2DP_ALLOCATION_LOUDNESS 1 +#if __BYTE_ORDER == __LITTLE_ENDIAN + struct sbc_codec_cap { struct avdtp_media_codec_capability cap; uint8_t channel_mode:4; @@ -58,6 +60,23 @@ struct sbc_codec_cap { uint8_t max_bitpool; } __attribute__ ((packed)); +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct sbc_codec_cap { + struct avdtp_media_codec_capability cap; + uint8_t frequency:4; + uint8_t channel_mode:4; + uint8_t block_length:4; + uint8_t subbands:2; + uint8_t allocation_method:2; + uint8_t min_bitpool; + uint8_t max_bitpool; +} __attribute__ ((packed)); + +#else +#error "Unknown byte order" +#endif + struct a2dp_sep; typedef void (*a2dp_stream_cb_t) (struct avdtp *session, struct a2dp_sep *sep, -- cgit