Example #1
0
 private static void InitUARTService()
 {
     if (m_uart == null)
     {
         m_uart = new UARTManager(uart_port, baudrate, ReadTimeout, WriteTimeout, handshake, parity, stopBits, dataBits);
         m_uart.Initialize();
     }
 }
Example #2
0
 /// <summary>
 /// start and restart the uart device
 /// </summary>
 /// <param name="m_uart"></param>
 public void ResetUARTDevice()
 {
     if (m_uart != null)
     {
         m_uart.Close();
         m_uart.Open();
     }
     else
     {
         m_uart = new UARTManager(uart_port, baudrate, ReadTimeout, WriteTimeout, handshake, parity, stopBits, dataBits);
         if (!m_uart.ready)
         {
             m_uart.Initialize();
         }
     }
 }