summaryrefslogtreecommitdiffstats
path: root/hcid/main.c
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-07-18 18:12:46 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-07-18 18:12:46 +0000
commitc5dca08e234386563667e8f790b4e1122c364c5d (patch)
tree8d87f52a29142b96b243e3a8e52def40ab7c2cd8 /hcid/main.c
parent99148a336433ac48bd8dc1fb23f4dc7cbf8c812e (diff)
Support for multiple pairing modes.
Link key replacement.
Diffstat (limited to 'hcid/main.c')
-rw-r--r--hcid/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hcid/main.c b/hcid/main.c
index 37e6cf65..8a5371e5 100644
--- a/hcid/main.c
+++ b/hcid/main.c
@@ -249,7 +249,12 @@ static void init_defaults(void)
static void sig_usr1(int sig)
{
- flush_link_keys();
+ toggle_pairing(0);
+}
+
+static void sig_usr2(int sig)
+{
+ toggle_pairing(1);
}
static void sig_term(int sig)
@@ -357,6 +362,8 @@ int main(int argc, char *argv[], char *env[])
/* Default HCId settings */
hcid.config_file = HCID_CONFIG_FILE;
hcid.host_name = get_host_name();
+ hcid.security = HCID_SEC_AUTO;
+ hcid.pairing = HCID_PAIRING_MULTI;
hcid.pin_file = strdup(HCID_PIN_FILE);
hcid.pin_helper = strdup(HCID_PIN_HELPER);
@@ -412,6 +419,8 @@ int main(int argc, char *argv[], char *env[])
sigaction(SIGHUP, &sa, NULL);
sa.sa_handler = sig_usr1;
sigaction(SIGUSR1, &sa, NULL);
+ sa.sa_handler = sig_usr2;
+ sigaction(SIGUSR2, &sa, NULL);
sa.sa_handler = SIG_IGN;
sigaction(SIGCHLD, &sa, NULL);