summaryrefslogtreecommitdiffstats
path: root/hcid/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-23 12:56:46 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-23 12:56:46 +0000
commitbe9b6f152b287af5fdb8df303874e7979a1cf3c1 (patch)
tree47460053ac6db4595a4f793ed86fbda130ac668d /hcid/main.c
parenta68bf12229012db176a7f0c5ae86380445e52721 (diff)
Add skeleton for SDP server integration
Diffstat (limited to 'hcid/main.c')
-rw-r--r--hcid/main.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/hcid/main.c b/hcid/main.c
index 7ea829af..30266ff7 100644
--- a/hcid/main.c
+++ b/hcid/main.c
@@ -48,6 +48,7 @@
#include "hcid.h"
#include "lib.h"
+#include "sdp.h"
struct hcid_opts hcid;
struct device_opts default_device;
@@ -537,13 +538,13 @@ extern char *optarg;
int main(int argc, char *argv[], char *env[])
{
- int daemon, dofork, opt, fd;
+ int daemon, dofork, sdp, opt, fd;
struct sockaddr_hci addr;
struct hci_filter flt;
struct sigaction sa;
GIOChannel *ctl_io;
- daemon = 1; dofork = 1;
+ daemon = 1; dofork = 1; sdp = 0;
/* Default HCId settings */
hcid.config_file = HCID_CONFIG_FILE;
@@ -558,12 +559,16 @@ int main(int argc, char *argv[], char *env[])
init_defaults();
- while ((opt = getopt(argc, argv, "f:n")) != EOF) {
+ while ((opt = getopt(argc, argv, "nsf:")) != EOF) {
switch (opt) {
case 'n':
daemon = 0;
break;
+ case 's':
+ sdp = 1;
+ break;
+
case 'f':
hcid.config_file = strdup(optarg);
break;
@@ -669,9 +674,15 @@ int main(int argc, char *argv[], char *env[])
g_io_add_watch(ctl_io, G_IO_IN, io_stack_event, NULL);
+ if (sdp)
+ start_sdp_server();
+
/* Start event processor */
g_main_run(event_loop);
+ if (sdp)
+ stop_sdp_server();
+
free_device_opts();
#ifdef ENABLE_DBUS