示例#1
0
 public void SendData(int ledCount, byte[] data, LightingMode mode) // todo: when on keyboard mode, ledCount still has to be correct for the strip!
 {
     if (sender == null)
     {
         sender = new SACNSender(Guid.NewGuid(), "wled-nico");
     }
     Task.Run(() => sender.Send(1, SanitizeDataArray(ledCount, data, mode)));
 }
 public static async Task Send(byte[] data)
 {
     if (sender == null)
     {
         sender = new SACNSender(Guid.NewGuid(), "wled-nico");
     }
     await sender.Send(1, data);
 }
示例#3
0
 static SACNController()
 {
     // If the method throws no exceptions, consider directly initializing the sender variable
     try
     {
         sender = new SACNSender(Guid.NewGuid(), "wled-nico");
     }
     catch
     {
         Console.Error.WriteLine("Cound not initialize a SACN sender.");
     }
 }
示例#4
0
 private SACNController(bool reverseOrder)
 {
     this.reverseOrder = reverseOrder;
     // If the method throws no exceptions, consider directly initializing the sender variable
     try
     {
         sender = new SACNSender(Guid.NewGuid(), "wled-nico");
     }
     catch
     {
         Console.Error.WriteLine("Cound not initialize a SACN sender.");
     }
 }
示例#5
0
        static void Send()
        {
            SACNSender sender = new SACNSender(Guid.NewGuid(), "kadmium-sacn-core");

            byte[] data =
            {
                1, 2, 3, 4, 5, 255
            };
            while (true)
            {
                sender.Send(1, data).Wait();
                Console.WriteLine("Sent packet");
                Thread.Sleep(100);
            }
        }
 public SACNTransmitter(Guid uuid, string name, int port, int delay, bool multicast, IEnumerable<string> unicast) : base(name, delay)
 {
     Port = port;
     UnicastTargets = unicast;
     Multicast = multicast;
     try
     {
         SACNClient = new SACNSender(uuid, SOURCE_NAME, port);
         Status.Update(StatusCode.Running, "Sending", this);
     }
     catch (Exception e)
     {
         Status.Update(StatusCode.Error, e.Message, this);
     }
 }