public void SerialPortsCloseIfNeeded() { if(sp != null && sp.IsOpen) { LogB.Information("Closing sp"); sp.Close(); } }