summaryrefslogtreecommitdiffstats
path: root/tools/bccmd.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-07-03 10:10:34 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-07-03 10:10:34 +0000
commitab788511066ea30c788d907fd44c8427f97b6e54 (patch)
treee60a414e74131d0aca444b5de6e0fb0cd96ba52c /tools/bccmd.c
parent2dd0e662aaec1ec73b7783a625c1645020dc29d7 (diff)
Add support for getting the local Bluetooth clock
Diffstat (limited to 'tools/bccmd.c')
-rw-r--r--tools/bccmd.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/bccmd.c b/tools/bccmd.c
index 4b4a1fb4..5e358b01 100644
--- a/tools/bccmd.c
+++ b/tools/bccmd.c
@@ -79,6 +79,22 @@ static int cmd_keylen(int dd, int argc, char *argv[])
return 0;
}
+static int cmd_clock(int dd, int argc, char *argv[])
+{
+ uint32_t clock = 0;
+ int err;
+
+ err = csr_read_varid_uint32(dd, 0x4711, CSR_VARID_BT_CLOCK, &clock);
+ if (err < 0) {
+ errno = -err;
+ return -1;
+ }
+
+ printf("Bluetooth clock: 0x%04x (%d)\n", clock, clock);
+
+ return 0;
+}
+
static struct {
char *str;
int (*func)(int dd, int argc, char **argv);
@@ -86,6 +102,7 @@ static struct {
char *doc;
} commands[] = {
{ "keylen", cmd_keylen, "<handle>", "Get current crypt key length" },
+ { "clock", cmd_clock, "", "Get local Bluetooth clock" },
{ NULL },
};
@@ -99,7 +116,7 @@ static void usage(void)
printf("Commands:\n");
for (i = 0; commands[i].str; i++)
- printf("\t%s\t%s\t%s\n", commands[i].str,
+ printf("\t%s\t%-8s\t%s\n", commands[i].str,
commands[i].arg, commands[i].doc);
}