add cmd func module 45/181245/1
authorJeonghoon Park <jh1979.park@samsung.com>
Mon, 11 Jun 2018 08:20:39 +0000 (17:20 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Mon, 11 Jun 2018 08:20:39 +0000 (17:20 +0900)
Change-Id: Iae9b7273c214c67dc632ab1e8fb29903348897b9

daemon/include/ttd-cmd-func.h [new file with mode: 0644]
daemon/src/ttd-cmd-func.c [new file with mode: 0644]

diff --git a/daemon/include/ttd-cmd-func.h b/daemon/include/ttd-cmd-func.h
new file mode 100644 (file)
index 0000000..6f1abf1
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __TTD_CMD_FUNC_H__
+#define __TTD_CMD_FUNC_H__
+
+#include "ttd-cmd-type.h"
+
+ttd_cmd_launch_func ttd_cmd_get_launch_func(ttd_cmd_type_e type);
+
+#endif /* __TTD_CMD_FUNC_H__ */
diff --git a/daemon/src/ttd-cmd-func.c b/daemon/src/ttd-cmd-func.c
new file mode 100644 (file)
index 0000000..f86f806
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <glib.h>
+#include "ttd-cmd-type.h"
+#include "ttd-config.h"
+#include "ttd-worker-handle.h"
+
+ttd_cmd_launch_func ttd_cmd_get_launch_func(ttd_cmd_type_e type)
+{
+       ttd_cmd_launch_func func = NULL;
+
+       switch (type) {
+       case TTD_CMD_TYPE_POWER:
+               break;
+       case TTD_CMD_TYPE_CONFIG:
+               func = ttd_config_write;
+               break;
+       case TTD_CMD_TYPE_PACKAGE:
+       case TTD_CMD_TYPE_INFO:
+               func = ttd_worker_launch;
+               break;
+       case TTD_CMD_TYPE_DIAGNOSIS:
+               break;
+       case TTD_CMD_TYPE_LOCAL:
+               break;
+       case TTD_CMD_TYPE_UNKNOWN:
+       case TTD_CMD_TYPE_MAX:
+       default:
+               break;
+       }
+
+       return func;
+}
\ No newline at end of file