summaryrefslogtreecommitdiffstats
path: root/hcid/parser.y
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-04-25 18:59:55 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-04-25 18:59:55 +0000
commiteefb64d927b48d2de2e100b1f7ee715bf86bbb57 (patch)
treeb554c892901c0010969e21b14198cc77a6a0c78a /hcid/parser.y
parent748b15f0a5eb6c1078a4dff64604f042c48a7a4a (diff)
Add device ID support
Diffstat (limited to 'hcid/parser.y')
-rw-r--r--hcid/parser.y14
1 files changed, 11 insertions, 3 deletions
diff --git a/hcid/parser.y b/hcid/parser.y
index aa16a5c7..4641a0ac 100644
--- a/hcid/parser.y
+++ b/hcid/parser.y
@@ -62,16 +62,16 @@ void yylex_destroy(void);
}
%token K_OPTIONS K_DEVICE
-%token K_AUTOINIT K_SECURITY K_PAIRING K_OFFMODE
+%token K_AUTOINIT K_SECURITY K_PAIRING K_OFFMODE K_DEVICEID
%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
-%token <str> WORD PATH STRING LIST HCI BDADDR
+%token <str> WORD PATH STRING LIST HCI BDADDR ID
%token <num> NUM
%type <num> bool pkt_type link_mode link_policy sec_mode pair_mode off_mode
-%type <str> dev_name hci bdaddr
+%type <str> dev_name dev_id hci bdaddr
%%
config: statement | config statement;
@@ -122,6 +122,10 @@ hcid_opt:
hcid.offmode = $2;
}
+ | K_DEVICEID dev_id {
+ strncpy((char *) hcid.deviceid, $2, 15);
+ }
+
| K_PASSKEY STRING {
strncpy((char *) hcid.pin_code, $2, 16);
hcid.pin_len = strlen($2);
@@ -172,6 +176,10 @@ off_mode:
}
;
+dev_id:
+ ID {
+ }
+ ;
device_options: '{' device_opts '}';
device_opts: | device_opt ';' | error ';' | device_opts device_opt ';';