public void Connect() { if (!_RunRxThread) { var Session = new RFD.RFD900.TSession(SikRadio.Config.comPort, MainV2.comPort.BaseStream.BaudRate); Session.PutIntoATCommandMode(); Session.Dispose(); _RunRxThread = true; _RxThread = new Thread(RxWorker); _RxThread.Start(); } }
public void Connect() { if (_Session == null) { _Session = new RFD.RFD900.TSession(SikRadio.Config.comPort, MainV2.comPort.BaseStream.BaudRate); if (_Session.PutIntoATCommandMode() == RFD.RFD900.TSession.TMode.AT_COMMAND) { inter.doCommand(Config.comPort, "AT&T=RSSI"); _Session.AssumeMode(RFD.RFD900.TSession.TMode.TRANSPARENT); tickStart = Environment.TickCount; timer1.Start(); } } }
public void Disconnect() { if (_Session != null) { timer1.Stop(); System.Diagnostics.Debug.WriteLine("Putting into AT command mode"); if (_Session.PutIntoATCommandMode() == RFD.RFD900.TSession.TMode.AT_COMMAND) { System.Diagnostics.Debug.WriteLine("Doing AT&T command"); inter.doCommand(Config.comPort, "AT&T"); System.Diagnostics.Debug.WriteLine("Putting into transparent mode"); _Session.PutIntoTransparentMode(); _Session.Dispose(); _Session = null; BUT_disconnect.Enabled = false; BUT_connect.Enabled = true; } } }