including : move the '#include' duplicate written to common file 32/160232/2
authorSegwon <segwon.han@samsung.com>
Wed, 15 Nov 2017 02:03:38 +0000 (11:03 +0900)
committerSegwon <segwon.han@samsung.com>
Wed, 15 Nov 2017 06:15:50 +0000 (15:15 +0900)
Change-Id: I5926833c5cef4f5d82bcca78164289562b53c2ca
Signed-off-by: Segwon <segwon.han@samsung.com>
23 files changed:
CMakeLists.txt
include/gdbus/peripheral_gdbus_common.h
include/gdbus/peripheral_gdbus_gpio.h
include/gdbus/peripheral_gdbus_i2c.h
include/gdbus/peripheral_gdbus_pwm.h
include/gdbus/peripheral_gdbus_spi.h
include/gdbus/peripheral_gdbus_uart.h
include/interface/peripheral_interface_common.h
include/interface/peripheral_interface_gpio.h
include/interface/peripheral_interface_i2c.h
include/interface/peripheral_interface_pwm.h
include/interface/peripheral_interface_spi.h
include/interface/peripheral_interface_uart.h
src/gdbus/peripheral_gdbus_gpio.c
src/gdbus/peripheral_gdbus_i2c.c
src/gdbus/peripheral_gdbus_pwm.c
src/gdbus/peripheral_gdbus_spi.c
src/gdbus/peripheral_gdbus_uart.c
src/interface/peripheral_interface_gpio.c
src/interface/peripheral_interface_i2c.c
src/interface/peripheral_interface_pwm.c
src/interface/peripheral_interface_spi.c
src/interface/peripheral_interface_uart.c

index 9b17fa7e0033e7a9570e8e4b9cd4352859aae998..7fd0979b956372230638b77acd364911a20a6c65 100644 (file)
@@ -30,6 +30,9 @@ INCLUDE_DIRECTORIES(${INC_DIR})
 INCLUDE_DIRECTORIES(${INC_DIR}/gdbus)
 INCLUDE_DIRECTORIES(${INC_DIR}/interface)
 
+SET(SRC_DIR src)
+INCLUDE_DIRECTORIES(${SRC_DIR}/gdbus)
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
 FOREACH(flag ${${fw_name}_CFLAGS})
index 685efdb71c286a4abf9fbd4470d459389fced8fa..9a8450e36b39549cb0b7de3996b68bd2e1a61da1 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 #ifndef __PERIPHERAL_GDBUS_COMMON_H__
 #define __PERIPHERAL_GDBUS_COMMON_H__
 
 #include <gio/gio.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <gio/gunixfdlist.h>
+
+#include "peripheral_io.h"
+#include "peripheral_internal.h"
+#include "peripheral_common.h"
+#include "peripheral_io_gdbus.h"
 
 #define PERIPHERAL_GDBUS_INTERFACE     "org.tizen.peripheral_io"
 #define PERIPHERAL_GDBUS_GPIO_PATH     "/Org/Tizen/Peripheral_io/Gpio"
index 3fd53071bb91966f5788673e19118286752faee2..c63aeba67e131ca140bb2ee1f7ed8b1e26c595b7 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __PERIPHERAL_GDBUS_GPIO_H__
 #define __PERIPHERAL_GDBUS_GPIO_H__
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio);
 int peripheral_gdbus_gpio_close(peripheral_gpio_h gpio);
 
index 0670442d056ff67861f8c25756d5dfafaddef731..e1b17224fe40f3da108b4e72bee6e2253ba7bebb 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __PERIPHERAL_GDBUS_I2C_H__
 #define __PERIPHERAL_GDBUS_I2C_H__
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_i2c_open(peripheral_i2c_h i2c, int bus, int address);
 int peripheral_gdbus_i2c_close(peripheral_i2c_h i2c);
 
index 148e9382b5e03fa6cc2f30e50c595f512f554216..70a4b02727b9718f80c55d835f346f070c656392 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __PERIPHERAL_GDBUS_PWM_H__
 #define __PERIPHERAL_GDBUS_PWM_H__
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_pwm_open(peripheral_pwm_h pwm, int chip, int pin);
 int peripheral_gdbus_pwm_close(peripheral_pwm_h pwm);
 
index 8a6ac613a02bc12f99aaf9487dc8b7bf7001c806..94b22425d07c97d6d707d530937e033109ee5e87 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 #ifndef __PERIPHERAL_GDBUS_SPI_H_
 #define __PERIPHERAL_GDBUS_SPI_H_
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_spi_open(peripheral_spi_h spi, int bus, int cs);
 int peripheral_gdbus_spi_close(peripheral_spi_h spi);
 
index 175452cfc9c730a7cf17b6593252ab6e72db01c6..bf7af68300b76248d1eea84dff522f98b7d669f3 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 #ifndef __PERIPHERAL_GDBUS_UART_H_
 #define __PERIPHERAL_GDBUS_UART_H_
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_uart_open(peripheral_uart_h uart, int port);
 int peripheral_gdbus_uart_close(peripheral_uart_h uart);
 
index 33a8d398ee06e1f8823ca9049cfbcace6a509701..a69254e90ecf0de00326a11b2f3d8d4674081589 100644 (file)
 #ifndef __PERIPHERAL_INTERFACE_COMMON_H__
 #define __PERIPHERAL_INTERFACE_COMMON_H__
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "peripheral_io.h"
+#include "peripheral_internal.h"
+#include "peripheral_common.h"
+
 #define CHECK_ERROR(val) \
        do { \
                if (val < 0) { \
index cc68e9227123afb084e443c86833209306aa7e23..ff3a79465d6692911990974dd0ee0af8c6364315 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_GPIO_H__
 #define __PERIPHERAL_INTERFACE_GPIO_H__
 
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 #define SYSFS_GPIO_DIR "/sys/class/gpio"
 #define GPIO_BUFFER_MAX 64
index 41326d6999a52c2b59bfe1fdf5c06fabe93919a4..6e3dc231bb24d4171498b257eae5f320d0881dff 100644 (file)
@@ -17,9 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_I2C_H__
 #define __PERIPHERAL_INTERFACE_I2C_H__
 
-#include <stdint.h>
-
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 #define SYSFS_I2C_DIR "/dev/i2c"
 #define I2C_BUFFER_MAX 64
index 086766321eb03bda44dbe995616e502d7c166202..f37b40d619ef9eb40a1cb032327438ee757e9b4a 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_PWM_H__
 #define __PERIPHERAL_INTERFACE_PWM_H__
 
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 /**
 * @brief pwm_close() deinit pwm pin.
index d7a471d54ba6f8d03c5bbd78f8d2f6504bb54014..801c3248c8015dbf5d5acb16b3cb273eab171e37 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_SPI_H__
 #define __PERIPHERAL_INTERFACE_SPI_H__
 
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 int peripheral_interface_spi_close(peripheral_spi_h spi);
 int peripheral_interface_spi_set_mode(peripheral_spi_h spi, peripheral_spi_mode_e mode);
index 4648ae1319d2621bde6c09cfcb5993b35814105b..c4c82ec29550d53ecc14e4ab09a14b4ba825bdee 100644 (file)
@@ -17,9 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_UART_H__
 #define __PERIPHERAL_INTERFACE_UART_H__
 
-#include "peripheral_io.h"
-
-#include <stdint.h>
+#include "peripheral_interface_common.h"
 
 /**
 * @brief uart_close() closes uart port.
index f5e6b0b24f00895a5c40c1b040777979f16ae89d..c8a6d8ca6cabdf3b2d3ff95d57947085d823b27a 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_gpio.h"
 
 #define GPIO_FD_INDEX_DIRECTION 0
 #define GPIO_FD_INDEX_EDGE      1
index 767332b796332b32b1e2ef09ac17bde8216ca319..29ba888a2d0ec374a23e7fca25ab501db987c2c8 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_i2c.h"
 
 #define I2C_FD_INDEX 0
 
index e9b501be527679275ef0b5caaa906433253c7357..48ff164b5c1bf34fbe242796c719ceac51b0d2f5 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_pwm.h"
 
 #define PWM_FD_INDEX_PERIOD      0
 #define PWM_FD_INDEX_DUTY_CYCLE  1
index 2d07cd347d63b2eee971fe743288e4c555a015eb..fce5a41dd93e48194ca28019ea58f82fff3e0210 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_spi.h"
 
 #define SPI_FD_INDEX 0
 
index 32d799287adfa86fece884715b2f46f13548255d..852e244e2d70b267569b9d51f98fcf562bc268f5 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_uart.h"
 
 #define UART_FD_INDEX 0
 
index 7d4ef2fc3c49cc09fcb6a8c0f79740141bdea3cd..950de1911182bcdf1804b6f3ddaaab2ecc842e1a 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_gpio.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define MAX_ERR_LEN 255
 
index fadbf63f23750a5bd902157d7b476785bc2f8a1f..87be20615fbe32cd6e8b93d23f9768ea139de66d 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_i2c.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define MAX_ERR_LEN 255
 
index faefc1a4f3b3ea104d94c1e6f7fe08888545736d..bbfeefb09b3e6d604f976fe00dae987985298095 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdbool.h>
-
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_pwm.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define SYSFS_PWM_PATH "/sys/class/pwm"
 
index 1c83726eebb0bf49d1cb3ad04046fca8a4666e44..e8a0fc65a8b53742d129b7aa5c96d4924d1bd4b2 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <linux/spi/spidev.h>
 
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_spi.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define SYSFS_SPI_DIR "/dev/spidev"
 #define SYSFS_SPI_BUFSIZ "/sys/module/spidev/parameters/bufsiz"
index a0f9637e02ef0ce9d5ffe2d96357843b7678ae7c..4944bb9edd195139e13a4aa961d1c08910097770 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
 #include <termios.h>
-#include <stdbool.h>
-#include <sys/ioctl.h>
 
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_uart.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define PATH_BUF_MAX           64
 #define UART_BUF_MAX           16