Example #1
0
        public void Index()
        {
            ModemSettings modemSettings = ModemSettings.FindFirst();

            PropertyBag["settings"] = modemSettings;
            RenderView("Config/Index");
        }
Example #2
0
 public void InitModem()
 {
     //read settings
     settings = ModemSettings.FindFirst();
     if (myport == null)
     {
         myport = new SerialPort();
     }
     if (myport.IsOpen)
     {
         myport.Close();
     }
     myport.PortName        = settings.Port;
     myport.BaudRate        = settings.BitPerSec; // 115200;
     myport.Parity          = settings.Parity;    // Parity.None;
     myport.StopBits        = settings.StopBits;  // StopBits.One;
     myport.DataBits        = settings.DataBits;
     myport.ReadBufferSize  = 10000;
     myport.ReadTimeout     = 1000;
     myport.WriteBufferSize = 10000;
     myport.WriteTimeout    = 10000;
     myport.RtsEnable       = true;
 }