Tizen: Add option to disable rfkill operation 78/11178/1
authorArron Wang <arron.wang@intel.com>
Tue, 22 Oct 2013 06:06:59 +0000 (14:06 +0800)
committerArron Wang <arron.wang@intel.com>
Tue, 22 Oct 2013 06:07:17 +0000 (14:07 +0800)
In Tizen, bluetooth enable/disable operation is handled
by bluetooth framework, if the device is rfkilled, bt frwk
may failed to work
Change-Id: Ifcd06f322c7064125ea0840f3d01a653e7f32194

configure.ac
src/rfkill.c

index 2779f7e..dd4d1b2 100644 (file)
@@ -390,6 +390,13 @@ AC_ARG_ENABLE(linklocaladdr, AC_HELP_STRING([--disable-linklocaladdr],
        fi
 ])
 
+AC_ARG_ENABLE(rfkill, AC_HELP_STRING([--disable-rfkill],
+                       [disable device rfkill operation]), [
+       if (test "${enableval}" = "no"); then
+               CFLAGS="$CFLAGS -DDISABLE_RFKILL"
+       fi
+])
+
 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
                        [don't install configuration and data files]),
                                        [enable_datafiles=${enableval}])
index e21b2a1..e978d71 100644 (file)
@@ -164,6 +164,9 @@ int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block)
 
        DBG("type %d block %d", type, block);
 
+#if defined DISABLE_RFKILL
+       DBG("rfkill is disabled by default");
+#else
        rfkill_type = convert_service_type(type);
        if (rfkill_type == NUM_RFKILL_TYPES)
                return -EINVAL;
@@ -185,6 +188,7 @@ int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block)
                err = 0;
 
        close(fd);
+#endif
 
        return err;
 }