uart: remove unused interface function that peripheral_interface_uart_set_mode(). 70/159970/1
authorSegwon <segwon.han@samsung.com>
Tue, 14 Nov 2017 03:43:07 +0000 (12:43 +0900)
committerSegwon <segwon.han@samsung.com>
Tue, 14 Nov 2017 03:43:07 +0000 (12:43 +0900)
Change-Id: I9e1c5a7326d65598e2ce326162abd9c5c0b4806e
Signed-off-by: Segwon <segwon.han@samsung.com>
include/interface/peripheral_interface_uart.h
src/interface/peripheral_interface_uart.c

index f5273fe..c9a8c30 100644 (file)
@@ -99,17 +99,6 @@ int peripheral_interface_uart_flush(peripheral_uart_h uart);
 int peripheral_interface_uart_set_baud_rate(peripheral_uart_h uart, uart_baud_rate_e baud);
 
 /**
-* @brief uart_set_mode() sets byte size, parity bit and stop bits.
-*
-* @param[in] file_hndl handle of uart_context
-* @param[in] byte_size uart byte size
-* @param[in] parity uart parity type (even/odd/none)
-* @param[in] stop_bits uart stop bits
-* @return On success, 0 is returned. On failure, a negative value is returned.
-*/
-int peripheral_interface_uart_set_mode(peripheral_uart_h uart, uart_byte_size_e byte_size, uart_parity_e parity, uart_stop_bits_e stop_bits);
-
-/**
 * @brief peripheral_bus_uart_set_byte_size() set byte size.
 *
 * @param[in] file_hndl handle of uart_context
index 92fffce..c563fc6 100644 (file)
@@ -147,78 +147,6 @@ int peripheral_interface_uart_set_baud_rate(peripheral_uart_h uart, uart_baud_ra
        return 0;
 }
 
-int peripheral_interface_uart_set_mode(peripheral_uart_h uart, uart_byte_size_e byte_size, uart_parity_e parity, uart_stop_bits_e stop_bits)
-{
-       int ret;
-       struct termios tio;
-
-       _D("file_hndl : %d, bytesize : %d, parity : %d, stopbits : %d", uart->fd, byte_size, parity, stop_bits);
-
-       if (!uart->fd) {
-               _E("Invalid NULL parameter");
-               return -EINVAL;
-       }
-
-       if (byte_size > UART_BYTE_SIZE_8BIT) {
-               _E("Invalid bytesize parameter");
-               return -EINVAL;
-       }
-
-       ret = tcgetattr(uart->fd, &tio);
-       if (ret) {
-               char errmsg[MAX_ERR_LEN];
-               strerror_r(errno, errmsg, MAX_ERR_LEN);
-               _E("tcgetattr failed, errmsg: %s", errmsg);
-               return -1;
-       }
-
-       /* set byte size */
-       tio.c_cflag &= ~CSIZE;
-       tio.c_cflag |= byteinfo[byte_size];
-       tio.c_cflag |= (CLOCAL | CREAD);
-
-       /* set parity info */
-       switch (parity) {
-       case UART_PARITY_EVEN:
-               tio.c_cflag |= PARENB;
-               tio.c_cflag &= ~PARODD;
-               break;
-       case UART_PARITY_ODD:
-               tio.c_cflag |= PARENB;
-               tio.c_cflag |= PARODD;
-               break;
-       case UART_PARITY_NONE:
-       default:
-               tio.c_cflag &= ~PARENB;
-               tio.c_cflag &= ~PARODD;
-               break;
-       }
-
-       /* set stop bit */
-       switch (stop_bits) {
-       case UART_STOP_BITS_1BIT:
-               tio.c_cflag &= ~CSTOPB;
-               break;
-       case UART_STOP_BITS_2BIT:
-               tio.c_cflag |= CSTOPB;
-               break;
-       default:
-               _E("Invalid parameter stop_bits");
-               return -EINVAL;
-       }
-
-       peripheral_interface_uart_flush(uart);
-       ret = tcsetattr(uart->fd, TCSANOW, &tio);
-       if (ret) {
-               char errmsg[MAX_ERR_LEN];
-               strerror_r(errno, errmsg, MAX_ERR_LEN);
-               _E("tcsetattr failed, errmsg : %s", errmsg);
-               return -1;
-       }
-
-       return 0;
-}
-
 int peripheral_interface_uart_set_byte_size(peripheral_uart_h uart, uart_byte_size_e byte_size)
 {
        int ret;