public void HoldDev(WLDev dev) { devs.AddLast(dev); }
public Queue <byte> GetMemory(WLDev dev) { return(typeof(WLDev).GetField("dataQueue", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(dev) as Queue <byte>); }
public void RemoveDev(WLDev dev) { devs.Remove(dev); }
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]); } } }
public WLComport(WLDev h) { host = h; }