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

[bluetooth-dev] HCI/L2CAP layer experts needed!!!

Do we have any HCI/L2CAP layer experts?
I am doing a L2CAP layer, and has got to a point where I am able to establish an connection, and send data. BUT I am not able to segment L2CAP packets into more ACL data packets using the Packet Boundary flag.
The problem is as follows:
I have a L2CAP packet:
| L2CAP   |           |                                  L2CAP PAYLOAD                                    |
| length  | ChannelID |A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0Q0Y0Z0A1B1C1D1E1F1G1H1IJ1K1L1M1N1O1P1|
| field   |           |                                                                                   |
This L2CAP packet I will segment into two ACL packets:
|  ACL       |       | ACL   | L2CAP   |           |         L2CAP PAYLOAD part1      |
| connection | PB=10 |Packet | length  | ChannelID |A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0|
| handle     | BC=00 |Length | field   |           |                                  |
|  ACL       |       | ACL   |                 L2CAP PAYLOAD  part2            |
| connection | PB=01 |Packet |R0S0T0U0V0W0Q0Y0Z0A1B1C1D1E1F1G1H1IJ1K1L1M1N1O1P1|
| handle     | BC=00 |Length |                                                 |
Notice two things: The first ACL packet has the PB (Packet Boundary) field set to 10B (0x2) wich means First L2CAP packet.
The next ACL packet has PB set to 01B (Continuation packet).
Notice also that I do not repeat the L2CAP header in packet #2.
My problem is that both packets gets thrown away, they simply don't reach the destination. Actually I have a guess about what could be the reason, because I have read somewhere that the L2CAP header length field is used as an consistency check on the ACL packets. This consistency check will of cause fail on both individual packets, because in packet #1 the L2CAP length field is too long, and in packet #2 it isn't there.
I an using Ericsson ROK 101 008/21 modules, if that is at any help.
My questions is as follows:
- Is my segmentation priciple OK?
- If it is OK (and I were able to transport the packets), how do I know wich CID ACL packet #2 is for, when I do not add the L2CAP header?
FN:Michael Holm