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); }
public void Create_Sip_Via_Success(string via) { // *** ACT *** Via v = Via.Parse(via); string vs = v.ToString(); // *** ASSERT *** Assert.Equal(via, vs); }
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(); }