CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(daemon)
ADD_SUBDIRECTORY(lib)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(CMAKE_VERBOSE_MAKEFILE 0)
+SET(COMMON ttd-common)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(COMMON_PKGS REQUIRED
+ glib-2.0
+ gio-unix-2.0
+ dlog
+)
+
+FOREACH (flag ${COMMON_PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Winline -g")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
+EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
+ " \\
+ --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/common-worker-inf-dbus \\
+ ${CMAKE_CURRENT_SOURCE_DIR}/common-worker-inf-dbus.xml \\
+ ")
+
+FILE(GLOB COMMON_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
+
+SET(COMMON_INCLUDES
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ CACHE PATH "common includes path"
+)
+
+SET(COMMON_LIBS
+ ${COMMON}
+ CACHE STRING "common libs"
+)
+
+ADD_LIBRARY(${COMMON} STATIC ${COMMON_SOURCE})
+TARGET_LINK_LIBRARIES(${COMMON} ${COMMON_LDFLAGS})
+TARGET_INCLUDE_DIRECTORIES(${COMMON} PUBLIC ${COMMON_INCLUDES})
\ No newline at end of file
--- /dev/null
+/*
+ * 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>
+
+char *common_make_socket_addr_name(
+ const char *token, const char *appID, unsigned int appPID)
+{
+ /* TODO : improve it*/
+ return g_strdup_printf("%5u-%s", appPID, token);
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 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_COMMON_APPINF_H__
+#define __TTD_COMMON_APPINF_H__
+
+#define TTD_APP_MSG_DELIMITER "|"
+#define TTD_APP_INF_BUS_NAME "org.tizen.ttd.bus"
+#define TTD_APP_INF_BUS_INF "org.tizen.ttd.bus.appinf"
+#define TTD_APP_INF_OBJECT_PATH "/org/tizen/ttd/bus/appinf/object"
+
+char *common_make_socket_addr_name(
+ const char *token, const char *appID, unsigned int appPID);
+
+#endif /* __TTD_COMMON_APPINF_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 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 <time.h>
+
+unsigned long long common_get_monotonic_time(void)
+{
+ struct timespec ts;
+ int result;
+
+ result = clock_gettime(CLOCK_MONOTONIC, &ts);
+
+ if (result != 0)
+ return 0;
+
+ return (((unsigned long long) ts.tv_sec) * 1000000) + (ts.tv_nsec / 1000);
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 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_COMMON_UTIL_H__
+#define __TTD_COMMON_UTIL_H__
+
+unsigned long long common_get_monotonic_time(void);
+
+#endif /* __TTD_COMMON_UTIL_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 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_COMMON_WORKER_INF_DEF_H__
+#define __TTD_COMMON_WORKER_INF_DEF_H__
+
+#define TTSD_WORKER_DBUS_NAME "ttsd.worker.dbus"
+#define TTSD_WORKER_DBUS_OBJECT_PATH "/ttsd_worker_dbus_object"
+#define TTSD_WORKER_DBUS_INTERFACE "ttsd.worker.dbus"
+
+#endif /* __TTD_COMMON_WORKER_INF_DEF_H__ */
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
-EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
- " \\
- --generate-c-code ${CMAKE_SOURCE_DIR}/daemon/src/tizen-things-daemon-dbus \\
- ${CMAKE_SOURCE_DIR}/daemon/src/tizen-things-daemon-dbus.xml \\
- ")
-
FILE(GLOB DAEMON_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,now -Wl,-z,relro")
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
ADD_EXECUTABLE(${DAEMON} ${DAEMON_SOURCE})
-TARGET_LINK_LIBRARIES(${DAEMON} ${DAEMON_PKGS_LDFLAGS} -lm)
+TARGET_LINK_LIBRARIES(${DAEMON}
+ ${DAEMON_PKGS_LDFLAGS}
+ ${COMMON_LIBS}
+ -lm
+)
+TARGET_INCLUDE_DIRECTORIES(${DAEMON} PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${COMMON_INCLUDES}
+)
# Install
INSTALL(TARGETS ${DAEMON} DESTINATION ${INSTALL_BIN_DIR})
+++ /dev/null
-<?xml version="0.1" encoding="UTF-8" ?>
-
-<!DOCTYPE node PUBLIC
- "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
- "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
-
-<node>
- <interface name="ttsd.worker.dbus">
-
- <!-- Method definitions -->
-
- <method name="ttsd_worker_submit_report">
- <arg type="s" name="report" direction="in"/>
- <arg type="i" name="ret" direction="out"/>
- </method>
-
- <!-- We don't need to signals, because of aul_launch -->
- </interface>
-</node>
-
#include "ttd-log.h"
#include "ttd-app-interface.h"
#include "ttd-http.h"
-
-/* TODO : move this one to common module */
-#define TTD_APP_MSG_DELIMITER "|"
-#define TTD_APP_INF_BUS_NAME "org.tizen.ttd.bus"
-#define TTD_APP_INF_BUS_INF "org.tizen.ttd.bus.appinf"
-#define TTD_APP_INF_OBJECT_PATH "/org/tizen/ttd/bus/appinf/object"
+#include "common-app-inf.h"
#define POST_DATA_URL "http://apitest.showiot.xyz/api/data"
#define __POST_THREAD_RUN 1
static char *
__get_addr_name(const gchar *token, const gchar *appID, guint appPID)
{
- /* TODO : move this one to common module and improve it*/
- return g_strdup_printf("%5u-%s", appPID, token);
+ return common_make_socket_addr_name(token, appID, appPID);
}
static gboolean
*/
#include <glib.h>
-#include "tizen-things-daemon-dbus.h"
-
#include "ttd-log.h"
#include "ttd-worker-interface.h"
-
-#define TTSD_DBUS_OBJECT_PATH "/ttsd_worker_dbus_object"
-#define TTSD_DBUS_NAME "ttsd.worker.dbus"
+#include "common-worker-inf-def.h"
+#include "common-worker-inf-dbus.h"
struct _worker_interface_h {
guint owner_id;
}
worker_interface_h h = user_data;
- h->m_server = g_dbus_object_manager_server_new(TTSD_DBUS_OBJECT_PATH);
+ h->m_server = g_dbus_object_manager_server_new(TTSD_WORKER_DBUS_OBJECT_PATH);
if (!h->m_server) {
_E("Failed to create dbus server");
ttd_worker_interface_fini(h);
}
if (!g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(h->dbus_obj),
- connection, TTSD_DBUS_OBJECT_PATH, NULL)) {
+ connection, TTSD_WORKER_DBUS_OBJECT_PATH, NULL)) {
_E("Failed to export interface with object path");
ttd_worker_interface_fini(h);
return;
}
_h->owner_id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
- TTSD_DBUS_NAME,
+ TTSD_WORKER_DBUS_NAME,
G_BUS_NAME_OWNER_FLAGS_NONE,
__on_bus_acquired_cb,
__on_name_acquired_cb,
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(CMAKE_VERBOSE_MAKEFILE 0)
-SET(LIB libthings-service)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(LIB_TTS_PKGS REQUIRED
- glib-2.0
- gio-unix-2.0
- dlog
-)
-
-FOREACH (flag ${LIB_TTS_PKGS_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Winline -g")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${INSTALL_LIB_DIR}")
-
-FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
-EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
- " \\
- --generate-c-code ${CMAKE_SOURCE_DIR}/lib/src/tizen-things-lib-dbus \\
- ${CMAKE_SOURCE_DIR}/lib/src/tizen-things-lib-dbus.xml \\
- ")
-
-INCLUDE_DIRECTORIES(${INCLUDE_DIR})
-
-FILE(GLOB LIB_TTS_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
-
-ADD_LIBRARY(${LIB} SHARED ${LIB_TTS_SOURCE})
-TARGET_LINK_LIBRARIES(${LIB} ${LIB_TTS_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${LIB}
- PROPERTIES
- VERSION ${FULL_VER}
- SOVERSION ${MAJOR_VER}
- CLEAN_DIRECT_OUTPUT 1
-)
-INSTALL(TARGETS ${LIB} DESTINATION ${INSTALL_LIB_DIR})
-
-INSTALL(
- DIRECTORY ${INCLUDE_DIR}/ DESTINATION ${INSTALL_INC_DIR}
- FILES_MATCHING
- PATTERN "*_private.h" EXCLUDE
- PATTERN "*.h"
-)
-
-# pkg-config file
-SET(PC_DENPS "") # add package name here if you have exposed lib in your library.
-SET(PC_NAME ${LIB})
-SET(PC_REQUIRED ${PC_DENPS})
-SET(PC_LDFLAGS -l${LIB})
-
-CONFIGURE_FILE(
- ${LIB}.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc
- @ONLY
-)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc DESTINATION ${INSTALL_LIB_DIR}/pkgconfig)
+ADD_SUBDIRECTORY(things-service)
+ADD_SUBDIRECTORY(things-service-worker)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(CMAKE_VERBOSE_MAKEFILE 0)
+SET(LIB things-service-worker)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(LIB_TTS_PKGS REQUIRED
+ glib-2.0
+ gio-unix-2.0
+ dlog
+)
+
+FOREACH (flag ${LIB_TTS_PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Winline -g")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${INSTALL_LIB_DIR}")
+
+FILE(GLOB LIB_TTS_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
+
+ADD_LIBRARY(${LIB} SHARED ${LIB_TTS_SOURCE})
+TARGET_LINK_LIBRARIES(${LIB}
+ ${LIB_TTS_LDFLAGS}
+ ${COMMON_LIBS}
+)
+
+TARGET_INCLUDE_DIRECTORIES(${LIB}
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${COMMON_INCLUDES}
+)
+
+SET_TARGET_PROPERTIES(${LIB}
+ PROPERTIES
+ VERSION ${FULL_VER}
+ SOVERSION ${MAJOR_VER}
+ CLEAN_DIRECT_OUTPUT 1
+)
+INSTALL(TARGETS ${LIB} DESTINATION ${INSTALL_LIB_DIR})
+
+INSTALL(
+ DIRECTORY ${INCLUDE_DIR}/ DESTINATION ${INSTALL_INC_DIR}
+ FILES_MATCHING
+ PATTERN "*-private.h" EXCLUDE
+ PATTERN "*.h"
+)
+
+# pkg-config file
+SET(PC_DENPS "") # add package name here if you have exposed lib in your library.
+SET(PC_NAME ${LIB})
+SET(PC_REQUIRED ${PC_DENPS})
+SET(PC_LDFLAGS -l${LIB})
+
+CONFIGURE_FILE(
+ ${LIB}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc
+ @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc DESTINATION ${INSTALL_LIB_DIR}/pkgconfig)
#include <glib.h>
#include <gio/gio.h>
-#include "log.h"
+#include "log-private.h"
#include "ttsd-worker-lib.h"
-#include "tizen-things-lib-dbus.h"
-
-#define TTSD_WORKER_DBUS_NAME "ttsd.worker.dbus"
-#define TTSD_WORKER_DBUS_OBJECT_PATH "/ttsd_worker_dbus_object"
-#define TTSD_WORKER_DBUS_INTERFACE "ttsd.worker.dbus"
+#include "common-worker-inf-def.h"
+#include "common-worker-inf-dbus.h"
typedef struct {
GCancellable *cancellable;
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(CMAKE_VERBOSE_MAKEFILE 0)
+SET(LIB things-service)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(LIB_TTS_PKGS REQUIRED
+ glib-2.0
+ gio-unix-2.0
+ capi-appfw-app-common
+ dlog
+)
+
+FOREACH (flag ${LIB_TTS_PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Winline -g")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${INSTALL_LIB_DIR}")
+
+FILE(GLOB LIB_TTS_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
+
+ADD_LIBRARY(${LIB} SHARED ${LIB_TTS_SOURCE})
+TARGET_LINK_LIBRARIES(${LIB}
+ ${LIB_TTS_LDFLAGS}
+ ${COMMON_LIBS}
+)
+
+TARGET_INCLUDE_DIRECTORIES(${LIB}
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${COMMON_INCLUDES}
+)
+
+SET_TARGET_PROPERTIES(${LIB}
+ PROPERTIES
+ VERSION ${FULL_VER}
+ SOVERSION ${MAJOR_VER}
+ CLEAN_DIRECT_OUTPUT 1
+)
+INSTALL(TARGETS ${LIB} DESTINATION ${INSTALL_LIB_DIR})
+
+INSTALL(
+ DIRECTORY ${INCLUDE_DIR}/ DESTINATION ${INSTALL_INC_DIR}
+ FILES_MATCHING
+ PATTERN "*-private.h" EXCLUDE
+ PATTERN "*.h"
+)
+
+# pkg-config file
+SET(PC_DENPS "") # add package name here if you have exposed lib in your library.
+SET(PC_NAME ${LIB})
+SET(PC_REQUIRED ${PC_DENPS})
+SET(PC_LDFLAGS -l${LIB})
+
+CONFIGURE_FILE(
+ ${LIB}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc
+ @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc DESTINATION ${INSTALL_LIB_DIR}/pkgconfig)
--- /dev/null
+/*
+ * 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 __LIB_THINGS_SERVICE_LOG_H__
+#define __LIB_THINGS_SERVICE_LOG_H__
+
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "LIB-TS"
+
+#if !defined(_V)
+#define _V(fmt, arg...) dlog_print(DLOG_VERBOSE, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_D)
+#define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_I)
+#define _I(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_W)
+#define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(_E)
+#define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
+#endif
+
+#define retvm_if(expr, val, fmt, arg...) do { \
+ if (expr) { \
+ _E(fmt, ##arg); \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return val; \
+ } \
+} while (0)
+
+#define retv_if(expr, val) do { \
+ if (expr) { \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+} while (0)
+
+#define retm_if(expr, fmt, arg...) do { \
+ if (expr) { \
+ _E(fmt, ##arg); \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+} while (0)
+
+#define ret_if(expr) do { \
+ if (expr) { \
+ _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+} while (0)
+
+#define goto_if(expr, val) do { \
+ if (expr) { \
+ _E("(%s) -> goto", #expr); \
+ goto val; \
+ } \
+} while (0)
+
+#define break_if(expr) { \
+ if (expr) { \
+ _E("(%s) -> break", #expr); \
+ break; \
+ } \
+}
+
+#define continue_if(expr) { \
+ if (expr) { \
+ _E("(%s) -> continue", #expr); \
+ continue; \
+ } \
+}
+
+#endif /* __LIB_THINGS_SERVICE_LOG_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 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 __LIB_THINGS_SERVICE_H__
+#define __LIB_THINGS_SERVICE_H__
+
+typedef struct _ts_data *ts_handle;
+
+int things_service_init(ts_handle *handle);
+int things_service_fini(ts_handle handle);
+int things_service_send_data(ts_handle handle, const char *json_data);
+
+#endif /* __LIB_THINGS_SERVICE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 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 <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+#include <glib.h>
+#include <gio/gio.h>
+#include <gio/gunixsocketaddress.h>
+#include <app_common.h>
+#include "log-private.h"
+#include "things-service.h"
+#include "common-app-inf.h"
+
+struct _ts_data {
+ int padding;
+};
+
+int things_service_init(ts_handle *handle)
+{
+ return 0;
+}
+
+int things_service_fini(ts_handle handle)
+{
+ return 0;
+}
+
+int things_service_send_data(ts_handle handle, const char *json_data)
+{
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@INSTALL_LIB_DIR@
+includedir=@INSTALL_INC_DIR@
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(capi-appfw-app-control)
+BuildRequires: pkgconfig(capi-appfw-app-common)
%description
Tizen Things daemon