pio: can be included only peripheral-io.h 63/164763/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20171221.071006 submit/tizen_4.0/20171221.025151 tizen_4.0.IoT.p2_release
authorSegwon <segwon.han@samsung.com>
Thu, 21 Dec 2017 02:30:26 +0000 (11:30 +0900)
committerSegwon <segwon.han@samsung.com>
Thu, 21 Dec 2017 02:30:26 +0000 (11:30 +0900)
Change-Id: I74b66dd0d4d34c3a4171f7744ef13c71062c8a63
Signed-off-by: Segwon <segwon.han@samsung.com>
gps-plugin/src/gps_plugin_replay.c

index 3eefd56..36c4a80 100644 (file)
@@ -36,9 +36,6 @@
 #include "setting.h"
 
 #include "peripheral_io.h"
-#include "peripheral_gdbus_i2c.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define REPLAY_NMEA_SET_SIZE           4096
 #define REPLAY_NMEA_SENTENCE_SIZE      128
@@ -102,11 +99,12 @@ static int gps_uart_close()
 
        ret = peripheral_uart_close(uart_hndl);
        if (ret < 0) {
-               _E("GPS Uart Port Close failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Port Close failed !!");
                return FALSE;
        }
        uart_hndl = NULL;
-       _D("GPS Uart Port Close Successful !!");
+       LOG_PLUGIN(DBG_LOW, "GPS Uart Port Close Successful !!");
+
        return TRUE;
 }
 
@@ -116,35 +114,36 @@ static int gps_uart_open()
 
        ret = peripheral_uart_open(GPS_UART_PORT, &uart_hndl);
        if (ret < 0) {
-               _E("GPS Uart Port Open failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Port Open failed !!");
                return FALSE;
        }
-       _D("GPS Uart Port Open Successful !!");
+       LOG_PLUGIN(DBG_LOW, "GPS Uart Port Open Successful !!");
+
        ret = peripheral_uart_set_baud_rate(uart_hndl, PERIPHERAL_UART_BAUD_RATE_9600);
        if (ret < 0) {
-               _E("GPS Uart Port Open failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Port Open failed !!");
                goto ERROR;
        }
        ret = peripheral_uart_set_byte_size(uart_hndl, PERIPHERAL_UART_BYTE_SIZE_8BIT);
        if (ret < 0) {
-               _E("GPS Uart Set Mode failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Set Mode failed !!");
                goto ERROR;
        }
        ret = peripheral_uart_set_parity(uart_hndl, PERIPHERAL_UART_PARITY_NONE);
        if (ret < 0) {
-               _E("GPS Uart Set Mode failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Set Mode failed !!");
                goto ERROR;
        }
        ret = peripheral_uart_set_stop_bits(uart_hndl, PERIPHERAL_UART_STOP_BITS_1BIT);
        if (ret < 0) {
-               _E("GPS Uart Set Mode failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Set Mode failed !!");
                goto ERROR;
        }
        ret = peripheral_uart_set_flow_control(uart_hndl,
                        PERIPHERAL_UART_HARDWARE_FLOW_CONTROL_AUTO_RTSCTS,
                        PERIPHERAL_UART_SOFTWARE_FLOW_CONTROL_NONE);
        if (ret < 0) {
-               _E("GPS Uart Set Flow Control Open failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Set Flow Control Open failed !!");
                goto ERROR;
        }
        return TRUE;
@@ -159,7 +158,7 @@ static int gps_uart_read(char *buf, int len)
 
        /* ERROR if the length is less than 0 */
        if ((length = peripheral_uart_read(uart_hndl, (uint8_t *)buf, len)) < PERIPHERAL_ERROR_NONE)
-               _E("GPS Uart Read failed !!");
+               LOG_PLUGIN(DBG_ERR, "GPS Uart Read failed !!");
 
        return length;
 }
@@ -838,7 +837,7 @@ int gps_plugin_replay_gps_deinit(gps_failure_reason_t *reason_code)
        g_user_data = NULL;
 
        peripheral_uart_close(uart_hndl);
-       _D("GPS Uart Port Close Successful !!");
+       LOG_PLUGIN(DBG_LOW, "GPS Uart Port Close Successful !!");
 
        return TRUE;
 }