public static SerialPortConnectionApi GetInstance() { if (INSTANCE == null) { INSTANCE = new SerialPortConnectionApi(); } return(INSTANCE); }
public AppForm() { InitializeComponent(); // get serial port connection api SerialPortConnectionApi connectionApi = SerialPortConnectionApi.GetInstance(); // initialize receiver and sender objects this.receiver = new Receiver(connectionApi); this.sender = new Sender(connectionApi); receiverThread = new Thread(ReceiverThreadProcedure); isReceiverThreadActivated = true; isSenderThreadActivated = false; receiverThread.Start(); }
public Sender(SerialPortConnectionApi connectionApi) { this.connectionApi = connectionApi; }
public Receiver(SerialPortConnectionApi connectionApi) { this.connectionApi = connectionApi; }