Regarding HCI event packet decoding.

1,170 views
Skip to first unread message

mindentropy

unread,
Aug 18, 2012, 9:56:39 AM8/18/12
to btsta...@googlegroups.com
When I send a read local version information i.e. {0x01,0x01,0x10,0x00} command I get the reply as 0x04,0x0E,0x0C,0x0F,0x1B. I understood that the 0x04 is event packet. 0x0E is the command complete event. I am not able to understand what is 0x0C,0x0F and 0x1B is? Shouldn't  0x0C be the parameter total length? If yes isn't it wrong?

Matthias Ringwald

unread,
Aug 18, 2012, 3:37:48 PM8/18/12
to btsta...@googlegroups.com
Hi

Please have a loop at the Core V4.0 Bluetooth Specification, see the HCI section.
https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737

And yes, the 3rd byte, if we count the HCI packet type, denotes the length of the remaining data. So you didn't receive the full event packet probably.

Best
Matthias


On 18.08.2012, at 15:56, mindentropy wrote:

> When I send a read local version information i.e. {0x01,0x01,0x10,0x00} command I get the reply as 0x04,0x0E,0x0C,0x0F,0x1B. I understood that the 0x04 is event packet. 0x0E is the command complete event. I am not able to understand what is 0x0C,0x0F and 0x1B is? Shouldn't 0x0C be the parameter total length? If yes isn't it wrong?
>
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/btstack-dev/-/T3VIfa0gvmsJ.
> To post to this group, send email to btsta...@googlegroups.com.
> To unsubscribe from this group, send email to btstack-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/btstack-dev?hl=en.

mindentropy

unread,
Aug 18, 2012, 4:40:14 PM8/18/12
to btsta...@googlegroups.com
Thanks for the reply. I am getting this reply every time I try to get the local version information. If possible could you send the local version information hci command without loading the service patch and check the results?

Matthias Ringwald

unread,
Aug 18, 2012, 4:48:32 PM8/18/12
to btstack-dev
Hi again

I don't have the MSP430 stuff in reach. On my mac, I get this

[23:50:42.564]  [HCI COMMAND]  01 10 00 
[23:50:42.566]  [HCI EVENT]  0E 0C 01 01 10 00 04 E7 01 04 0F 00 14 42 

Those exclude the packet types.

Do you send a HCI Reset command first? If not, please do.

What's your goal/project btw? 

Best
 Matthias 

To view this discussion on the web visit https://groups.google.com/d/msg/btstack-dev/-/DoANPT0qHt0J.

mindentropy

unread,
Aug 19, 2012, 12:43:30 PM8/19/12
to btsta...@googlegroups.com
Ah got it to work. I had set the baud rate to just 9600 for my UART. This was causing some of the missing data.
My goal is to first understand bluetooth components. After that try my own stack targeting mainly MSP430.
Reply all
Reply to author
Forward
0 new messages