Пример #1
0
 public IEnumerable <NetworkMessage> MarshalNetworkMessages()
 {
     if (null != mPingReply)
     {
         var pr = mPingReply;
         mPingReply = null;
         yield return(pr);
     }
     if (null == Binding)
     {
         // clear down from last binding..
         if (mBtnClr != ButtonColour.Off)
         {
             mBtnClr = ButtonColour.Off;
             yield return(new NetworkMessageButtonColour(mBtnClr));
         }
     }
     else
     {
         // using the binding map
         if (Binding.ButtonColour != mBtnClr)
         {
             mBtnClr = Binding.ButtonColour;
             yield return(new NetworkMessageButtonColour(mBtnClr));
         }
         yield return(new NetworkMessageColourVector(Binding.FrameBuffer));
     }
 }
Пример #2
0
 public NetworkMessageButtonColour(ButtonColour btn, NetworkColourOrder order = NetworkColourOrder.RGB)
     : base(order)
 {
     AddByte((byte)NetworkMessageType.ButtonColour);
     AddColour(btn.Min);
     AddColour(btn.Max);
     AddShort(btn.Period);
     AddColour(btn.OnHeld);
 }
Пример #3
0
 public void UpdateFromNetworkData(IGlimDevice args)
 {
     if (0 == BootCount || args.Uptime.TotalSeconds < Uptime.TotalSeconds)
     {
         BootCount++;
         mBtnClr = ButtonColour.Off;                 // reload from binding
     }
     IPEndPoint   = args.IPEndPoint;
     HardwareType = args.HardwareType;
     Uptime       = args.Uptime;
     CPU          = args.CPU;
     RSSI         = args.RSSI;
     dBm          = args.dBm;
     UpdatedFromNetworkData?.Invoke(this, EventArgs.Empty);
 }
Пример #4
0
 public GlimDevice(string hostname)
 {
     HostName   = hostname;
     mBtnClr    = ButtonColour.Off;
     mPingReply = null;
 }