Exemplo n.º 1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 ///
 /// <param name="target">El target con el cuál comunicarse.</param>
 public ProtoHandler(TargetBag target)
 {
     inputQ        = new Queue <int>();
     this.target   = target;
     this.Timeout  = 5000;
     this.usedPort = ConstructPort();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Método fábrica, a partir del tipo de dispositivo conectado.
 /// </summary>
 ///
 /// <param name="bag"></param>
 /// <returns></returns>
 public static VirtualPort FromTargetBag(TargetBag bag)
 {
     if (!bag.UseNetwork)
     {
         return(new VirtualSerialPort(bag.PortName, (int)bag.Speed, Parity.None, 8, StopBits.One));
     }
     return(new VirtualEthernetPort(IPAddress.Parse(bag.IPAddress)));
 }