From c12877c1895650082c8c0e99e46c33770126387c Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Fri, 22 Sep 2017 20:41:53 +0900 Subject: [PATCH] Change peripheral io UART APIs Change-Id: Ic5c5c26c88720c270188cfde10d777ad66297e32 Signed-off-by: kibak.yoon --- gps-plugin/src/gps_plugin_replay.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gps-plugin/src/gps_plugin_replay.c b/gps-plugin/src/gps_plugin_replay.c index aea4183..c15f2eb 100644 --- a/gps-plugin/src/gps_plugin_replay.c +++ b/gps-plugin/src/gps_plugin_replay.c @@ -120,27 +120,31 @@ static int gps_uart_open() return FALSE; } _D("GPS Uart Port Open Successful !!"); - ret = peripheral_uart_set_baudrate(uart_hndl, PERIPHERAL_UART_BAUDRATE_9600); + ret = peripheral_uart_set_baud_rate(uart_hndl, PERIPHERAL_UART_BAUD_RATE_9600); if (ret < 0) { _E("GPS Uart Port Open failed !!"); goto ERROR; } - ret = peripheral_uart_set_mode(uart_hndl, - PERIPHERAL_UART_BYTESIZE_8BIT, - PERIPHERAL_UART_PARITY_NONE, - PERIPHERAL_UART_STOPBITS_1BIT); + ret = peripheral_uart_set_byte_size(uart_hndl, PERIPHERAL_UART_BYTE_SIZE_8BIT); if (ret < 0) { _E("GPS Uart Set Mode failed !!"); goto ERROR; } - ret = peripheral_uart_set_flowcontrol(uart_hndl, true, false); + ret = peripheral_uart_set_parity(uart_hndl, PERIPHERAL_UART_PARITY_NONE); if (ret < 0) { - _E("GPS Uart Set Flow Control Open failed !!"); + _E("GPS Uart Set Mode failed !!"); goto ERROR; } - ret = peripheral_uart_flush(uart_hndl); + ret = peripheral_uart_set_stop_bits(uart_hndl, PERIPHERAL_UART_STOP_BITS_1BIT); if (ret < 0) { - _E("GPS Uart Flush failed !!"); + _E("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 !!"); goto ERROR; } return TRUE; -- 2.7.4