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

RE: [bluetooth-dev] RE: confused on HCI data packets



hi michael...how are you doing?

thanks for you reply...

well i was wondering if you could send me a copy of your alg to encoding  
the bits...mine doesn't seem to work the same way...i don't know what is  
wrong...

okay i know i have a connection setup because i get a connection complete
event with status = 0x00...so that part is good...

but now in terms of sending the data, that your packet doesn't go...

now i was wondering if i could take a looke at your encoding and decoding
methods for the acl header and l2cap header please!

thanks

:)

ps...have a good weekend


--------------------------------------------------------------------
Sami Kibria
Researcher
TRLabs - Winnipeg, Manitoba. CANADA
email: skibria@xxxxxxx.ca
--------------------------------------------------------------------
   __   _
  / /  (_)__  __ ____  __
 / /__/ / _ \/ // /\ \/ /  . . .  t h e   c h o i c e   o f   a
/____/_/_//_/\_,_/ /_/\_\              G N U   g e n e r a t i o n

--------------------------------------------------------------------

On Fri, 18 May 2001, Michael Holm wrote:

> Hi Sami,
> 
> Your encoding of the connection handler is wrong if you expect it to be
> 0x001.
> 
> Lets say that you want to transfer the following data: 98 76 54 32 and your
> connection handler from CONNECTION_COMPLET was 0x567, then you had to encode
> the following informaiton:
> 
> Packet type ACL : 0x02
> Connection handler: 0x567
> Packet boundary: 00 (two bits)
> Broadcast: 00 (two bits)
> ACL data total length: 0x0008   <- 4 + size of data
> L2CAP header length field: 0x0004 (size of data)
> L2CAP header channel id: 0x0001
> Data: 98 76 54 32
> 
> This would encode as:
> 02 67 50 08 00 04 00 01 00 98 76 54 32
> 
> So if you have connection handle 0x001 the packet to send is:
> 02 01 00 08 00 04 00 01 00 98 76 54 32
> 
> Try it out
> /Michael
> 
> -----Original Message-----
> From: Sami Kibria
> To: Michael Holm
> Sent: 2001-05-18 18:20
> Subject: RE: [bluetooth-dev] RE: confused on HCI data packets
> 
> hi michael...that is awesome that you are able to send the acl packet
> over...but i still cannot send an acl packet over...so i don't know what
> i
> am doing wrong here!
> 
> i am still a little confused...but i am not writing a L2CAP layer, so i
> guess you still need it because i haven't been able to get any acl
> packets
> over...
> 
> okay so when you send the packet over you see it on the other bluetooth
> device right away, i assume, but when i send your packet over (the exact
> same format) i still don't see it...
> 
> now i am assuming that you need your l2cap header no matter what (even
> if
> you didn't write an l2cap header), so is this what it looks like than
> 
> ===============
> acl packet type
> ===============
> hci header
> ===============
> l2cap header 
> ===============
> payload or 
> data section
> ===============
> 
> the length in the hci header would contain the length of the l2cap
> header
> + payload size (right?), and the l2cap length would be the payload size
> right?
> 
> 
> so i was wondering if i could get a peak at the code segment that
> creates
> the packet then i was hoping if i could try that out...i will show you
> want i do and what my packet looks like as well
> 
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x02  (acl packet)
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x74  (conn handler)
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x00  (conn handler)
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x04  (length)
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x00  (length)
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x73  (data)
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x61    .
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x6d    .
> May 18 11:31:41 froAlert kernel: cmd_pkt_ptr -> 0x69    .
> 
> i know i am making the packet wrong but i just can't seem to figure what
> is actually wrong with it...
> 
> my connection handler is 0001 and my length is 4
> 
> so what to do????
> 
> --------------------------------------------------------------------
> Sami Kibria
> Researcher
> TRLabs - Winnipeg, Manitoba. CANADA
> email: skibria@xxxxxxx.ca
> --------------------------------------------------------------------
>    __   _
>   / /  (_)__  __ ____  __
>  / /__/ / _ \/ // /\ \/ /  . . .  t h e   c h o i c e   o f   a
> /____/_/_//_/\_,_/ /_/\_\              G N U   g e n e r a t i o n
> 
> --------------------------------------------------------------------
> 
> On Fri, 18 May 2001, Michael Holm wrote:
> 
> > Hi Sami,
> > 
> > I think that I have the same setup as you have. I am using Ericsson BT
> > modul, doing my own HCI / L2CAP protocol stack. And until 5 minutes
> ago, I
> > were not able to send ACL data. But the clue that Maksim Krasnyanskiy
> gave
> > about the correctness of the length field of the L2CAP header, made me
> have
> > an extra look at my encoding of the L2CAP packets. This review
> discovered an
> > error in the encoding, and now it works!!!! I am able to send ACL data
> -
> > thank you Krasnyanskiy...
> > 
> > If you have a look in the specification in section 4.1 it says the
> following
> > about the length field in the L2CAP header:
> > 
> > > Length indicates the size of information payload in bytes, 
> > > excluding the length of the L2CAP header. The length of an 
> > > information payload can be up to 65535 bytes. The Length field 
> > > serves as a simple integrity check of the reassembled
> > > L2CAP packet on the receiving end.
> > 
> > Note the last sentence about the integrity check. Ericsson realy take
> that
> > seriously. So you probably do send data from the module, but it is
> dropped
> > at the receiving end.
> > 
> > I have made a dump of an ACL packet (incl. UART packettype 0x02):
> (L2CAP
> > Connection response)
> > 02 01 20 10 00 0C 00 01 00 03 38 08 00 40 00 30 00 00 00 00 00
> > 
> > If you send me a dump of the entire buffer (ACL packet)that you send
> to the
> > module, I could have a look at it.
> > 
> > Regards
> > /Michael 
> > 
> 

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