Re: SBC big endian issues?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Siarhei

> SBC encoder contains the following fragment:
>
>> #if __BYTE_ORDER == __LITTLE_ENDIAN
>>                       if (sbc->endian == SBC_BE)
>> #elif __BYTE_ORDER == __BIG_ENDIAN
>>                       if (sbc->endian == SBC_LE)
>> #else
>> #error "Unknown byte order"
>> #endif
>>                               s = (ptr[0] & 0xff) << 8 | (ptr[1] & 0xff);
>>                       else
>>                               s = (ptr[0] & 0xff) | (ptr[1] & 0xff) << 8;
>
> This does not look right. Because as far as I can see, it will work
> differently on big and little endian systems

I tested it some time ago on powerpc and I know Marcel also has a
powerpc for testing. I'll need to update my machine for bluez 4.x.

The logic here seems to be to swap bytes if the endian set in the sbc
struct does not match host endian.

-- 
Brad Midgley
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux