summaryrefslogtreecommitdiffstats
path: root/hcid/parser.y
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-11-14 18:22:37 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-11-14 18:22:37 +0000
commit38a404ba5bfbf21d4607a5d048846288a2359c56 (patch)
treec2d2f7a9d8e5c5077e21ca2cd99d17129cd28201 /hcid/parser.y
parentfc03565db71241cbc0a47ae7528273d3982fb606 (diff)
Add offmode config option for defining SetMode("off") behaviour
Diffstat (limited to 'hcid/parser.y')
-rw-r--r--hcid/parser.y19
1 files changed, 17 insertions, 2 deletions
diff --git a/hcid/parser.y b/hcid/parser.y
index 0a162b36..890dbd3a 100644
--- a/hcid/parser.y
+++ b/hcid/parser.y
@@ -60,7 +60,7 @@ void yylex_destroy(void);
}
%token K_OPTIONS K_DEVICE
-%token K_AUTOINIT K_SECURITY K_PAIRING
+%token K_AUTOINIT K_SECURITY K_PAIRING K_OFFMODE
%token K_PTYPE K_NAME K_CLASS K_VOICE K_PAGETO K_LM K_LP K_ISCAN K_PSCAN K_DISCOVTO
%token K_PASSKEY
%token K_YES K_NO
@@ -68,7 +68,7 @@ void yylex_destroy(void);
%token <str> WORD PATH STRING LIST HCI BDADDR
%token <num> NUM
-%type <num> bool pkt_type link_mode link_policy sec_mode pair_mode
+%type <num> bool pkt_type link_mode link_policy sec_mode pair_mode off_mode
%type <str> dev_name hci bdaddr
%%
@@ -116,6 +116,10 @@ hcid_opt:
hcid.pairing = $2;
}
+ | K_OFFMODE off_mode {
+ hcid.offmode = $2;
+ }
+
| K_PASSKEY STRING {
strncpy((char *) hcid.pin_code, $2, 16);
hcid.pin_len = strlen($2);
@@ -155,6 +159,17 @@ pair_mode:
}
;
+off_mode:
+ WORD {
+ int opt = find_keyword(off_param, $1);
+ if (opt < 0) {
+ cfg_error("Unknown off mode '%s'", $1);
+ $$ = 0;
+ } else
+ $$ = opt;
+ }
+ ;
+
device_options: '{' device_opts '}';
device_opts: | device_opt ';' | error ';' | device_opts device_opt ';';