Esempio n. 1
0
 public void HoldDev(WLDev dev)
 {
     devs.AddLast(dev);
 }
Esempio n. 2
0
 public Queue <byte> GetMemory(WLDev dev)
 {
     return(typeof(WLDev).GetField("dataQueue", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(dev) as Queue <byte>);
 }
Esempio n. 3
0
 public void RemoveDev(WLDev dev)
 {
     devs.Remove(dev);
 }
Esempio n. 4
0
 public void MesssageBroadcast(byte [] buff, int offset, int len, bool broadcast, WLDev sender = null)
 {
     if (broadcast)
     {
         foreach (var d in from d in devs where d != sender select d)
         {
             var m = GetMemory(d);
             for (int i = 0, k = offset; i < len; i++, k++)
             {
                 m.Enqueue(buff[k]);
             }
         }
     }
     else
     {
         var m = GetMemory(this);
         for (int i = 0, k = offset; i < len; i++, k++)
         {
             m.Enqueue(buff[k]);
         }
     }
 }
Esempio n. 5
0
 public WLComport(WLDev h)
 {
     host = h;
 }