Return-Path: Message-ID: <001c01c41380$83c390b0$fcca010a@lysydziadek> From: "zubiwat" To: "devel Bluetooth" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0019_01C41388.E4907950" Subject: [Bluez-devel] BT not responding Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Date: Fri, 26 Mar 2004 23:20:14 +0100 This is a multi-part message in MIME format. ------=_NextPart_000_0019_01C41388.E4907950 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable 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 =3D 0, i; /* Command len */ static int csr_seq =3D 0; /* Sequence number of command */ int divisor; /* Try to read the build ID of the CSR chip */ clen =3D 5 + (5 + 6) * 2; /* HCI header */ cmd[0] =3D HCI_COMMAND_PKT; cmd[1] =3D 0x09; /* CSR command */ cmd[2] =3D 0xfc; /* MANUFACTURER_SPEC */ cmd[3] =3D 1 + (5 + 6) * 2; /* len */ /* CSR MSG header */ cmd[4] =3D 0xC2; /* first+last+channel=3DBCC */ /* CSR BCC header */ cmd[5] =3D 0x00; /* type =3D GET-REQ */ cmd[6] =3D 0x00; /* - msB */ cmd[7] =3D 5 + 4; /* len */ cmd[8] =3D 0x00; /* - msB */ cmd[9] =3D csr_seq & 0xFF;/* seq num */ cmd[10] =3D (csr_seq >> 8) & 0xFF; /* - msB */ csr_seq++; cmd[11] =3D 0x19; /* var_id =3D CSR_CMD_BUILD_ID */ cmd[12] =3D 0x28; /* - msB */ cmd[13] =3D 0x00; /* status =3D STATUS_OK */ cmd[14] =3D 0x00; /* - msB */ /* CSR BCC payload */ memset(cmd + 15, 0, 6 * 2); do{ for (i=3D0; i < clen+1; i++) PutByteU0 (cmd[i]); read_hci_event(resp,100); }while (resp[1] !=3D 0xff); /* Try to read the current speed of the CSR chip */ clen =3D 5 + (5 + 4)*2; /* -- HCI header */ cmd[0] =3D HCI_COMMAND_PKT; cmd[1] =3D 0x09; /* CSR command */ cmd[2] =3D 0xfc; /* MANUFACTURER_SPEC */ cmd[3] =3D 1 + (5 + 4)*2; /* len */ /* -- CSR BCC header -- */ cmd[9] =3D csr_seq & 0xFF; /* seq num */ cmd[10] =3D (csr_seq >> 8) & 0xFF; /* - msB */ csr_seq++; cmd[11] =3D 0x02; /* var_id =3D CONFIG_UART */ cmd[12] =3D 0x68; /* - msB */ /* Now, create the command that will set the UART speed */ /* CSR BCC header */ cmd[5] =3D 0x02; /* type =3D SET-REQ */ cmd[6] =3D 0x00; /* - msB */ cmd[9] =3D csr_seq & 0xFF; /* seq num */ cmd[10] =3D (csr_seq >> 8) & 0xFF;/* - msB */ csr_seq++; divisor =3D (921600*64+7812)/15625; /* No parity, one stop bit -> divisor |=3D 0x0000; */ cmd[15] =3D (divisor) & 0xFF; /* divider */ cmd[16] =3D (divisor >> 8) & 0xFF; /* - msB */ /* The rest of the payload will be 0x00 */ for (i=3D0; 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=20 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?=20 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 ------=_NextPart_000_0019_01C41388.E4907950 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
Hi
Why my BT device isn't responding when = I'm sending=20 any commands for example to read BT_ADDR like this: 0x01 0x00 = 0x09.
It doesn't respond to me, even with an = error code -=20 nothing.
But when I use first code from blueZ = hciconfig like=20 this
 
 int  clen =3D 0,=20 i;            = ;   =20 /* Command len */
 static int csr_seq =3D = 0;     /*=20 Sequence number of command */
 int =20 divisor;
         /* Try to read the build ID of the = CSR chip=20 */
 clen =3D 5 + (5 + 6) * 2;
    =    =20  /* HCI header */
 cmd[0] =3D = HCI_COMMAND_PKT;
 cmd[1] =3D=20 0x09;  /* CSR command */
 cmd[2] =3D = 0xfc;  /*=20 MANUFACTURER_SPEC */
 cmd[3] =3D 1 + (5 + 6) * 2; /* len=20 */
         /* CSR MSG header=20 */
 cmd[4] =3D 0xC2;  /* first+last+channel=3DBCC=20 */
         /* CSR BCC header=20 */
 cmd[5] =3D 0x00;  /* type =3D GET-REQ = */
 cmd[6] =3D=20 0x00;  /* - msB */
 cmd[7] =3D 5 + 4;  /* = len=20 */
 cmd[8] =3D 0x00;  /* - msB */
 cmd[9] =3D = csr_seq=20 & 0xFF;/* seq num */
 cmd[10] =3D (csr_seq >> 8) & = 0xFF; /* - msB */
 csr_seq++;
 cmd[11] =3D=20 0x19;  /* var_id =3D CSR_CMD_BUILD_ID */
 cmd[12] =3D=20 0x28;  /* - msB */
 cmd[13] =3D 0x00;  /* = status =3D=20 STATUS_OK */
 cmd[14] =3D 0x00;  /* - msB=20 */
         /* CSR BCC payload=20 */
 memset(cmd + 15, 0, 6 * 2);
 
  = do{
    for (i=3D0;=20 i < clen+1; i++) PutByteU0 (cmd[i]);
 
   =20 read_hci_event(resp,100);
 
  }while (resp[1] !=3D=20 0xff);
 
 
    =    =20  /* Try to read the current speed of the CSR chip */
 clen = =3D 5 + (5=20 + 4)*2;
         /* -- HCI header=20 */
 cmd[0] =3D HCI_COMMAND_PKT;
 cmd[1] =3D = 0x09;  /* CSR=20 command */
 cmd[2] =3D 0xfc;  /* MANUFACTURER_SPEC=20 */
 cmd[3] =3D 1 + (5 + 4)*2; /* len=20 */
         /* -- CSR = BCC header=20 -- */
 cmd[9] =3D csr_seq & 0xFF; /* seq num = */
 cmd[10]=20 =3D (csr_seq >> 8) & 0xFF; /* - msB=20 */
 csr_seq++;
 cmd[11] =3D 0x02;  /* var_id = =3D=20 CONFIG_UART */
 cmd[12] =3D 0x68;  /* - msB=20 */
 
    =    =20  /* Now, create the command that will set the UART speed=20 */
         /* CSR BCC header=20 */
 cmd[5] =3D 0x02;   /* type =3D SET-REQ = */
 cmd[6]=20 =3D 0x00;   /* - msB */
 cmd[9] =3D csr_seq & = 0xFF; /* seq num */
 cmd[10] =3D (csr_seq >> 8) & = 0xFF;/* -=20 msB */
 csr_seq++;
 
 divisor =3D=20 (921600*64+7812)/15625;
 
        /* No = parity, one=20 stop bit -> divisor |=3D 0x0000; */
 cmd[15] =3D (divisor) = &=20 0xFF;  /* divider */
 cmd[16] =3D (divisor >> 8) = &=20 0xFF; /* - msB */
       =20      /* The rest of the payload will be 0x00=20 */
    for (i=3D0; = i < clen;=20 i++) PutByteU0 (cmd[i]);
 
It answers like this: 04 FF 13 C2 01 00 = 09 00 02 00=20 02 68 00 00 BF 0E 00 00 00 00
What is it? Is it kind of special bits = of csr chip=20 or what?
I know it is event but after this BT = responds only=20 for bad commands like this 04 10 01 fe  but when I try read BT_ADDR = it's=20 quiet.
What this code is up to?
Please send me UART specification or = sth where it's=20 written how to set this up and howto communicate with csr chip. It's = very=20 important for me !
I spent almost 2 weeks to find out how = to=20 communicate whit it and nothing works good. I don't know where to find = some=20 info. I looked almost everywhere?
 
Regards
 
Maciej
 
Maciej = Zubilewicz
------=_NextPart_000_0019_01C41388.E4907950-- ------------------------------------------------------- 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