Ejemplo n.º 1
0
 /// <summary>
 /// Sets the serial port into break state.
 /// </summary>
 /// <remarks>SetBreakState() followed by ClearBrakeState() is equivalent to sending CTRL+BREAK.</remarks>
 /// <returns>True if the state was set correctly, false otherwise.</returns>
 public bool SetBreakState()
 {
     return(Win32Api.SetCommBreak(m_fileHandle));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Clears the break state set in the serial port.
 /// </summary>
 /// <returns>True if the state was set correctly, false otherwise.</returns>
 public bool ClearBreakState()
 {
     return(Win32Api.ClearCommBreak(m_fileHandle));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Opens the serial port for communication.
        /// </summary>
        /// <returns>True if the port is open successfully.</returns>
        public bool Open()
        {
            m_fileHandle = Win32Api.CreateFile(m_portName);

            return(IsOpen);
        }