All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] hcidump iconsistent byte ordering?
@ 2005-01-24 14:31 soraberri
  2005-01-24 15:48 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: soraberri @ 2005-01-24 14:31 UTC (permalink / raw)
  To: bluez-devel



let's say I want to decipher the first two HCI events from the "hcitool 
inq" dump:
< HCI Command: Inquiry (0x01|0x0001) plen 5
   33 8B 9E 08 64
 > HCI Event: Command Status (0x0f) plen 4
   00 01 01 04

Easily, the first one is the Inquiry command. Its command parameters are 
specified (Bluetooth Specification 1.1) in this order: LAP, 
Inquiry_Length, Num_Responses; so from the hcidump output we have:

	LAP: 0x9E8B33 (general inquiry LAP)
	Inquiry_Length: 0x08
	Num_Responses: 0x64

so far so good; it makes sense, but how about the command status event? 
the order of its event parameters from the specification is: Status, 
Num_HCI_Command_Packets, Command_Opcode. So following the same procedure 
  as before I would get:
	
	Status: 0x00
	Num_HCI_Command_Packets: 0x01
	Command_Opcode: 0x0401

but this doesn't make sense because Command_Opcode should be 0x0001 
(Inquiry command). These bytes are now located as the two first bytes of 
the output, and the reading order is different from that of LAP's order 
in the Inquiry Command.

So, I'm asking, how must I read hcidump output in order to agree with 
the specification?

REgards

Luis Peiro



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez-devel] hcidump iconsistent byte ordering?
  2005-01-24 14:31 [Bluez-devel] hcidump iconsistent byte ordering? soraberri
@ 2005-01-24 15:48 ` Marcel Holtmann
  2005-01-24 16:36   ` [Bluez-devel] " soraberri
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2005-01-24 15:48 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Luis,

> let's say I want to decipher the first two HCI events from the "hcitool 
> inq" dump:
> < HCI Command: Inquiry (0x01|0x0001) plen 5
>    33 8B 9E 08 64
>  > HCI Event: Command Status (0x0f) plen 4
>    00 01 01 04
> 
> Easily, the first one is the Inquiry command. Its command parameters are 
> specified (Bluetooth Specification 1.1) in this order: LAP, 
> Inquiry_Length, Num_Responses; so from the hcidump output we have:
> 
> 	LAP: 0x9E8B33 (general inquiry LAP)
> 	Inquiry_Length: 0x08
> 	Num_Responses: 0x64
> 
> so far so good; it makes sense, but how about the command status event? 
> the order of its event parameters from the specification is: Status, 
> Num_HCI_Command_Packets, Command_Opcode. So following the same procedure 
>   as before I would get:
> 	
> 	Status: 0x00
> 	Num_HCI_Command_Packets: 0x01
> 	Command_Opcode: 0x0401
> 
> but this doesn't make sense because Command_Opcode should be 0x0001 
> (Inquiry command). These bytes are now located as the two first bytes of 
> the output, and the reading order is different from that of LAP's order 
> in the Inquiry Command.
> 
> So, I'm asking, how must I read hcidump output in order to agree with 
> the specification?

the command opcode consists of OGF and OCF. Look at the specification on
how to encode them into the command opcode.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bluez-devel] Re: hcidump iconsistent byte ordering?
  2005-01-24 15:48 ` Marcel Holtmann
@ 2005-01-24 16:36   ` soraberri
  0 siblings, 0 replies; 3+ messages in thread
From: soraberri @ 2005-01-24 16:36 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

Ok, the opcode is encoded in two fields:
OGF Range (6 bits): 0x00-0x3F
OCF Range (10 bits): 0x0000-0x03FF

and hcidump writes these two fields (0x01|0x0001) for the inquiry 
command, which in binary form it is

	0000 0100 0000 0001

and corresponds to 0x0401, which is shown as 01 04 by hcidump...

all rigth, I was thinking of 0x01 as 8 bits instead of 6.

thanks Marcel!

Regards

Luis Peiro


Marcel Holtmann wrote:
> Hi Luis,
> 
> 
>>let's say I want to decipher the first two HCI events from the "hcitool 
>>inq" dump:
>>< HCI Command: Inquiry (0x01|0x0001) plen 5
>>   33 8B 9E 08 64
>> > HCI Event: Command Status (0x0f) plen 4
>>   00 01 01 04
>>
>>Easily, the first one is the Inquiry command. Its command parameters are 
>>specified (Bluetooth Specification 1.1) in this order: LAP, 
>>Inquiry_Length, Num_Responses; so from the hcidump output we have:
>>
>>	LAP: 0x9E8B33 (general inquiry LAP)
>>	Inquiry_Length: 0x08
>>	Num_Responses: 0x64
>>
>>so far so good; it makes sense, but how about the command status event? 
>>the order of its event parameters from the specification is: Status, 
>>Num_HCI_Command_Packets, Command_Opcode. So following the same procedure 
>>  as before I would get:
>>	
>>	Status: 0x00
>>	Num_HCI_Command_Packets: 0x01
>>	Command_Opcode: 0x0401
>>
>>but this doesn't make sense because Command_Opcode should be 0x0001 
>>(Inquiry command). These bytes are now located as the two first bytes of 
>>the output, and the reading order is different from that of LAP's order 
>>in the Inquiry Command.
>>
>>So, I'm asking, how must I read hcidump output in order to agree with 
>>the specification?
> 
> 
> the command opcode consists of OGF and OCF. Look at the specification on
> how to encode them into the command opcode.
> 
> Regards
> 
> Marcel
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-24 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-24 14:31 [Bluez-devel] hcidump iconsistent byte ordering? soraberri
2005-01-24 15:48 ` Marcel Holtmann
2005-01-24 16:36   ` [Bluez-devel] " soraberri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.