summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-05-06 13:51:17 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-05-06 13:51:17 +0000
commit8d07fe695736cfc4126f1aad4144303161c61e21 (patch)
treef89f89dcdc4624f2be964d90e4737b1338075d84 /hcid
parentcc2dd8a3670f68984f324d6861a344cb68728a1a (diff)
Add support for the page timeout config option
Diffstat (limited to 'hcid')
-rw-r--r--hcid/hcid.h2
-rw-r--r--hcid/kword.c1
-rw-r--r--hcid/main.c17
-rw-r--r--hcid/parser.y7
4 files changed, 22 insertions, 5 deletions
diff --git a/hcid/hcid.h b/hcid/hcid.h
index e275939f..c64016ea 100644
--- a/hcid/hcid.h
+++ b/hcid/hcid.h
@@ -45,6 +45,7 @@ enum {
HCID_SET_CLASS,
HCID_SET_VOICE,
HCID_SET_INQMODE,
+ HCID_SET_PAGETO,
HCID_SET_PTYPE,
HCID_SET_LM,
HCID_SET_LP,
@@ -56,6 +57,7 @@ struct device_opts {
uint32_t class;
uint16_t voice;
uint8_t inqmode;
+ uint16_t pageto;
uint16_t pkt_type;
uint16_t link_mode;
uint16_t link_policy;
diff --git a/hcid/kword.c b/hcid/kword.c
index 51c92e1d..30db2da0 100644
--- a/hcid/kword.c
+++ b/hcid/kword.c
@@ -61,6 +61,7 @@ struct kword cfg_keyword[] = {
{ "class", K_CLASS },
{ "voice", K_VOICE },
{ "inqmode", K_INQMODE },
+ { "pageto", K_PAGETO },
{ "auth", K_AUTH },
{ "encrypt", K_ENCRYPT },
{ "pin_helper", K_PINHELP },
diff --git a/hcid/main.c b/hcid/main.c
index f4736940..57637f3e 100644
--- a/hcid/main.c
+++ b/hcid/main.c
@@ -229,7 +229,7 @@ static void configure_device(int hdev)
expand_name(cp.name, sizeof(cp.name), device_opts->name, hdev);
hci_send_cmd(s, OGF_HOST_CTL, OCF_CHANGE_LOCAL_NAME,
- CHANGE_LOCAL_NAME_CP_SIZE, (void *) &cp);
+ CHANGE_LOCAL_NAME_CP_SIZE, &cp);
}
/* Set device class */
@@ -239,7 +239,7 @@ static void configure_device(int hdev)
memcpy(cp.dev_class, &class, 3);
hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_CLASS_OF_DEV,
- WRITE_CLASS_OF_DEV_CP_SIZE, (void *) &cp);
+ WRITE_CLASS_OF_DEV_CP_SIZE, &cp);
}
/* Set voice setting */
@@ -248,7 +248,7 @@ static void configure_device(int hdev)
cp.voice_setting = htobl(device_opts->voice);
hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_VOICE_SETTING,
- WRITE_VOICE_SETTING_CP_SIZE, (void *) &cp);
+ WRITE_VOICE_SETTING_CP_SIZE, &cp);
}
/* Set inquiry mode */
@@ -258,7 +258,16 @@ static void configure_device(int hdev)
cp.mode = device_opts->inqmode;
hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_INQUIRY_MODE,
- WRITE_INQUIRY_MODE_CP_SIZE, (void *) &cp);
+ WRITE_INQUIRY_MODE_CP_SIZE, &cp);
+ }
+
+ /* Set page timeout */
+ if ((device_opts->flags & (1 << HCID_SET_PAGETO))) {
+ write_page_timeout_cp cp;
+
+ cp.timeout = htobs(device_opts->pageto);
+ hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_PAGE_TIMEOUT,
+ WRITE_PAGE_TIMEOUT_CP_SIZE, &cp);
}
exit(0);
diff --git a/hcid/parser.y b/hcid/parser.y
index a0eb13de..7616ab56 100644
--- a/hcid/parser.y
+++ b/hcid/parser.y
@@ -64,7 +64,7 @@ int yyerror(char *s);
%token K_OPTIONS K_DEVICE
%token K_AUTOINIT K_SECURITY K_PAIRING
-%token K_PTYPE K_NAME K_CLASS K_VOICE K_INQMODE K_LM K_LP K_AUTH K_ENCRYPT K_ISCAN K_PSCAN
+%token K_PTYPE K_NAME K_CLASS K_VOICE K_INQMODE K_PAGETO K_LM K_LP K_AUTH K_ENCRYPT K_ISCAN K_PSCAN
%token K_PINHELP K_DBUSPINHELP
%token K_YES K_NO
@@ -205,6 +205,11 @@ device_opt:
parser_device->inqmode = $2;
}
+ | K_PAGETO NUM {
+ parser_device->flags |= (1 << HCID_SET_PAGETO);
+ parser_device->pageto = $2;
+ }
+
| K_AUTH bool {
parser_device->auth = $2;
}