Migrate insmod logic into bt-stack-up.service 91/192391/1 accepted/tizen/unified/20181109.062817 submit/tizen/20181106.081159 submit/tizen/20181108.005303 submit/tizen/20181108.070422
authorWootak Jung <wootak.jung@samsung.com>
Mon, 5 Nov 2018 08:03:19 +0000 (17:03 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 5 Nov 2018 08:10:47 +0000 (17:10 +0900)
insmod logic should be executed before bt-stack-up.sh logic. But,
insmod logic has been executed after bt-stack-up.sh logic on ARTIK530.
This patch migrates insmod logic into bt-stack-up.sh and creates bt-stack-up.service
This patch should be merged with bluetooth-tools.

Change-Id: I15e3ab996379600173e441effb9d52577ae3203b

bt-core/bt-core-adapter.c
bt-core/include/bt-core-adapter.h

index 2def3c4..ee43d10 100644 (file)
@@ -189,22 +189,10 @@ static int __bt_stack_up(void)
                return -1;
        }
 
-       /* We need to insert BT driver module by using 'insmod' in case of ARTIK530,
-        * and 'insmod' should be executed by systemd not bt-core. */
-       ret = __bt_call_systemact_service(BT_SYSTEMACT_BT_DRIVER_INSMOD);
+       ret = __bt_call_systemact_service(BT_SYSTEMACT_STACK_UP);
        if (ret < 0) {
                BT_ERR("Failed to call systemact service");
                return -1;
-       } else {
-               /* Insmod should run before bt-stack-up.sh command */
-               usleep(1000 * 200); /* 200ms */
-       }
-
-       ret = __execute_command("/usr/etc/bluetooth/bt-stack-up.sh", NULL);
-       if (ret < 0) {
-               BT_ERR("Failed to run script");
-               __bt_call_systemact_service(BT_SYSTEMACT_HCI_LOGGER_STOP);
-               return -1;
        }
 
        /* activate Bluez */
@@ -398,7 +386,9 @@ int _bt_enable_adapter_le(void)
                        if (ret < 0)
                                BT_ERR("Failed to call systemact service");
                } else {
-                       ret = __execute_command("/usr/etc/bluetooth/bt-stack-up.sh", NULL);
+                       ret = __bt_call_systemact_service(BT_SYSTEMACT_STACK_UP);
+                       if (ret < 0)
+                               BT_ERR("Failed to call systemact service");
                }
                if (ret < 0) {
                        BT_ERR("running script failed");
index 7e61402..3f4ecc6 100755 (executable)
@@ -42,9 +42,9 @@ extern "C" {
 #define BT_SYSTEMACT_BLUETOOTH_SHARE_START "/run/.bluetooth_share_start"
 #define BT_SYSTEMACT_RFKILL_UNBLOCK "/run/.rfkill_unblock"
 #define BT_SYSTEMACT_RFKILL_BLOCK "/run/.rfkill_block"
+#define BT_SYSTEMACT_STACK_UP "/run/.bt_stack_up"
 #define BT_SYSTEMACT_STACK_DOWN "/run/.bt_stack_down"
 #define BT_SYSTEMACT_STACK_DOWN_WITH_RADIO "/run/.bt_stack_down_with_radio"
-#define BT_SYSTEMACT_BT_DRIVER_INSMOD "/run/.bt_driver_insmod"
 
 #define BT_CORE_TYPE (bt_core_get_type())