Ejemplo n.º 1
0
        public clsMS860(Function.Util.XML xml, string strNode)
        {
            xml.chNode2Root();
            xml.chSingleNode(strNode);

            string strCom      = xml.GetSingleNodeValue("COMPORT");
            string strBaudrate = xml.GetSingleNodeValue("BAUDRATE");
            string strPARITY   = xml.GetSingleNodeValue("PARITY");
            string strDATABITS = xml.GetSingleNodeValue("DATABITS");
            string strSTOPBITS = xml.GetSingleNodeValue("STOPBITS");

            clsSn = new Function.Comm.Serial(strCom, int.Parse(strBaudrate), strPARITY, int.Parse(strDATABITS), strSTOPBITS);
            clsSn.OnDataReceived += new Serial.delReceive(clsSn_DataReceived);
        }
Ejemplo n.º 2
0
        private void clsSn_DataReceived(Function.Comm.Serial port, byte[] byts)
        {
            if (evtBarcodeReceived == null)
            {
                return;
            }

            if (byts.Length < 1)
            {
                return;
            }

            string data = Encoding.ASCII.GetString(byts);

            evtBarcodeReceived(data);
        }
Ejemplo n.º 3
0
 public clsMS860(string strPort, BaudRate baudRate, Parity parity, DataBits databits, StopBits stopbits)
 {
     clsSn = new Serial(strPort, baudRate, parity, databits, stopbits);
     clsSn.OnDataReceived += new Serial.delReceive(clsSn_DataReceived);
 }