summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-11-30 05:11:19 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-11-30 05:11:19 +0000
commit7c115e06a562978ff2df7b32d7cb1aed72000a16 (patch)
tree13b98a324f329ad6039703f684e98f4576be981e
parentbd3e52e30a0529e096abb4e2429122dba22e589b (diff)
Add support for reading the full build name
-rw-r--r--tools/bccmd.c25
-rw-r--r--tools/csr.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/tools/bccmd.c b/tools/bccmd.c
index 7c1260cf..291ed6a3 100644
--- a/tools/bccmd.c
+++ b/tools/bccmd.c
@@ -337,6 +337,30 @@ static int cmd_rand(int transport, int argc, char *argv[])
return 0;
}
+static int cmd_buildname(int transport, int argc, char *argv[])
+{
+ uint8_t array[130];
+ char name[64];
+ int i, err;
+
+ OPT_HELP(0, NULL);
+
+ memset(array, 0, sizeof(array));
+
+ err = transport_read(transport, CSR_VARID_READ_BUILD_NAME, array, 128);
+ if (err < 0) {
+ errno = -err;
+ return -1;
+ }
+
+ for (i = 0; i < sizeof(name); i++)
+ name[i] = array[(i * 2) + 4];
+
+ printf("Build name: %s\n", name);
+
+ return 0;
+}
+
static int cmd_panicarg(int transport, int argc, char *argv[])
{
uint8_t array[8];
@@ -901,6 +925,7 @@ static struct {
{ "keylen", cmd_keylen, "<handle>", "Get current crypt key length" },
{ "clock", cmd_clock, "", "Get local Bluetooth clock" },
{ "rand", cmd_rand, "", "Get random number" },
+ { "buildname", cmd_buildname, "", "Get the full build name" },
{ "panicarg", cmd_panicarg, "", "Get panic code argument" },
{ "faultarg", cmd_faultarg, "", "Get fault code argument" },
{ "coldreset", cmd_coldreset, "", "Perform cold reset" },
diff --git a/tools/csr.h b/tools/csr.h
index daa2e669..9cdc7225 100644
--- a/tools/csr.h
+++ b/tools/csr.h
@@ -41,6 +41,7 @@
#define CSR_VARID_GET_CLR_EVT 0x300a /* complex */
#define CSR_VARID_GET_NEXT_BUILDDEF 0x300b /* complex */
#define CSR_VARID_PS_MEMORY_TYPE 0x3012 /* complex */
+#define CSR_VARID_READ_BUILD_NAME 0x301c /* complex */
#define CSR_VARID_COLD_RESET 0x4001 /* valueless */
#define CSR_VARID_WARM_RESET 0x4002 /* valueless */
#define CSR_VARID_COLD_HALT 0x4003 /* valueless */