# Closing serial port

You can close the serial port anytime. As you see at Receiving Incoming Data Guide, to close the port just call Close() method.

# Example

private void ClosePort()
{
    if (simplePort.IsOpen)
    {
        simplePort.Close();
        simplePort.OnDataReceived -= OnReceiveData;
    }
}
Last Updated: 11/8/2022, 8:03:50 PM

Made by Andres Ruiz with ❤️
All rights reserved © 2024