From: "zubiwat" <zubiwat@poczta.onet.pl>
To: "devel Bluetooth" <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] BT not responding
Date: Fri, 26 Mar 2004 23:20:14 +0100 [thread overview]
Message-ID: <001c01c41380$83c390b0$fcca010a@lysydziadek> (raw)
[-- Attachment #1: Type: text/plain, Size: 3014 bytes --]
Hi
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?
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 !
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?
Regards
Maciej
Maciej Zubilewicz
[-- Attachment #2: Type: text/html, Size: 6566 bytes --]
next reply other threads:[~2004-03-26 22:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-26 22:20 zubiwat [this message]
2004-03-27 12:20 ` [Bluez-devel] BT not responding Marcel Holtmann
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='001c01c41380$83c390b0$fcca010a@lysydziadek' \
--to=zubiwat@poczta.onet.pl \
--cc=bluez-devel@lists.sourceforge.net \
/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