From 8bf4e7762d7839c00dec331b32b8674190e98be7 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 25 Jun 2002 18:31:56 +0000 Subject: Command parsing fix. --- tools/hciconfig.c | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 093c3100..a247e29d 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -716,32 +716,32 @@ struct { char *opt; char *doc; } command[] = { - { "up", cmd_up, 0, "Open and initialize HCI device" }, - { "down", cmd_down, 0, "Close HCI device" }, - { "reset", cmd_reset, 0, "Reset HCI device" }, - { "rstat", cmd_rstat, 0, "Reset statistic counters" }, - { "auth", cmd_auth, 0, "Enable Authentication" }, - { "noauth", cmd_auth, 0, "Disable Authentication" }, - { "encrypt",cmd_encrypt,0, "Enable Encryption" }, - { "noencrypt", cmd_encrypt, 0, "Disable Encryption" }, - { "piscan", cmd_scan, 0, "Enable Page and Inquiry scan" }, - { "noscan", cmd_scan, 0, "Disable scan" }, - { "iscan", cmd_scan, 0, "Enable Inquiry scan" }, - { "pscan", cmd_scan, 0, "Enable Page scan" }, - { "ptype", cmd_ptype, "[type]", "Get/Set default packet type" }, - { "lm", cmd_lm, "[mode]", "Get/Set default link mode" }, - { "lp", cmd_lp, "[policy]", "Get/Set default link policy" }, - { "name", cmd_name, "[name]", "Get/Set local name" }, - { "class", cmd_class, "[class]", "Get/Set class of device" }, - { "inqparms", cmd_inq_parms, "[win:int]","Get/Set inquiry scan window and interval" }, - { "pageparms", cmd_page_parms, "[win:int]","Get/Set page scan window and interval" }, - { "pageto", cmd_page_to, "[to]", "Get/Set page timeout" }, - { "aclmtu", cmd_aclmtu, "","Set ACL MTU and number of packets" }, - { "scomtu", cmd_scomtu, "","Set SCO MTU and number of packets" }, - { "features", cmd_features, 0, "Display device features" }, - { "version", cmd_version, 0, "Display version information" }, - { "revision", cmd_revision, 0, "Display revision information" }, - { NULL, NULL, 0} + { "up", cmd_up, 0, "Open and initialize HCI device" }, + { "down", cmd_down, 0, "Close HCI device" }, + { "reset", cmd_reset, 0, "Reset HCI device" }, + { "rstat", cmd_rstat, 0, "Reset statistic counters" }, + { "auth", cmd_auth, 0, "Enable Authentication" }, + { "noauth", cmd_auth, 0, "Disable Authentication" }, + { "encrypt", cmd_encrypt, 0, "Enable Encryption" }, + { "noencrypt", cmd_encrypt, 0, "Disable Encryption" }, + { "piscan", cmd_scan, 0, "Enable Page and Inquiry scan" }, + { "noscan", cmd_scan, 0, "Disable scan" }, + { "iscan", cmd_scan, 0, "Enable Inquiry scan" }, + { "pscan", cmd_scan, 0, "Enable Page scan" }, + { "ptype", cmd_ptype, "[type]", "Get/Set default packet type" }, + { "lm", cmd_lm, "[mode]", "Get/Set default link mode" }, + { "lp", cmd_lp, "[policy]", "Get/Set default link policy" }, + { "name", cmd_name, "[name]", "Get/Set local name" }, + { "class", cmd_class, "[class]", "Get/Set class of device" }, + { "inqparms", cmd_inq_parms, "[win:int]", "Get/Set inquiry scan window and interval" }, + { "pageparms", cmd_page_parms, "[win:int]", "Get/Set page scan window and interval" }, + { "pageto", cmd_page_to, "[to]", "Get/Set page timeout" }, + { "aclmtu", cmd_aclmtu, "", "Set ACL MTU and number of packets" }, + { "scomtu", cmd_scomtu, "", "Set SCO MTU and number of packets" }, + { "features", cmd_features, 0, "Display device features" }, + { "version", cmd_version, 0, "Display version information" }, + { "revision", cmd_revision, 0, "Display revision information" }, + { NULL, NULL, 0 } }; void usage(void) @@ -807,7 +807,7 @@ int main(int argc, char **argv, char **env) while (argc > 0) { for (i=0; command[i].cmd; i++) { - if (strncmp(command[i].cmd, *argv, 4)) + if (strncmp(command[i].cmd, *argv, 5)) continue; if (command[i].opt) { -- cgit