예제 #1
0
        public static AxDBCommManager Create(DBPlcId Model, Via Via, string Para)
        {
            try
            {
                plcKey = new AxDBCommManager();
                plcKey.CreateControl();
                plcKey.PLC  = Model;
                plcKey.Peer = Via.ToString();
                if (Via != Via.USB)
                {
                    plcKey.Peer = Para;
                }
                plcKey.UseWaitCursor = true;

                plcKey.Connect();


                G.isConnect = isConnect.Connected;
            }
            catch (Exception)
            {
                G.isConnect = isConnect.Disconnected;
            }
            return(plcKey);
        }
예제 #2
0
        public void Create_Sip_Via_Success(string via)
        {
            // *** ACT ***
            Via    v  = Via.Parse(via);
            string vs = v.ToString();

            // *** ASSERT ***
            Assert.Equal(via, vs);
        }
예제 #3
0
        public void ProcessPreambleInitiator()
        {
            ResetWriteBuffer();

            buffer.WriteByte(VersionRecord);
            buffer.WriteByte(1);
            buffer.WriteByte(0);
            buffer.WriteByte(ModeRecord);
            buffer.WriteByte((byte)mode);
            buffer.WriteByte(ViaRecord);
            writer.Write(Via.ToString());
            buffer.WriteByte(KnownEncodingRecord); // FIXME
            buffer.WriteByte((byte)EncodingRecord);
            buffer.WriteByte(PreambleEndRecord);
            buffer.Flush();
            s.Write(buffer.GetBuffer(), 0, (int)buffer.Position);
            s.Flush();
        }