From 959b1e8c1d5ad023e1b3c8157a844c61df44a0a1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 21:14:39 +0000 Subject: Add support for setting the inquiry mode --- hcid/hcid.h | 1 + hcid/kword.c | 1 + hcid/main.c | 9 +++++++++ hcid/parser.y | 6 +++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hcid/hcid.h b/hcid/hcid.h index 3beebd49..5523d4b7 100644 --- a/hcid/hcid.h +++ b/hcid/hcid.h @@ -43,6 +43,7 @@ struct device_opts { char *name; uint32_t class; + uint8_t inqmode; uint16_t pkt_type; uint16_t scan; uint16_t link_mode; diff --git a/hcid/kword.c b/hcid/kword.c index 41800b75..bd2294b2 100644 --- a/hcid/kword.c +++ b/hcid/kword.c @@ -59,6 +59,7 @@ struct kword cfg_keyword[] = { { "pscan", K_PSCAN }, { "name", K_NAME }, { "class", K_CLASS }, + { "inqmode", K_INQMODE }, { "auth", K_AUTH }, { "encrypt", K_ENCRYPT }, { "pin_helper", K_PINHELP }, diff --git a/hcid/main.c b/hcid/main.c index c2c6381c..45b8231d 100644 --- a/hcid/main.c +++ b/hcid/main.c @@ -242,6 +242,15 @@ static void configure_device(int hdev) CHANGE_LOCAL_NAME_CP_SIZE, (void *) &cp); } + /* Set inquiry mode */ + if (di.features[3] & LMP_RSSI_INQ) { + write_inquiry_mode_cp cp; + + cp.mode = device_opts->inqmode; + hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_INQUIRY_MODE, + WRITE_INQUIRY_MODE_CP_SIZE, (void *) &cp); + } + exit(0); } diff --git a/hcid/parser.y b/hcid/parser.y index 136a8571..3534fb2b 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_LM K_LP K_AUTH K_ENCRYPT K_ISCAN K_PSCAN +%token K_PTYPE K_NAME K_CLASS K_INQMODE K_LM K_LP K_AUTH K_ENCRYPT K_ISCAN K_PSCAN %token K_PINHELP K_DBUSPINHELP %token K_YES K_NO @@ -190,6 +190,10 @@ device_opt: parser_device->class = $2; } + | K_INQMODE NUM { + parser_device->inqmode = $2; + } + | K_AUTH bool { parser_device->auth = $2; } -- cgit