public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: zubiwat <zubiwat@poczta.onet.pl>
Cc: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Unknown answer
Date: Sun, 28 Mar 2004 14:43:48 +0200	[thread overview]
Message-ID: <1080477828.2281.108.camel@pegasus> (raw)
In-Reply-To: <001101c414a2$2d426540$fcca010a@lysydziadek>

Hi Maciej,

> Please this is the last - really. How do you decode this because 0e after 04
> means an error. After 04 shouldn't be 00 as a command succeeded. How do you
> look into specification to find out the answer?
> I swear it's the last question, because it will solve my problems.

actually your problem is reading the HCI specification. It is all there
and the HCI part is one of the easier parts of Bluetooth.

So do it step by step and take this as an example

	04 0E 0A 01 09 10 00 04 00 20 DD 09 00


	04 = H:4 specific and means this is a HCI event

	0E 0A = HCI event header

		struct hci_event_hdr {
	        	uint8_t         event;
		        uint8_t         plen;
		} __attribute__ ((packed));

		0E = HCI command complete event
		0A = Event len (= 10 bytes)

	01 09 10 = HCI command complete event

		struct hci_command_complete_evt {
		        uint8_t         ncmd;
		        uint16_t        opcode;
		        /* variable length part */
		        uint8_t         param[0];
		} __attribute__ ((packed));

		01 = Number of command packets (HCI flow control)
		09 10 = Command opcode (OCF & OGF)

	00 04 00 20 DD 09 00 = HCI read BD_ADDR response

		struct hci_read_bd_addr_rp {
		        uint8_t         status;
		        bdaddr_t        bdaddr;
		} __attribute__ ((packed));

		00 = Status (= OK)
		04 00 20 DD 09 00 = BD_ADDR

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

      parent reply	other threads:[~2004-03-28 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-28  0:42 [Bluez-devel] Unknown answer zubiwat
2004-03-28  8:32 ` Marcel Holtmann
     [not found]   ` <001101c414a2$2d426540$fcca010a@lysydziadek>
2004-03-28 12:43     ` Marcel Holtmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1080477828.2281.108.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=zubiwat@poczta.onet.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox