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

Re: [bluetooth-dev] l2cap_buf



Walter wrote:

> > the l2cap->frame is a pointer in the newly subscribed tx buf which points
> at the start of the l2cap > frame i.e the hci header is "stripped". It is
> set when you cast the tx_buffer to a l2cap_buf in :
> > l2cap_buf = (l2cap_tx_buf *)(tx->data). See header files for the details.
>
> What then is l2cap_buf->hci_buf for?
>

Those are the first 5 bytes of the packet. They form the HCI header. Note that
l2cap.c never references this part of the packet. When it sends the packet
down to the HCI layer then HCI will fill this part out.

Not knowing how much you already know, don't be offended if I explain a little
further. Layered protocols, when transmitting packets, typically prepend a
protocol header to the packet at each layer. If the protocol's "know" that the
protocol below them has to prepend 5 bytes to the packet, then it's efficient
to allocate a buffer which has an extra 5 bytes on the front. That's what the
l2cap_tx_buf struct is doing. It's reserving 5 bytes for HCI, and keeping a
pointer to the start of the L2CAP portion of the packet.

>
> Please help me...
>

I hope that helps you understand, anyway. To help with your problem we need a
better description of the symptom.

--Gordon


-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com