summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-21 11:44:26 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-10-21 11:44:26 +0000
commit97a6bcbbe32c89438f4f54e47b376c75e2949763 (patch)
tree4c60c9a06fe42231ebd77d9189fe3954de752ab5 /tools
parent857e77d98e66a8835b0040becd5d62790aeaa696 (diff)
Allow clear text IAC values
Diffstat (limited to 'tools')
-rw-r--r--tools/hciconfig.c11
-rw-r--r--tools/hcitool.c13
2 files changed, 19 insertions, 5 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 1bf7438b..f85f5272 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -37,6 +37,7 @@
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -158,7 +159,11 @@ static void cmd_iac(int ctl, int hdev, char *opt)
if (opt) {
int l = strtoul(opt, 0, 16);
uint8_t lap[3];
- if (l < 0x9e8b00 || l > 0x9e8b3f) {
+ if (!strcasecmp(opt, "giac")) {
+ l = 0x9e8b33;
+ } else if (!strcasecmp(opt, "liac")) {
+ l = 0x9e8b00;
+ } else if (l < 0x9e8b00 || l > 0x9e8b3f) {
printf("Invalid access code 0x%x\n", l);
exit(1);
}
@@ -182,8 +187,8 @@ static void cmd_iac(int ctl, int hdev, char *opt)
for (i = 0; i < n; i++) {
printf("0x");
for (j = 3; j--; )
- printf("%02x", lap[j + 3*i]);
- if (i < n-1)
+ printf("%02x", lap[j + 3 * i]);
+ if (i < n - 1)
printf(", ");
}
printf("\n");
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 1804d9fd..75b09b77 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -38,6 +38,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include <getopt.h>
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -359,7 +360,11 @@ static void cmd_inq(int dev_id, int argc, char **argv)
case 'i':
l = strtoul(optarg, 0, 16);
- if (l < 0x9e8b00 || l > 0x9e8b3f) {
+ if (!strcasecmp(optarg, "giac")) {
+ l = 0x9e8b33;
+ } else if (!strcasecmp(optarg, "liac")) {
+ l = 0x9e8b00;
+ } if (l < 0x9e8b00 || l > 0x9e8b3f) {
printf("Invalid access code 0x%x\n", l);
exit(1);
}
@@ -447,7 +452,11 @@ static void cmd_scan(int dev_id, int argc, char **argv)
case 'i':
l = strtoul(optarg, 0, 16);
- if (l < 0x9e8b00 || l > 0x9e8b3f) {
+ if (!strcasecmp(optarg, "giac")) {
+ l = 0x9e8b33;
+ } else if (!strcasecmp(optarg, "liac")) {
+ l = 0x9e8b00;
+ } else if (l < 0x9e8b00 || l > 0x9e8b3f) {
printf("Invalid access code 0x%x\n", l);
exit(1);
}