public void Dispose() { if (this.serialDevice != null && this.serialDevice.IsOpen) { this.End(); } instance = null; }
public static Wheelchair Instance(ISerialDevice serialDevice, string portName, int baudRate) { if (instance == null) { instance = new Wheelchair(serialDevice, portName, baudRate); } return(instance); }
public static Wheelchair Instance(ISerialDevice serialDevice) { if (instance == null) { instance = new Wheelchair(serialDevice, null, 0); } return(instance); }
public static Wheelchair Instance() { if (instance == null) { instance = new Wheelchair(); } return(instance); }
/// <summary> /// Gets the singleton instance of /// the Wheelchair. /// </summary> /// <param name="portName"></param> /// <param name="baudRate"></param> /// <returns>Singleton instance of the wheelchair.</returns> public static Wheelchair Instance(string portName = "COM7", int baudRate = 9600) { if (instance == null) { instance = new Wheelchair(portName, baudRate); } return(instance); }