Ejemplo n.º 1
0
        public Serial(Action <string> DisplayData)
        {
            sp.PortName  = portname;
            sp.BaudRate  = baudrate;
            sp.DataBits  = databits;
            sp.Parity    = parity;
            sp.StopBits  = stopbits;
            sp.Handshake = handshake;

            sp.ReadTimeout            = 500;
            sp.WriteTimeout           = 500;
            sp.ReceivedBytesThreshold = 1;
            sp.DtrEnable = true;
            sp.RtsEnable = true;
            HanderInterfaceUpdataDelegate DisplayHandle = new HanderInterfaceUpdataDelegate(DisplayData);

            sp.DataReceived += new SerialDataReceivedEventHandler(this.SP_DataReceived);
        }
Ejemplo n.º 2
0
 public Serial(Action <string> DisplayData)
 {
     ReadBufferSize = 1024;
     DisplayHandle  = new HanderInterfaceUpdataDelegate(DisplayData);
 }