Re: [Bluez-devel] AVDTP socket?

Marcel Holtmann
2004-11-19T11:41:24Z

Hi Brad,

> I cleaned up the bitfields for the avdtp packets and committed it...
>
> Do you think this looks right for covering the header on avdtp page 45?
>
> // remember htobs() for converting from host to bluetooth byte ordering
> // when putting data in this struct
> typedef struct {
> uint8_t v:2;
> uint8_t p:1;
> uint8_t x:1;
> uint8_t cc:4;
> uint8_t m:1;
> uint8_t pt:7;
> uint16_t sequence_number;
> uint32_t timestamp;
> uint32_t ssrc;
> uint32_t csrc[0];
> } __attribute__ ((packed)) media_packet_header;
>
> If that looks like the right direction, I need to work on delineating
> the sbc frames inside the sbc file so i can put on the media packet
> headers and the media payload headers. Is it straightforward?

this looks ok to me. From the trace of my Aiptek set I saw that these
header is filled with the following values:

0x80 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

So they only use the sequence number and nothing more. The next two
bytes are always 0xff 0xff and then the payload differs. After that I
see the 0x9c sync byte from the SBC file.

So what I think is that you can simply put the header and the other two
bytes into a L2CAP packet and then add as much data from the SBC file as
the MTU allows.

If the SBC frame header is always repeated I don't understand why we
need to set a specific SBC configuration with AVDTP.

Regards