sensor-hal-tm1: rename sensor_logs.h to sensor_log.h
authorkibak.yoon <kibak.yoon@samsung.com>
Fri, 1 Apr 2016 12:48:54 +0000 (21:48 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Fri, 1 Apr 2016 12:48:54 +0000 (21:48 +0900)
Change-Id: Ibfab695dec5c07dd7d4b01062ac8ea572dea21ad
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
13 files changed:
src/accel/accel.cpp
src/create.cpp
src/proxi/proxi.cpp
src/sensor_log.h [new file with mode: 0644]
src/sensor_logs.h [deleted file]
src/sensorhub/dbus_util.cpp
src/sensorhub/sensorhub.cpp
src/sensorhub/sensorhub_controller.cpp
src/sensorhub/sensorhub_manager.h
src/sensorhub/sensorhub_sensor.cpp
src/sensorhub/system_state.cpp
src/sensorhub/wristup.cpp
src/util.cpp

index cc856b4473aa40df68f952e7132aefea0a4934ce..97b1db51dc3e163addb516043d3347b533e867ab 100644 (file)
@@ -21,7 +21,7 @@
 #include <sys/stat.h>
 #include <linux/input.h>
 #include <util.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 
 #include "accel.h"
 
index 33f54fcdf7472ed49818930995a7ac9dfde6d0be..6ed9bbd9aa916e7ed920639383edbc04bea80c60 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include <sensor/sensor_hal.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 #include <vector>
 
 #include "accel/accel.h"
index 819a5b6c7d9be2c7b06f6c73e1f8baae213a1fdf..8a8ce642107aa5257fd5eaebefbcc3d3fc24dea6 100644 (file)
@@ -21,7 +21,7 @@
 #include <sys/stat.h>
 #include <linux/input.h>
 #include <util.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 
 #include "proxi.h"
 
diff --git a/src/sensor_log.h b/src/sensor_log.h
new file mode 100644 (file)
index 0000000..395abb1
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 _SENSOR_LOG_H_
+#define _SENSOR_LOG_H_
+
+#include <dlog.h>
+
+#if !defined(NAME_MAX)
+#define NAME_MAX 256
+#endif
+
+#define SENSOR_TYPE_SHIFT 16
+
+enum sf_log_type {
+       SF_LOG_PRINT_FILE               = 1,
+       SF_LOG_SYSLOG                   = 2,
+       SF_LOG_DLOG                     = 3,
+};
+
+enum sf_priority_type {
+       SF_LOG_ERR                      = 1,
+       SF_LOG_DBG                      = 2,
+       SF_LOG_INFO                     = 3,
+       SF_LOG_WARN                     = 4,
+};
+
+#define MICROSECONDS(tv)        ((tv.tv_sec * 1000000ll) + tv.tv_usec)
+
+//for new log system - dlog
+#ifdef LOG_TAG
+       #undef LOG_TAG
+#endif
+#define LOG_TAG        "SENSOR"
+
+#ifdef _DEBUG
+#define DBG SLOGD
+#else
+#define DBG(...) do{} while(0)
+#endif
+
+#define ERR SLOGE
+#define WARN SLOGW
+#define INFO SLOGI
+#define _E ERR
+#define _W WARN
+#define _I INFO
+#define _D DBG
+
+#define _ERRNO(errno, tag, fmt, arg...) do { \
+               char buf[1024]; \
+               char *error = strerror_r(errno, buf, 1024); \
+               if (!error) { \
+                       _E("Failed to strerror_r()"); \
+                       break; \
+               } \
+               tag(fmt" (%s[%d])", ##arg, error, errno); \
+       } while (0)
+
+#if defined(_DEBUG)
+#  define warn_if(expr, fmt, arg...) do { \
+               if(expr) { \
+                       DBG("(%s) -> " fmt, #expr, ##arg); \
+               } \
+       } while (0)
+#  define ret_if(expr) do { \
+               if(expr) { \
+                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return; \
+               } \
+       } while (0)
+#  define retv_if(expr, val) do { \
+               if(expr) { \
+                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return (val); \
+               } \
+       } while (0)
+#  define retm_if(expr, fmt, arg...) do { \
+               if(expr) { \
+                       ERR(fmt, ##arg); \
+                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return; \
+               } \
+       } while (0)
+#  define retvm_if(expr, val, fmt, arg...) do { \
+               if(expr) { \
+                       ERR(fmt, ##arg); \
+                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       return (val); \
+               } \
+       } while (0)
+
+#else
+#  define warn_if(expr, fmt, arg...) do { \
+               if(expr) { \
+                       ERR(fmt, ##arg); \
+               } \
+       } while (0)
+#  define ret_if(expr) do { \
+               if(expr) { \
+                       return; \
+               } \
+       } while (0)
+#  define retv_if(expr, val) do { \
+               if(expr) { \
+                       return (val); \
+               } \
+       } while (0)
+#  define retm_if(expr, fmt, arg...) do { \
+               if(expr) { \
+                       ERR(fmt, ##arg); \
+                       return; \
+               } \
+       } while (0)
+#  define retvm_if(expr, val, fmt, arg...) do { \
+               if(expr) { \
+                       ERR(fmt, ##arg); \
+                       return (val); \
+               } \
+       } while (0)
+
+#endif
+
+#endif /* _SENSOR_LOG_H_ */
diff --git a/src/sensor_logs.h b/src/sensor_logs.h
deleted file mode 100644 (file)
index 395abb1..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 _SENSOR_LOG_H_
-#define _SENSOR_LOG_H_
-
-#include <dlog.h>
-
-#if !defined(NAME_MAX)
-#define NAME_MAX 256
-#endif
-
-#define SENSOR_TYPE_SHIFT 16
-
-enum sf_log_type {
-       SF_LOG_PRINT_FILE               = 1,
-       SF_LOG_SYSLOG                   = 2,
-       SF_LOG_DLOG                     = 3,
-};
-
-enum sf_priority_type {
-       SF_LOG_ERR                      = 1,
-       SF_LOG_DBG                      = 2,
-       SF_LOG_INFO                     = 3,
-       SF_LOG_WARN                     = 4,
-};
-
-#define MICROSECONDS(tv)        ((tv.tv_sec * 1000000ll) + tv.tv_usec)
-
-//for new log system - dlog
-#ifdef LOG_TAG
-       #undef LOG_TAG
-#endif
-#define LOG_TAG        "SENSOR"
-
-#ifdef _DEBUG
-#define DBG SLOGD
-#else
-#define DBG(...) do{} while(0)
-#endif
-
-#define ERR SLOGE
-#define WARN SLOGW
-#define INFO SLOGI
-#define _E ERR
-#define _W WARN
-#define _I INFO
-#define _D DBG
-
-#define _ERRNO(errno, tag, fmt, arg...) do { \
-               char buf[1024]; \
-               char *error = strerror_r(errno, buf, 1024); \
-               if (!error) { \
-                       _E("Failed to strerror_r()"); \
-                       break; \
-               } \
-               tag(fmt" (%s[%d])", ##arg, error, errno); \
-       } while (0)
-
-#if defined(_DEBUG)
-#  define warn_if(expr, fmt, arg...) do { \
-               if(expr) { \
-                       DBG("(%s) -> " fmt, #expr, ##arg); \
-               } \
-       } while (0)
-#  define ret_if(expr) do { \
-               if(expr) { \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
-                       return; \
-               } \
-       } while (0)
-#  define retv_if(expr, val) do { \
-               if(expr) { \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
-                       return (val); \
-               } \
-       } while (0)
-#  define retm_if(expr, fmt, arg...) do { \
-               if(expr) { \
-                       ERR(fmt, ##arg); \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
-                       return; \
-               } \
-       } while (0)
-#  define retvm_if(expr, val, fmt, arg...) do { \
-               if(expr) { \
-                       ERR(fmt, ##arg); \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
-                       return (val); \
-               } \
-       } while (0)
-
-#else
-#  define warn_if(expr, fmt, arg...) do { \
-               if(expr) { \
-                       ERR(fmt, ##arg); \
-               } \
-       } while (0)
-#  define ret_if(expr) do { \
-               if(expr) { \
-                       return; \
-               } \
-       } while (0)
-#  define retv_if(expr, val) do { \
-               if(expr) { \
-                       return (val); \
-               } \
-       } while (0)
-#  define retm_if(expr, fmt, arg...) do { \
-               if(expr) { \
-                       ERR(fmt, ##arg); \
-                       return; \
-               } \
-       } while (0)
-#  define retvm_if(expr, val, fmt, arg...) do { \
-               if(expr) { \
-                       ERR(fmt, ##arg); \
-                       return (val); \
-               } \
-       } while (0)
-
-#endif
-
-#endif /* _SENSOR_LOG_H_ */
index adeaf57b078d88db0a52795cc3bb6568b09366ac..c6170908da390466d2e14b659f29f5c1b1393324 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include <gio/gio.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 #include "dbus_util.h"
 
 void init_dbus(void)
index f9b335dbd6111d65df3be42e2a6fb9fe9524fc2f..fe631771144be414740f3fb0d9967ac79566748d 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include <algorithm>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 
 #include "sensorhub.h"
 #include "sensorhub_controller.h"
index 9d7b7fb678a6504f30b853e7e981bc2ae87a5b04..d8ee72a5a4a578a0c7ee485b425dfac1e5a9d66b 100644 (file)
@@ -24,7 +24,7 @@
 #include <sys/ioctl.h>
 #include <fstream>
 
-#include <sensor_logs.h>
+#include <sensor_log.h>
 #include <util.h>
 #include "sensorhub_controller.h"
 
index 8d3a38f32a6c2a2560ea5a6b61bf1c4adbddb180..6ee16a221b3f1d8faeb47dede2e42bc50d812750 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <map>
 #include <vector>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 
 #include "sensorhub_controller.h"
 #include "sensorhub_sensor.h"
index 56656b5a2789e52fa977e6b2c5cf86bca3920c89..528f4c6b419d20ef8940fae5d1c33d0c609f3bf9 100644 (file)
@@ -15,7 +15,7 @@
  *
  */
 
-#include <sensor_logs.h>
+#include <sensor_log.h>
 #include <time.h>
 #include "sensorhub_controller.h"
 #include "sensorhub_sensor.h"
index 70703d21e4fd3b2008efb1def873aeda0f31bbc7..5fdce8634b18c19cadc29b168e8509efd3d8b1f3 100644 (file)
@@ -15,7 +15,7 @@
  *
  */
 
-#include <sensor_logs.h>
+#include <sensor_log.h>
 #include "dbus_util.h"
 #include "system_state.h"
 
index 346f807269da82c9b01a66793c536f7f31485957..fcbecace83288d9e31f278bdff3a3af66aabafeb 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <algorithm>
 #include <sensor/sensor_hal.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 
 #include "sensorhub_manager.h"
 #include "system_state.h"
index 9c0dbd35b9ec3da6058233a4545711c5e685b9aa..df01a1e84ba7e48baa506f33736641b0ed4f3676 100644 (file)
@@ -20,7 +20,7 @@
 #include <string.h>
 #include <fstream>
 #include <util.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
 
 using std::ifstream;
 using std::ofstream;