public void TestReceive() { var port = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One); var dl = new DialupDataLink(port); var modem = new ItuV250Modem(dl); while (true) { System.Threading.Thread.Sleep(1000); } }
public static TSL_Modem CreateModem(string portName) { try { var port = new SerialPort(portName, 9600, Parity.None, 8, StopBits.One); port.DtrEnable = true; port.RtsEnable = true; var dl = new DialupDataLink(port); return(new TSL_Modem(dl)); } catch (Exception ex) { LogService.Logger.Error("Fail to initilize TSM modem", ex); return(null); } }
public void TestDial() { //var dl = new FakeDataLink(); var port = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One); var dl = new DialupDataLink(port); var modem = new ItuV250Modem(dl); //var mid = modem.ManufacturerId; IConnection conn; try { modem.TurnEchoOff(); conn = modem.Dial("229"); conn.Modem.DataLink.SendData("Hello world"); conn.Modem.DataLink.SendData("Hello world"); conn.Disconnect(); } catch (Exception ex) { } }