* [Bluez-users] Bccmd patch
@ 2006-06-19 16:16 Brand, Chris
2006-06-19 18:09 ` Marcel Holtmann
0 siblings, 1 reply; 10+ messages in thread
From: Brand, Chris @ 2006-06-19 16:16 UTC (permalink / raw)
To: bluez-users
I didn't see any response to this patch - resending to ensure that it
didn't get missed.
I discovered a couple of things :
1. bccmd has some nice features that aren't mentioned in its "usages".
2. bccmd psset didn't work for keys with a size > 32 bits (because the
OPT_PSKEY macro returned an error if you specified more than one value
for the key, but it expected a list of bytes if the length is more than
1 or 2).
Here's a patch (against bluez-utils version 2.25) :
--- bccmd.c.old 2006-04-08 00:01:10.000000000 +0000
+++ bccmd.c 2006-04-10 19:21:13.000000000 +0000
@@ -199,9 +209,9 @@
}
}
-#define OPT_RANGE(range) \
- if (argc < (range)) { errno = EINVAL; return -1; } \
- if (argc > (range)) { errno = E2BIG; return -1; }
+#define OPT_RANGE(min, max) \
+ if (argc < (min)) { errno = EINVAL; return -1; } \
+ if (argc > (max)) { errno = E2BIG; return -1; }
static struct option help_options[] = {
{ "help", 0, 0, 'h' },
@@ -227,7 +237,7 @@
#define OPT_HELP(range, help) \
opt_help(argc, argv, (help)); \
argc -= optind; argv += optind; optind = 0; \
- OPT_RANGE((range))
+ OPT_RANGE((range), (range))
static int cmd_builddef(int transport, int argc, char *argv[])
{
@@ -510,10 +520,10 @@
return optind;
}
-#define OPT_PSKEY(range, stores, reset, help) \
+#define OPT_PSKEY(min, max, stores, reset, help) \
opt_pskey(argc, argv, (stores), (reset), (help)); \
argc -= optind; argv += optind; optind = 0; \
- OPT_RANGE((range))
+ OPT_RANGE((min), (max))
static int cmd_psget(int transport, int argc, char *argv[])
{
@@ -524,7 +534,7 @@
memset(array, 0, sizeof(array));
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey = atoi(argv[0]);
@@ -599,7 +609,7 @@
memset(array, 0, sizeof(array));
- OPT_PSKEY(2, &stores, &reset, NULL);
+ OPT_PSKEY(2, 81, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey = atoi(argv[0]);
@@ -702,7 +712,7 @@
uint16_t pskey, stores = CSR_STORES_PSRAM;
int i, err, reset = 0;
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey = atoi(argv[0]);
@@ -739,7 +749,7 @@
uint16_t pskey = 0x0000, length, stores = CSR_STORES_DEFAULT;
int err, reset = 0;
- OPT_PSKEY(0, &stores, &reset, NULL);
+ OPT_PSKEY(0, 0, &stores, &reset, NULL);
while (1) {
memset(array, 0, sizeof(array));
@@ -785,7 +795,7 @@
char *str, val[7];
int i, err, reset = 0;
- OPT_PSKEY(0, &stores, &reset, NULL);
+ OPT_PSKEY(0, 0, &stores, &reset, NULL);
while (1) {
memset(array, 0, sizeof(array));
@@ -854,7 +864,7 @@
char *str, val[7];
int err, reset = 0;
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
psr_read(argv[0]);
@@ -933,13 +943,13 @@
{ "disabletx", cmd_disabletx, "", "Disable TX on the device" },
{ "enabletx", cmd_enabletx, "", "Enable TX on the device" },
{ "memtypes", cmd_memtypes, NULL, "Get memory types" },
- { "psget", cmd_psget, "<key>", "Get value for PS key" },
- { "psset", cmd_psset, "<key> <value>", "Set value for PS key" },
- { "psclr", cmd_psclr, "<key>", "Clear value for PS key" },
- { "pslist", cmd_pslist, NULL, "List all PS keys" },
- { "psread", cmd_psread, NULL, "Read all PS keys" },
- { "psload", cmd_psload, "<file>", "Load all PS keys from PSR file" },
- { "pscheck", cmd_pscheck, "<file>", "Check PSR file" },
+ { "psget", cmd_psget, "[-r] [-s <store>] <key>", "Get value for PS
key" },
+ { "psset", cmd_psset, "[-r] [-s <store>] <key> <value>", "Set value
for PS key" },
+ { "psclr", cmd_psclr, "[-r] [-s <store>] <key>", "Clear value for PS
key" },
+ { "pslist", cmd_pslist, "[-r] [-s <store>]", "List all PS keys" },
+ { "psread", cmd_psread, "[-r] [-s <store>]", "Read all PS keys" },
+ { "psload", cmd_psload, "[-r] [-s <store>] <file>", "Load all PS keys
from PSR file" },
+ { "pscheck", cmd_pscheck, "[-r] [-s <store>] <file>", "Check PSR file"
},
{ NULL }
};
@@ -977,6 +987,7 @@
}
}
printf("\n");
+ printf("\tor by hex value\n");
}
static struct option main_options[] = {
--
Chris Brand
Senior Software Engineer
WideRay
604-233-1105
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Bluez-users] Bccmd patch
2006-06-19 16:16 [Bluez-users] Bccmd patch Brand, Chris
@ 2006-06-19 18:09 ` Marcel Holtmann
2006-06-19 18:32 ` Brand, Chris
0 siblings, 1 reply; 10+ messages in thread
From: Marcel Holtmann @ 2006-06-19 18:09 UTC (permalink / raw)
To: BlueZ users
Hi Chris,
> I didn't see any response to this patch - resending to ensure that it
> didn't get missed.
>
> I discovered a couple of things :
> 1. bccmd has some nice features that aren't mentioned in its "usages".
> 2. bccmd psset didn't work for keys with a size > 32 bits (because the
> OPT_PSKEY macro returned an error if you specified more than one value
> for the key, but it expected a list of bytes if the length is more than
> 1 or 2).
>
> Here's a patch (against bluez-utils version 2.25) :
please create a patch against the latest CVS (or bluez-utils-3.1) and
attach it. Your mail client is messing up whitespaces and newlines.
Regards
Marcel
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Bluez-users] Bccmd patch
2006-06-19 18:09 ` Marcel Holtmann
@ 2006-06-19 18:32 ` Brand, Chris
2006-06-20 9:50 ` Marcel Holtmann
0 siblings, 1 reply; 10+ messages in thread
From: Brand, Chris @ 2006-06-19 18:32 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1: Type: text/plain, Size: 138 bytes --]
> please create a patch against the latest CVS (or
> bluez-utils-3.1) and attach it.
Here it is against bluez-utils-3.1
Chris
[-- Attachment #2: bccmd.patch --]
[-- Type: application/octet-stream, Size: 4141 bytes --]
--- bluez-utils-3.1/tools/bccmd.c.orig 2006-06-19 11:16:40.000000000 -0700
+++ bluez-utils-3.1/tools/bccmd.c 2006-06-19 11:24:14.000000000 -0700
@@ -199,9 +199,9 @@
}
}
-#define OPT_RANGE(range) \
- if (argc < (range)) { errno = EINVAL; return -1; } \
- if (argc > (range)) { errno = E2BIG; return -1; }
+#define OPT_RANGE(min, max) \
+ if (argc < (min)) { errno = EINVAL; return -1; } \
+ if (argc > (max)) { errno = E2BIG; return -1; }
static struct option help_options[] = {
{ "help", 0, 0, 'h' },
@@ -227,7 +227,7 @@
#define OPT_HELP(range, help) \
opt_help(argc, argv, (help)); \
argc -= optind; argv += optind; optind = 0; \
- OPT_RANGE((range))
+ OPT_RANGE((range), (range))
static int cmd_builddef(int transport, int argc, char *argv[])
{
@@ -564,10 +564,10 @@
return optind;
}
-#define OPT_PSKEY(range, stores, reset, help) \
+#define OPT_PSKEY(min, max, stores, reset, help) \
opt_pskey(argc, argv, (stores), (reset), (help)); \
argc -= optind; argv += optind; optind = 0; \
- OPT_RANGE((range))
+ OPT_RANGE((min), (max))
static int cmd_psget(int transport, int argc, char *argv[])
{
@@ -578,7 +578,7 @@
memset(array, 0, sizeof(array));
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey = atoi(argv[0]);
@@ -653,7 +653,7 @@
memset(array, 0, sizeof(array));
- OPT_PSKEY(2, &stores, &reset, NULL);
+ OPT_PSKEY(2, 81, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey = atoi(argv[0]);
@@ -756,7 +756,7 @@
uint16_t pskey, stores = CSR_STORES_PSRAM;
int i, err, reset = 0;
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey = atoi(argv[0]);
@@ -793,7 +793,7 @@
uint16_t pskey = 0x0000, length, stores = CSR_STORES_DEFAULT;
int err, reset = 0;
- OPT_PSKEY(0, &stores, &reset, NULL);
+ OPT_PSKEY(0, 0, &stores, &reset, NULL);
while (1) {
memset(array, 0, sizeof(array));
@@ -839,7 +839,7 @@
char *str, val[7];
int i, err, reset = 0;
- OPT_PSKEY(0, &stores, &reset, NULL);
+ OPT_PSKEY(0, 0, &stores, &reset, NULL);
while (1) {
memset(array, 0, sizeof(array));
@@ -908,7 +908,7 @@
char *str, val[7];
int err, reset = 0;
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
psr_read(argv[0]);
@@ -990,13 +990,13 @@
{ "hoppingon", cmd_hoppingon, "", "Revert to channel hopping" },
{ "rttxdata1", cmd_rttxdata1, "<freq> <level>","TXData1 radio test" },
{ "memtypes", cmd_memtypes, NULL, "Get memory types" },
- { "psget", cmd_psget, "<key>", "Get value for PS key" },
- { "psset", cmd_psset, "<key> <value>", "Set value for PS key" },
- { "psclr", cmd_psclr, "<key>", "Clear value for PS key" },
- { "pslist", cmd_pslist, NULL, "List all PS keys" },
- { "psread", cmd_psread, NULL, "Read all PS keys" },
- { "psload", cmd_psload, "<file>", "Load all PS keys from PSR file" },
- { "pscheck", cmd_pscheck, "<file>", "Check PSR file" },
+ { "psget", cmd_psget, "[-r] [-s store] <key>", "Get value for PS key" },
+ { "psset", cmd_psset, "[-r] [-s store] <key> <value>", "Set value for PS key" },
+ { "psclr", cmd_psclr, "[-r] [-s store] <key>", "Clear value for PS key" },
+ { "pslist", cmd_pslist, "[-r] [-s store]", "List all PS keys" },
+ { "psread", cmd_psread, "[-r] [-s store]", "Read all PS keys" },
+ { "psload", cmd_psload, "[-r] [-s store] <file>", "Load all PS keys from PSR file" },
+ { "pscheck", cmd_pscheck, "[-r] [-s store] <file>", "Check PSR file" },
{ NULL }
};
@@ -1033,7 +1033,7 @@
pos = 0;
}
}
- printf("\n");
+ printf("\tor by hex value\n");
}
static struct option main_options[] = {
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Bluez-users] Bccmd patch
2006-06-19 18:32 ` Brand, Chris
@ 2006-06-20 9:50 ` Marcel Holtmann
2006-06-20 12:08 ` Sumeet VERMA
2006-06-20 18:19 ` Brand, Chris
0 siblings, 2 replies; 10+ messages in thread
From: Marcel Holtmann @ 2006-06-20 9:50 UTC (permalink / raw)
To: BlueZ users
Hi Chris,
> > please create a patch against the latest CVS (or
> > bluez-utils-3.1) and attach it.
>
> Here it is against bluez-utils-3.1
I applied the OPT_RANGE changes, but I didn't apply the usage() change.
Please update the manpage to include them there. It is a better place.
Regards
Marcel
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Bluez-users] Bccmd patch
2006-06-20 9:50 ` Marcel Holtmann
@ 2006-06-20 12:08 ` Sumeet VERMA
2006-06-20 18:19 ` Brand, Chris
1 sibling, 0 replies; 10+ messages in thread
From: Sumeet VERMA @ 2006-06-20 12:08 UTC (permalink / raw)
To: 'BlueZ users'
Hi Marcel
I am unable to access CVS from my PC. Is there some other way to download
the package which does not have a check for dbus.
Thanks in Advance,
Sumeet
-----Original Message-----
From: bluez-users-bounces@lists.sourceforge.net
[mailto:bluez-users-bounces@lists.sourceforge.net] On Behalf Of Marcel
Holtmann
Sent: Tuesday, June 20, 2006 3:20 PM
To: BlueZ users
Subject: Re: [Bluez-users] Bccmd patch
Hi Chris,
> > please create a patch against the latest CVS (or
> > bluez-utils-3.1) and attach it.
>
> Here it is against bluez-utils-3.1
I applied the OPT_RANGE changes, but I didn't apply the usage() change.
Please update the manpage to include them there. It is a better place.
Regards
Marcel
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Bluez-users] Bccmd patch
2006-06-20 9:50 ` Marcel Holtmann
2006-06-20 12:08 ` Sumeet VERMA
@ 2006-06-20 18:19 ` Brand, Chris
2006-06-26 12:23 ` Marcel Holtmann
1 sibling, 1 reply; 10+ messages in thread
From: Brand, Chris @ 2006-06-20 18:19 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
> I applied the OPT_RANGE changes, but I didn't apply the
> usage() change.
I would have thought that it should be in both the manpage and the
usage.
> Please update the manpage to include them there.
Patch attached (against 3.1).
Chris
[-- Attachment #2: bccmd_man.patch --]
[-- Type: application/octet-stream, Size: 1756 bytes --]
--- bluez-utils-3.1/tools/bccmd.8.orig 2006-06-20 11:04:07.000000000 -0700
+++ bluez-utils-3.1/tools/bccmd.8 2006-06-20 11:15:44.000000000 -0700
@@ -1,4 +1,4 @@
-.TH BCCMD 8 "Dec 6 2005" BlueZ "Linux System Administration"
+.TH BCCMD 8 "Jun 20 2006" BlueZ "Linux System Administration"
.SH NAME
bccmd \- Utility for the CSR BCCMD interface
.SH SYNOPSIS
@@ -87,30 +87,37 @@
.BI memtypes
Get memory types
.TP
-.BI psget\ <key>
-Get value for PS key
-.TP
-.BI psset\ <key>\ <value>
-Set value for PS key
-.TP
-.BI psclr\ <key>
-Clear value for PS key
-.TP
-.BI pslist
-List all PS keys
-.TP
-.BI psread
-Read all PS keys
-.TP
-.BI psload\ <file>
-Load all PS keys from PSR file
-.TP
-.BI pscheck\ <file>
-Check syntax of PSR file
+.BI psget\ [-r]\ [-s\ <store>]\ <key>
+Get value for PS key.
+-r sends a warm reset afterwards
+.TP
+.BI psset\ [-r]\ [-s\ <store>]\ <key>\ <value>
+Set value for PS key.
+-r sends a warm reset afterwards
+.TP
+.BI psclr\ [-r]\ [-s\ <store>]\ <key>
+Clear value for PS key.
+-r sends a warm reset afterwards
+.TP
+.BI pslist\ [-r]\ [-s\ <store>]
+List all PS keys.
+-r sends a warm reset afterwards
+.TP
+.BI psread\ [-r]\ [-s\ <store>]
+Read all PS keys.
+-r sends a warm reset afterwards
+.TP
+.BI psload\ [-r]\ [-s\ <store>]\ <file>
+Load all PS keys from PSR file.
+-r sends a warm reset afterwards
+.TP
+.BI pscheck\ [-r]\ [-s\ <store>]\ <file>
+Check syntax of PSR file.
+-r sends a warm reset afterwards
.SH KEYS
bdaddr country devclass keymin keymax features commands version
remver hciextn mapsco baudrate hostintf anafreq anaftrim usbvid
-usbpid dfupid bootmode
+usbpid dfupid bootmode or hex value
.SH AUTHORS
Written by Marcel Holtmann <marcel@holtmann.org>,
man page by Adam Laurie <adam@algroup.co.uk>
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Bluez-users] Bccmd patch
2006-06-20 18:19 ` Brand, Chris
@ 2006-06-26 12:23 ` Marcel Holtmann
2006-07-05 18:46 ` [Bluez-users] [PATCH] " Brand, Chris
2006-07-13 16:13 ` [Bluez-users] [PATCH] Bccmd patch - resend Brand, Chris
0 siblings, 2 replies; 10+ messages in thread
From: Marcel Holtmann @ 2006-06-26 12:23 UTC (permalink / raw)
To: BlueZ users
Hi Chris,
> I would have thought that it should be in both the manpage and the
> usage.
the bccmd is a dangerous tool and I prefer people think twice before
they actually use it. So they have at least to read the manual page
first before they are going to render their devices useless.
> > Please update the manpage to include them there.
>
> Patch attached (against 3.1).
The patch has been applied to the CVS. Do you mind adding some
explanation of the possible stores shortcuts?
Regards
Marcel
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Bluez-users] [PATCH] Bccmd patch
2006-06-26 12:23 ` Marcel Holtmann
@ 2006-07-05 18:46 ` Brand, Chris
2006-07-13 16:13 ` [Bluez-users] [PATCH] Bccmd patch - resend Brand, Chris
1 sibling, 0 replies; 10+ messages in thread
From: Brand, Chris @ 2006-07-05 18:46 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
Marcel wrote :
> Do you mind adding
> some explanation of the possible stores shortcuts?
Finally done. Patch attached (against 3.1 with my last patch applied, so
I think it will apply cleanly against the CVS head).
Chris
[-- Attachment #2: stores.patch --]
[-- Type: application/octet-stream, Size: 635 bytes --]
--- bluez-utils-3.1/tools/bccmd.8.orig 2006-07-05 18:28:18.000000000 +0000
+++ bluez-utils-3.1/tools/bccmd.8 2006-07-05 18:38:59.000000000 +0000
@@ -117,8 +117,15 @@
.SH KEYS
bdaddr country devclass keymin keymax features commands version
remver hciextn mapsco baudrate hostintf anafreq anaftrim usbvid
-usbpid dfupid bootmode or hex value
+usbpid dfupid bootmode
+.PP
+or hex value
+.SH STORES
+default implementation factory rom ram psi psf psrom psram
+.PP
+or hex value
.SH AUTHORS
Written by Marcel Holtmann <marcel@holtmann.org>,
man page by Adam Laurie <adam@algroup.co.uk>
+and Chris Brand <chris.brand@wideray.com>
.PP
[-- Attachment #3: Type: text/plain, Size: 299 bytes --]
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Bluez-users] [PATCH] Bccmd patch - resend
2006-06-26 12:23 ` Marcel Holtmann
2006-07-05 18:46 ` [Bluez-users] [PATCH] " Brand, Chris
@ 2006-07-13 16:13 ` Brand, Chris
1 sibling, 0 replies; 10+ messages in thread
From: Brand, Chris @ 2006-07-13 16:13 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
I didn't see an ACK for this, so I'm resending...
Marcel wrote :
> Do you mind adding
> some explanation of the possible stores shortcuts?
Finally done. Patch attached (against 3.1 with my last patch applied, so
I think it will apply cleanly against the CVS head).
Chris
[-- Attachment #2: stores.patch --]
[-- Type: application/octet-stream, Size: 635 bytes --]
--- bluez-utils-3.1/tools/bccmd.8.orig 2006-07-05 18:28:18.000000000 +0000
+++ bluez-utils-3.1/tools/bccmd.8 2006-07-05 18:38:59.000000000 +0000
@@ -117,8 +117,15 @@
.SH KEYS
bdaddr country devclass keymin keymax features commands version
remver hciextn mapsco baudrate hostintf anafreq anaftrim usbvid
-usbpid dfupid bootmode or hex value
+usbpid dfupid bootmode
+.PP
+or hex value
+.SH STORES
+default implementation factory rom ram psi psf psrom psram
+.PP
+or hex value
.SH AUTHORS
Written by Marcel Holtmann <marcel@holtmann.org>,
man page by Adam Laurie <adam@algroup.co.uk>
+and Chris Brand <chris.brand@wideray.com>
.PP
[-- Attachment #3: Type: text/plain, Size: 375 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bluez-users] Bccmd patch
@ 2006-04-13 20:40 Brand, Chris
0 siblings, 0 replies; 10+ messages in thread
From: Brand, Chris @ 2006-04-13 20:40 UTC (permalink / raw)
To: bluez-users
I discovered a couple of things :
1. bccmd has some nice features that aren't mentioned in its "usages".
2. bccmd psset didn't work for keys with a size > 32 bits (because the
OPT_PSKEY macro returned an error if you specified more than one value
for the key, but it expected a list of bytes if the length is more than
1 or 2).
=20
Here's a patch (against bluez-utils version 2.25) :
--- bccmd.c.old 2006-04-08 00:01:10.000000000 +0000
+++ bccmd.c 2006-04-10 19:21:13.000000000 +0000
@@ -199,9 +209,9 @@
}
}
-#define OPT_RANGE(range) \
- if (argc < (range)) { errno =3D EINVAL; return -1; } \
- if (argc > (range)) { errno =3D E2BIG; return -1; }
+#define OPT_RANGE(min, max) \
+ if (argc < (min)) { errno =3D EINVAL; return -1; } \
+ if (argc > (max)) { errno =3D E2BIG; return -1; }
static struct option help_options[] =3D {
{ "help", 0, 0, 'h' },
@@ -227,7 +237,7 @@
#define OPT_HELP(range, help) \
opt_help(argc, argv, (help)); \
argc -=3D optind; argv +=3D optind; optind =3D 0; \
- OPT_RANGE((range))
+ OPT_RANGE((range), (range))
static int cmd_builddef(int transport, int argc, char *argv[])
{
@@ -510,10 +520,10 @@
return optind;
}
-#define OPT_PSKEY(range, stores, reset, help) \
+#define OPT_PSKEY(min, max, stores, reset, help) \
opt_pskey(argc, argv, (stores), (reset), (help)); \
argc -=3D optind; argv +=3D optind; optind =3D 0; \
- OPT_RANGE((range))
+ OPT_RANGE((min), (max))
static int cmd_psget(int transport, int argc, char *argv[])
{
@@ -524,7 +534,7 @@
memset(array, 0, sizeof(array));
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey =3D atoi(argv[0]);
@@ -599,7 +609,7 @@
memset(array, 0, sizeof(array));
- OPT_PSKEY(2, &stores, &reset, NULL);
+ OPT_PSKEY(2, 81, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey =3D atoi(argv[0]);
@@ -702,7 +712,7 @@
uint16_t pskey, stores =3D CSR_STORES_PSRAM;
int i, err, reset =3D 0;
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
pskey =3D atoi(argv[0]);
@@ -739,7 +749,7 @@
uint16_t pskey =3D 0x0000, length, stores =3D CSR_STORES_DEFAULT;
int err, reset =3D 0;
- OPT_PSKEY(0, &stores, &reset, NULL);
+ OPT_PSKEY(0, 0, &stores, &reset, NULL);
while (1) {
memset(array, 0, sizeof(array));
@@ -785,7 +795,7 @@
char *str, val[7];
int i, err, reset =3D 0;
- OPT_PSKEY(0, &stores, &reset, NULL);
+ OPT_PSKEY(0, 0, &stores, &reset, NULL);
while (1) {
memset(array, 0, sizeof(array));
@@ -854,7 +864,7 @@
char *str, val[7];
int err, reset =3D 0;
- OPT_PSKEY(1, &stores, &reset, NULL);
+ OPT_PSKEY(1, 1, &stores, &reset, NULL);
psr_read(argv[0]);
@@ -933,13 +943,13 @@
{ "disabletx", cmd_disabletx, "", "Disable TX on the device" },
{ "enabletx", cmd_enabletx, "", "Enable TX on the device" },
{ "memtypes", cmd_memtypes, NULL, "Get memory types" },
- { "psget", cmd_psget, "<key>", "Get value for PS key" },
- { "psset", cmd_psset, "<key> <value>", "Set value for PS key" },
- { "psclr", cmd_psclr, "<key>", "Clear value for PS key" },
- { "pslist", cmd_pslist, NULL, "List all PS keys" },
- { "psread", cmd_psread, NULL, "Read all PS keys" },
- { "psload", cmd_psload, "<file>", "Load all PS keys from PSR file" },
- { "pscheck", cmd_pscheck, "<file>", "Check PSR file" },
+ { "psget", cmd_psget, "[-r] [-s <store>] <key>", "Get value for PS
key" },
+ { "psset", cmd_psset, "[-r] [-s <store>] <key> <value>", "Set value
for PS key" },
+ { "psclr", cmd_psclr, "[-r] [-s <store>] <key>", "Clear value for PS
key" },
+ { "pslist", cmd_pslist, "[-r] [-s <store>]", "List all PS keys" },
+ { "psread", cmd_psread, "[-r] [-s <store>]", "Read all PS keys" },
+ { "psload", cmd_psload, "[-r] [-s <store>] <file>", "Load all PS keys
from PSR file" },
+ { "pscheck", cmd_pscheck, "[-r] [-s <store>] <file>", "Check PSR file"
},
{ NULL }
};
@@ -977,6 +987,7 @@
}
}
printf("\n");
+ printf("\tor by hex value\n");
}
static struct option main_options[] =3D {
--=20
Chris Brand
Senior Software Engineer
WideRay
604-233-1105
=20
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-07-13 16:13 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-19 16:16 [Bluez-users] Bccmd patch Brand, Chris
2006-06-19 18:09 ` Marcel Holtmann
2006-06-19 18:32 ` Brand, Chris
2006-06-20 9:50 ` Marcel Holtmann
2006-06-20 12:08 ` Sumeet VERMA
2006-06-20 18:19 ` Brand, Chris
2006-06-26 12:23 ` Marcel Holtmann
2006-07-05 18:46 ` [Bluez-users] [PATCH] " Brand, Chris
2006-07-13 16:13 ` [Bluez-users] [PATCH] Bccmd patch - resend Brand, Chris
-- strict thread matches above, loose matches on Subject: below --
2006-04-13 20:40 [Bluez-users] Bccmd patch Brand, Chris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).