From: Marcel Holtmann <marcel@holtmann.org>
To: zubiwat <zubiwat@poczta.onet.pl>
Cc: devel Bluetooth <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] BT not responding
Date: Sat, 27 Mar 2004 13:20:44 +0100 [thread overview]
Message-ID: <1080390043.2281.49.camel@pegasus> (raw)
In-Reply-To: <001c01c41380$83c390b0$fcca010a@lysydziadek>
Hi Maciej,
there is no need to post this on both mailing lists.
> Why my BT device isn't responding when I'm sending any commands for
> example to read BT_ADDR like this: 0x01 0x00 0x09.
> It doesn't respond to me, even with an error code - nothing.
> But when I use first code from blueZ hciconfig like this
>
> int clen = 0, i; /* Command len */
> static int csr_seq = 0; /* Sequence number of command */
> int divisor;
>
> /* Try to read the build ID of the CSR chip */
> clen = 5 + (5 + 6) * 2;
> /* HCI header */
> cmd[0] = HCI_COMMAND_PKT;
> cmd[1] = 0x09; /* CSR command */
> cmd[2] = 0xfc; /* MANUFACTURER_SPEC */
> cmd[3] = 1 + (5 + 6) * 2; /* len */
> /* CSR MSG header */
> cmd[4] = 0xC2; /* first+last+channel=BCC */
> /* CSR BCC header */
> cmd[5] = 0x00; /* type = GET-REQ */
> cmd[6] = 0x00; /* - msB */
> cmd[7] = 5 + 4; /* len */
> cmd[8] = 0x00; /* - msB */
> cmd[9] = csr_seq & 0xFF;/* seq num */
> cmd[10] = (csr_seq >> 8) & 0xFF; /* - msB */
> csr_seq++;
> cmd[11] = 0x19; /* var_id = CSR_CMD_BUILD_ID */
> cmd[12] = 0x28; /* - msB */
> cmd[13] = 0x00; /* status = STATUS_OK */
> cmd[14] = 0x00; /* - msB */
> /* CSR BCC payload */
> memset(cmd + 15, 0, 6 * 2);
>
> do{
> for (i=0; i < clen+1; i++) PutByteU0 (cmd[i]);
>
> read_hci_event(resp,100);
>
> }while (resp[1] != 0xff);
>
>
> /* Try to read the current speed of the CSR chip */
> clen = 5 + (5 + 4)*2;
> /* -- HCI header */
> cmd[0] = HCI_COMMAND_PKT;
> cmd[1] = 0x09; /* CSR command */
> cmd[2] = 0xfc; /* MANUFACTURER_SPEC */
> cmd[3] = 1 + (5 + 4)*2; /* len */
> /* -- CSR BCC header -- */
> cmd[9] = csr_seq & 0xFF; /* seq num */
> cmd[10] = (csr_seq >> 8) & 0xFF; /* - msB */
> csr_seq++;
> cmd[11] = 0x02; /* var_id = CONFIG_UART */
> cmd[12] = 0x68; /* - msB */
>
> /* Now, create the command that will set the UART speed */
> /* CSR BCC header */
> cmd[5] = 0x02; /* type = SET-REQ */
> cmd[6] = 0x00; /* - msB */
> cmd[9] = csr_seq & 0xFF; /* seq num */
> cmd[10] = (csr_seq >> 8) & 0xFF;/* - msB */
> csr_seq++;
>
> divisor = (921600*64+7812)/15625;
>
> /* No parity, one stop bit -> divisor |= 0x0000; */
> cmd[15] = (divisor) & 0xFF; /* divider */
> cmd[16] = (divisor >> 8) & 0xFF; /* - msB */
> /* The rest of the payload will be 0x00 */
>
> for (i=0; i < clen; i++) PutByteU0 (cmd[i]);
>
> It answers like this: 04 FF 13 C2 01 00 09 00 02 00 02 68 00 00 BF 0E
> 00 00 00 00
> What is it? Is it kind of special bits of csr chip or what?
> I know it is event but after this BT responds only for bad commands
> like this 04 10 01 fe but when I try read BT_ADDR it's quiet.
> What this code is up to?
This is CSR specific and you must ask your module manufacturer for more
details.
> Please send me UART specification or sth where it's written how to set
> this up and howto communicate with csr chip. It's very important for
> me !
The H:4 UART specification is part of the Bluetooth 1.1 specification.
> I spent almost 2 weeks to find out how to communicate whit it and
> nothing works good. I don't know where to find some info. I looked
> almost everywhere?
Start using BlueZ and don't worry about it or this is the wrong mailing
list for you ;)
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
prev parent reply other threads:[~2004-03-27 12:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-26 22:20 [Bluez-devel] BT not responding zubiwat
2004-03-27 12:20 ` 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=1080390043.2281.49.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