All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] bccmd reading clock
@ 2005-06-27 22:37 Ronny L Nilsson
  2005-06-28 15:42 ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Ronny L Nilsson @ 2005-06-27 22:37 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]



Hi
I was in the need for an enhancement of the bccmd tool and thus made a 
small change. The supplied patch adds a command for reading the the 
BT-clock of local device. In the process I also made some minor changes 
to utils/tools/csr.c to reuse existing code. Besided reading 16-bit 
variables it can now also read 32- and 8-bits alike.

No changes has (yet) been made to hcidump. Should it be done?

Regards
/Ronny Nilsson




[-- Attachment #2: bccmd-clock.patch --]
[-- Type: text/x-diff, Size: 3921 bytes --]

Index: utils/tools/bccmd.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/bccmd.c,v
retrieving revision 1.1
diff -u -p -r1.1 bccmd.c
--- utils/tools/bccmd.c	16 May 2005 11:51:27 -0000	1.1
+++ utils/tools/bccmd.c	27 Jun 2005 22:30:05 -0000
@@ -79,13 +79,33 @@ static int cmd_keylen(int dd, int argc, 
 	return 0;
 }
 
+
+static int cmd_clock(int dd, int argc, char *argv[])
+{
+	uint32_t clk=0;
+	int err;
+
+	err = csr_read_varid_uint32(dd, 0x2143, CSR_VARID_BT_CLOCK, &clk);
+	if (err < 0) {
+		errno = -err;
+		return -1;
+	}
+
+	printf("Device local BT-clock: 0x%x\n", clk);
+
+	return 0;
+}
+
+
+
 static struct {
 	char *str;
 	int (*func)(int dd, int argc, char **argv);
 	char *arg;
 	char *doc;
 } commands[] = {
-	{ "keylen", cmd_keylen, "<handle>", "Get current crypt key length" },
+	{ "keylen", cmd_keylen,   "<handle>", "Get current crypt key length" },
+	{ "clock", cmd_clock,     "        ", "Get local BT-clock" },
 	{ NULL },
 };
 
Index: utils/tools/csr.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/csr.c,v
retrieving revision 1.27
diff -u -p -r1.27 csr.c
--- utils/tools/csr.c	10 Jun 2005 06:59:27 -0000	1.27
+++ utils/tools/csr.c	27 Jun 2005 22:30:06 -0000
@@ -464,7 +464,8 @@ int csr_read_varid_complex(int dd, uint1
 	return 0;
 }
 
-int csr_read_varid_uint16(int dd, uint16_t seqnum, uint16_t varid, uint16_t *value)
+
+int csr_read_varid_uint32(int dd, uint16_t seqnum, uint16_t varid, uint32_t *value)
 {
 	unsigned char cmd[] = { 0x00, 0x00, 0x09, 0x00,
 				seqnum & 0xff, seqnum >> 8, varid & 0xff, varid >> 8, 0x00, 0x00,
@@ -488,22 +489,56 @@ int csr_read_varid_uint16(int dd, uint16
 
 	if (hci_send_req(dd, &rq, 2000) < 0)
 		return -1;
-
-	if (rp[0] != 0xc2) {
+	
+	if (rp[0] != 0xc2 || rp[5] != (seqnum & 0xff) || 
+			rp[6] != (seqnum >> 8)) {
 		errno = EIO;
 		return -1;
 	}
 
-	if ((rp[9] + (rp[10] << 8)) != 0) {
+	if (rp[9] || rp[10]) {
 		errno = ENXIO;
 		return -1;
 	}
 
-	*value = rp[11] + (rp[12] << 8);
+	*value = rp[12];
+	*value <<= 8;
+	*value |= rp[11];
+	*value <<= 8;
+	*value |= rp[14];
+	*value <<= 8;
+	*value |= rp[13];
 
 	return 0;
 }
 
+
+int csr_read_varid_uint16(int dd, uint16_t seqnum, uint16_t varid, uint16_t *value)
+{
+	uint32_t val32;
+	
+	if(csr_read_varid_uint32(dd, seqnum, varid, &val32)==0) {
+		*value = (uint16_t) (val32 >> 16);
+		return 0;
+	}
+	
+	return -1;
+}
+
+
+int csr_read_varid_uint8(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value)
+{
+	uint16_t val16;
+	
+	if(csr_read_varid_uint16(dd, seqnum, varid, &val16)==0) {
+		*value = (uint8_t) val16;
+		return 0;
+	}
+	
+	return -1;
+}
+
+
 int csr_read_pskey_complex(int dd, uint16_t seqnum, uint16_t pskey, uint8_t *value, uint16_t length)
 {
 	unsigned char cmd[] = { 0x00, 0x00, ((length / 2) + 8) & 0xff, ((length / 2) + 8) >> 8,
Index: utils/tools/csr.h
===================================================================
RCS file: /cvsroot/bluez/utils/tools/csr.h,v
retrieving revision 1.12
diff -u -p -r1.12 csr.h
--- utils/tools/csr.h	10 Jun 2005 05:30:28 -0000	1.12
+++ utils/tools/csr.h	27 Jun 2005 22:30:06 -0000
@@ -76,7 +76,9 @@ char *csr_chipvertostr(uint16_t ver, uin
 char *csr_pskeytostr(uint16_t pskey);
 
 int csr_read_varid_complex(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value, uint16_t length);
+int csr_read_varid_uint32(int dd, uint16_t seqnum, uint16_t varid, uint32_t *value);
 int csr_read_varid_uint16(int dd, uint16_t seqnum, uint16_t varid, uint16_t *value);
+int csr_read_varid_uint8(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value);
 int csr_read_pskey_complex(int dd, uint16_t seqnum, uint16_t pskey, uint8_t *value, uint16_t length);
 int csr_read_pskey_uint16(int dd, uint16_t seqnum, uint16_t pskey, uint16_t *value);
 int csr_write_pskey_uint16(int dd, uint16_t seqnum, uint16_t pskey, uint16_t value);

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

* Re: [Bluez-devel] bccmd reading clock
  2005-06-27 22:37 [Bluez-devel] bccmd reading clock Ronny L Nilsson
@ 2005-06-28 15:42 ` Marcel Holtmann
  2005-06-29  8:26   ` Ronny L Nilsson
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2005-06-28 15:42 UTC (permalink / raw)
  To: bluez-devel

Hi Ronny,

> I was in the need for an enhancement of the bccmd tool and thus made a 
> small change. The supplied patch adds a command for reading the the 
> BT-clock of local device. In the process I also made some minor changes 
> to utils/tools/csr.c to reuse existing code. Besided reading 16-bit 
> variables it can now also read 32- and 8-bits alike.

don't do type conversion like this. Use varid_complex for it if you
wanna support uint32 and unit8 without copying code.

> No changes has (yet) been made to hcidump. Should it be done?

Of course ;)

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] bccmd reading clock
  2005-06-28 15:42 ` Marcel Holtmann
@ 2005-06-29  8:26   ` Ronny L Nilsson
  2005-07-01  8:43     ` Ronny L Nilsson
  2005-07-03 10:16     ` Marcel Holtmann
  0 siblings, 2 replies; 7+ messages in thread
From: Ronny L Nilsson @ 2005-06-29  8:26 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]


> > I was in the need for an enhancement of the bccmd tool and thus
> > made a small change. The supplied patch adds a command for reading
> > the the BT-clock of local device. In the process I also made some
> > minor changes to utils/tools/csr.c to reuse existing code. Besided
> > reading 16-bit variables it can now also read 32- and 8-bits alike.
>
> don't do type conversion like this. Use varid_complex for it if you
> wanna support uint32 and unit8 without copying code.


As you command.... :)  Perhaps like this then? Added parsing read of 
uart speed setting too. I'm a bit uncertain however of where to put 
corresponding uart config write. Both BCCMD and PSKEY seems adequate.

/Ronny








[-- Attachment #2: bccmd.patch --]
[-- Type: text/x-diff, Size: 6958 bytes --]

Index: utils/tools/bccmd.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/bccmd.c,v
retrieving revision 1.1
diff -u -p -r1.1 bccmd.c
--- utils/tools/bccmd.c	16 May 2005 11:51:27 -0000	1.1
+++ utils/tools/bccmd.c	29 Jun 2005 08:16:27 -0000
@@ -79,13 +79,110 @@ static int cmd_keylen(int dd, int argc, 
 	return 0;
 }
 
+
+
+static int cmd_clock(int dd, int argc, char *argv[])
+{
+	uint32_t clk=0;
+	int err;
+
+	err = csr_read_varid_uint32(dd, 0x2143, CSR_VARID_BT_CLOCK, &clk);
+	if (err < 0) {
+		errno = -err;
+		return -1;
+	}
+
+	printf("Device local BT-clock: 0x%x\n", clk);
+
+	return 0;
+}
+
+
+
+
+static int cmd_uart_read(int dd, int argc, char *argv[])
+{
+	uint16_t baud;
+	int err;
+
+	err = csr_read_varid_uint16(dd, 0x2145, CSR_VARID_CONFIG_UART, &baud);
+	if (err < 0) {
+		errno = -err;
+		return -1;
+	}
+
+	printf("Device UART speed: ");
+	switch(baud & CSR_UART_BAUD_MASK) {
+		case CSR_UART_BAUD_9K6:
+			printf("9600");
+			break;
+		case CSR_UART_BAUD_19K2:
+			printf("19 200");
+			break;
+		case CSR_UART_BAUD_38K4:
+			printf("38 400");
+			break;
+		case CSR_UART_BAUD_57K6:
+			printf("57 600");
+			break;
+		case CSR_UART_BAUD_115K2:
+			printf("115 200");
+			break;
+		case CSR_UART_BAUD_230K4:
+			printf("230 400");
+			break;
+		case CSR_UART_BAUD_460K8:
+			printf("460 800");
+			break;
+		case CSR_UART_BAUD_921K6:
+			printf("921 600");
+			break;
+		case 0:
+			errno = EIO;
+			return -1;
+			break;
+		default:
+			printf("%f", (double) baud * 244.140625);
+			break;		
+	}
+	printf(" bps,");	
+	switch(baud & CSR_UART_STOP_MASK) {
+		case CSR_UART_STOP1:
+			printf(" 1 stop bit,");
+			break;
+		case CSR_UART_STOP2:
+			printf(" 2 stop bits,");
+		default:
+			break;
+	}
+	switch(baud & CSR_UART_PAR_MASK) {
+		case CSR_UART_PARNONE:
+			printf(" no");
+			break;
+		case CSR_UART_PARODD:
+			printf(" odd");
+			break;
+		case CSR_UART_PAREVEN:
+			printf(" even");
+		default:
+			break;			
+	}
+	printf(" parity\n");
+	
+	return 0;
+}
+
+
+
 static struct {
 	char *str;
 	int (*func)(int dd, int argc, char **argv);
 	char *arg;
 	char *doc;
 } commands[] = {
-	{ "keylen", cmd_keylen, "<handle>", "Get current crypt key length" },
+	{ "keylen", cmd_keylen,     "<handle>", "Get current crypt key length" },
+	{ "clock", cmd_clock,       "        ", "Get local BT-clock" },
+	{ "rduart", cmd_uart_read,  "        ", "Get UART baudrate" },
 	{ NULL },
 };
 
Index: utils/tools/csr.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/csr.c,v
retrieving revision 1.27
diff -u -p -r1.27 csr.c
--- utils/tools/csr.c	10 Jun 2005 06:59:27 -0000	1.27
+++ utils/tools/csr.c	29 Jun 2005 08:16:27 -0000
@@ -449,12 +449,13 @@ int csr_read_varid_complex(int dd, uint1
 	if (hci_send_req(dd, &rq, 2000) < 0)
 		return -1;
 
-	if (rp[0] != 0xc2) {
+	if (rp[0] != 0xc2 || rp[5] != (seqnum & 0xff) || 
+			rp[6] != (seqnum >> 8)) {
 		errno = EIO;
 		return -1;
 	}
 
-	if ((rp[9] + (rp[10] << 8)) != 0) {
+	if (rp[9] || rp[10]) {
 		errno = ENXIO;
 		return -1;
 	}
@@ -464,46 +465,58 @@ int csr_read_varid_complex(int dd, uint1
 	return 0;
 }
 
-int csr_read_varid_uint16(int dd, uint16_t seqnum, uint16_t varid, uint16_t *value)
+
+int csr_read_varid_uint32(int dd, uint16_t seqnum, uint16_t varid, uint32_t *value)
 {
-	unsigned char cmd[] = { 0x00, 0x00, 0x09, 0x00,
-				seqnum & 0xff, seqnum >> 8, varid & 0xff, varid >> 8, 0x00, 0x00,
-				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+	uint8_t buf[] = { 0,0,0,0,0,0,0,0 };
+	uint32_t shft;
 
-	unsigned char cp[254], rp[254];
-	struct hci_request rq;
+	if(csr_read_varid_complex(dd, seqnum, varid, buf, sizeof(buf))==0) {
+		shft = buf[1];
+		shft <<= 8;
+		shft |= buf[0];
+		shft <<= 8;
+		shft |= buf[3];
+		shft <<= 8;
+		shft |= buf[2];
+		*value = shft;
+		return 0;
+	}
+	
+	return -1;
+}
 
-	memset(&cp, 0, sizeof(cp));
-	cp[0] = 0xc2;
-	memcpy(cp + 1, cmd, sizeof(cmd));
 
-	memset(&rq, 0, sizeof(rq));
-	rq.ogf    = OGF_VENDOR_CMD;
-	rq.ocf    = 0x00;
-	rq.event  = EVT_VENDOR;
-	rq.cparam = cp;
-	rq.clen   = sizeof(cmd) + 1;
-	rq.rparam = rp;
-	rq.rlen   = sizeof(rp);
-
-	if (hci_send_req(dd, &rq, 2000) < 0)
-		return -1;
+int csr_read_varid_uint16(int dd, uint16_t seqnum, uint16_t varid, uint16_t *value)
+{
+	uint8_t buf[] = { 0,0,0,0,0,0,0,0 };
+	uint16_t shft;
 
-	if (rp[0] != 0xc2) {
-		errno = EIO;
-		return -1;
+	if(csr_read_varid_complex(dd, seqnum, varid, buf, sizeof(buf))==0) {
+		shft = buf[1];
+		shft <<= 8;
+		shft |= buf[0];
+		*value = shft;
+		return 0;
 	}
+	
+	return -1;
+}
 
-	if ((rp[9] + (rp[10] << 8)) != 0) {
-		errno = ENXIO;
-		return -1;
-	}
 
-	*value = rp[11] + (rp[12] << 8);
+int csr_read_varid_uint8(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value)
+{
+	uint8_t buf[] = { 0,0,0,0,0,0,0,0 };
 
-	return 0;
+	if(csr_read_varid_complex(dd, seqnum, varid, buf, sizeof(buf))==0) {
+		*value = buf[1];
+		return 0;
+	}
+	
+	return -1;
 }
 
+
 int csr_read_pskey_complex(int dd, uint16_t seqnum, uint16_t pskey, uint8_t *value, uint16_t length)
 {
 	unsigned char cmd[] = { 0x00, 0x00, ((length / 2) + 8) & 0xff, ((length / 2) + 8) >> 8,
Index: utils/tools/csr.h
===================================================================
RCS file: /cvsroot/bluez/utils/tools/csr.h,v
retrieving revision 1.12
diff -u -p -r1.12 csr.h
--- utils/tools/csr.h	10 Jun 2005 05:30:28 -0000	1.12
+++ utils/tools/csr.h	29 Jun 2005 08:16:28 -0000
@@ -71,12 +71,33 @@
 #define CSR_PSKEY_USB_DFU_PRODUCT_ID		0x02cb
 #define CSR_PSKEY_INITIAL_BOOTMODE		0x03cd
 
+/* UART speeds */
+#define CSR_UART_BAUD_MASK		0x0fff
+#define CSR_UART_BAUD_9K6		0x0027
+#define CSR_UART_BAUD_19K2		0x0047
+#define CSR_UART_BAUD_38K4		0x009d
+#define CSR_UART_BAUD_57K6		0x00ec
+#define CSR_UART_BAUD_115K2		0x01d8
+#define CSR_UART_BAUD_230K4		0x03b0
+#define CSR_UART_BAUD_460K8		0x075f
+#define CSR_UART_BAUD_921K6		0x0ebf
+#define CSR_UART_STOP_MASK		0x3000
+#define CSR_UART_STOP1			0x0000
+#define CSR_UART_STOP2			0x2000
+#define CSR_UART_PAR_MASK		0xc000
+#define CSR_UART_PARNONE		0x0000
+#define CSR_UART_PARODD			0x4000
+#define CSR_UART_PAREVEN		0xc000
+
+
 char *csr_buildidtostr(uint16_t id);
 char *csr_chipvertostr(uint16_t ver, uint16_t rev);
 char *csr_pskeytostr(uint16_t pskey);
 
 int csr_read_varid_complex(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value, uint16_t length);
+int csr_read_varid_uint32(int dd, uint16_t seqnum, uint16_t varid, uint32_t *value);
 int csr_read_varid_uint16(int dd, uint16_t seqnum, uint16_t varid, uint16_t *value);
+int csr_read_varid_uint8(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value);
 int csr_read_pskey_complex(int dd, uint16_t seqnum, uint16_t pskey, uint8_t *value, uint16_t length);
 int csr_read_pskey_uint16(int dd, uint16_t seqnum, uint16_t pskey, uint16_t *value);
 int csr_write_pskey_uint16(int dd, uint16_t seqnum, uint16_t pskey, uint16_t value);

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

* Re: [Bluez-devel] bccmd reading clock
  2005-06-29  8:26   ` Ronny L Nilsson
@ 2005-07-01  8:43     ` Ronny L Nilsson
  2005-07-03 10:16     ` Marcel Holtmann
  1 sibling, 0 replies; 7+ messages in thread
From: Ronny L Nilsson @ 2005-07-01  8:43 UTC (permalink / raw)
  To: bluez-devel; +Cc: Marcel Holtmann


hi
I got no response to my revised bccmd patch
http://sourceforge.net/mailarchive/message.php?msg_id=12199652
Accepted, rejected och just delayed review?

regards
/Ronny




----------------------------------------------------------
> > > I was in the need for an enhancement of the bccmd tool and thus
> > > made a small change. The supplied patch adds a command for
> > > reading the the BT-clock of local device. In the process I also
> > > made some minor changes to utils/tools/csr.c to reuse existing
> > > code. Besided reading 16-bit variables it can now also read 32-
> > > and 8-bits alike.
> >
> > don't do type conversion like this. Use varid_complex for it if you
> > wanna support uint32 and unit8 without copying code.
>
> As you command.... :)  Perhaps like this then? Added parsing read of
> uart speed setting too. I'm a bit uncertain however of where to put
> corresponding uart config write. Both BCCMD and PSKEY seems adequate.
>
> /Ronny

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

* Re: [Bluez-devel] bccmd reading clock
  2005-06-29  8:26   ` Ronny L Nilsson
  2005-07-01  8:43     ` Ronny L Nilsson
@ 2005-07-03 10:16     ` Marcel Holtmann
  2005-07-03 16:33       ` Ronny L Nilsson
  1 sibling, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2005-07-03 10:16 UTC (permalink / raw)
  To: bluez-devel

Hi Ronny,

> > > I was in the need for an enhancement of the bccmd tool and thus
> > > made a small change. The supplied patch adds a command for reading
> > > the the BT-clock of local device. In the process I also made some
> > > minor changes to utils/tools/csr.c to reuse existing code. Besided
> > > reading 16-bit variables it can now also read 32- and 8-bits alike.
> >
> > don't do type conversion like this. Use varid_complex for it if you
> > wanna support uint32 and unit8 without copying code.
> 
> As you command.... :)  Perhaps like this then? Added parsing read of 
> uart speed setting too. I'm a bit uncertain however of where to put 
> corresponding uart config write. Both BCCMD and PSKEY seems adequate.

actually I added the clock reading support by copying the uint32 reading
command. Using the complex command needs a little bit more testing and
of course audit. The CSR BCCMD can be quite picky if you do something
wrong. I also added support for uint32 and BT_CLOCK to hcidump.

The UART config is used via BCCMD for temporary changes and via the
PSKEY for permanent changes. I didn't added it, because I don't like
mixing patches. One patch per feature.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] bccmd reading clock
  2005-07-03 10:16     ` Marcel Holtmann
@ 2005-07-03 16:33       ` Ronny L Nilsson
  2005-07-03 16:56         ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Ronny L Nilsson @ 2005-07-03 16:33 UTC (permalink / raw)
  To: bluez-devel


> actually I added the clock reading support by copying the uint32
> reading command. Using the complex command needs a little bit more
> testing and of course audit. The CSR BCCMD can be quite picky if you
> do something wrong. I also added support for uint32 and BT_CLOCK to
> hcidump.

Hi
Ok. Nice, but how can we "test" the complex command if we don't use it? 
I agree we need to be careful yes, but BCCMD works in ram only, right? 
If something goes wrong one can just do a cold reset to restore 
settings.


> The UART config is used via BCCMD for temporary changes and via the
> PSKEY for permanent changes. I didn't added it, because I don't like
> mixing patches. One patch per feature.

I understand. Besides the UART feature I've also added preliminary 
support for these additional commands:
	- Read RSSI
	- Read/write BER threshold
	- Read/write max tx power
	- Read/write default tx power
And also made a find_conn_handle() function to automatically get the 
ACL connection handle and pass it on to all the BCCMDs who needs it 
(most of them, including your "keylen" function). User can then use the 
commands simply with a <bdaddr> on the commandline instead of the 
harder to find handle. Should I send you patches for these too? Perhaps 
separated in smal chunks?


Regards
/Ronny




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] bccmd reading clock
  2005-07-03 16:33       ` Ronny L Nilsson
@ 2005-07-03 16:56         ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2005-07-03 16:56 UTC (permalink / raw)
  To: bluez-devel

Hi Ronny,

> > actually I added the clock reading support by copying the uint32
> > reading command. Using the complex command needs a little bit more
> > testing and of course audit. The CSR BCCMD can be quite picky if you
> > do something wrong. I also added support for uint32 and BT_CLOCK to
> > hcidump.
> 
> Ok. Nice, but how can we "test" the complex command if we don't use it? 
> I agree we need to be careful yes, but BCCMD works in ram only, right? 
> If something goes wrong one can just do a cold reset to restore 
> settings.

it is not about the settings. The bccmd tool must be usable all the time
without crashing the device at runtime. Feel free to send new patches
against the current CVS. I will see if I get some time to review and of
course test them.

> > The UART config is used via BCCMD for temporary changes and via the
> > PSKEY for permanent changes. I didn't added it, because I don't like
> > mixing patches. One patch per feature.
> 
> I understand. Besides the UART feature I've also added preliminary 
> support for these additional commands:
> 	- Read RSSI
> 	- Read/write BER threshold
> 	- Read/write max tx power
> 	- Read/write default tx power
> And also made a find_conn_handle() function to automatically get the 
> ACL connection handle and pass it on to all the BCCMDs who needs it 
> (most of them, including your "keylen" function). User can then use the 
> commands simply with a <bdaddr> on the commandline instead of the 
> harder to find handle. Should I send you patches for these too? Perhaps 
> separated in smal chunks?

Send small chunks and step by step. It is then easier for me to review
them and apply them. This is also better for the revision history.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2005-07-03 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-27 22:37 [Bluez-devel] bccmd reading clock Ronny L Nilsson
2005-06-28 15:42 ` Marcel Holtmann
2005-06-29  8:26   ` Ronny L Nilsson
2005-07-01  8:43     ` Ronny L Nilsson
2005-07-03 10:16     ` Marcel Holtmann
2005-07-03 16:33       ` Ronny L Nilsson
2005-07-03 16:56         ` Marcel Holtmann

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.