コード例 #1
0
        static void UpdateLNP(HidStream lnp)
        {
            do
            {
                Color c1 = colors[0];
                Color c2 = colors[3];
                Color c3 = colors[1];
                Color c4 = colors[2];

                LightingNodeUtils.BeignUpdate(lnp);

                byte[][] stripInfo = LightingNodeUtils.UpdateFourStrips(c1, c2, c3, c4);

                for (int i = 0; i < stripInfo.Length; i++)
                {
                    lnp.Write(stripInfo[i]);
                }

                byte[][] fanInfo = LightingNodeUtils.UpdateSixFans(c1, c2, c3, c4);

                for (int i = 0; i < fanInfo.Length; i++)
                {
                    lnp.Write(fanInfo[i]);
                }

                LightingNodeUtils.SubmitUpdate(lnp);

                System.Threading.Thread.Sleep(34);
            } while (running);
        }
コード例 #2
0
        static void UpdateLNP(HidStream lnp, Color c1, Color c2, Color c3, Color c4)
        {
            do
            {
                c1 = backIOColor;
                c2 = headerTwoColor;
                c3 = pchColor;
                c4 = headerOneColor;

                LightingNodeUtils.BeignUpdate(lnp);

                byte[][] stripInfo = LightingNodeUtils.UpdateFourStrips(c1, c2, c3, c4);

                for (int i = 0; i < stripInfo.Length; i++)
                {
                    lnp.Write(stripInfo[i]);
                }

                byte[][] fanInfo = LightingNodeUtils.UpdateSixFans(c1, c2, c3, c4);

                for (int i = 0; i < fanInfo.Length; i++)
                {
                    lnp.Write(fanInfo[i]);
                }

                LightingNodeUtils.SubmitUpdate(lnp);

                System.Threading.Thread.Sleep(15);
            } while (running);
        }
コード例 #3
0
        static void InitializeDevices()
        {
            corsairLNP = new HidDeviceLoader().GetDevices().Where(d => d.ProductID == 0x0C0B).First();
            lnpStream  = corsairLNP.Open();
            LightingNodeUtils.FirstTransaction(lnpStream);

            surface            = RGBSurface.Instance;
            surface.Exception += args => Debug.WriteLine(args.Exception.Message);
            surface.UpdateMode = UpdateMode.Continuous;
            surface.LoadDevices(AsusDeviceProvider.Instance, RGBDeviceType.Mainboard);
            surface.LoadDevices(CorsairDeviceProvider.Instance);

            auraMb              = surface.Devices.OfType <AsusMainboardRGBDevice>().First();
            auraMb.UpdateMode   = DeviceUpdateMode.SyncBack;
            corsairKeyboard     = surface.Devices.OfType <CorsairKeyboardRGBDevice>().First();
            corsairMousepad     = surface.Devices.OfType <CorsairMousepadRGBDevice>().First();
            corsairHeadsetStand = surface.Devices.OfType <CorsairHeadsetStandRGBDevice>().First();

            IBridgeLocator locator                = new HttpBridgeLocator();
            var            locateBridges          = locator.LocateBridgesAsync(TimeSpan.FromSeconds(5));
            IEnumerable <LocatedBridge> bridgeIPs = locateBridges.Result;

            if (bridgeIPs.Where(B => B.BridgeId == "001788fffe678124").Count() > 0)
            {
                bridgeOne = new LocalHueClient(bridgeIPs.Where(B => B.BridgeId == "001788fffe678124").First().IpAddress);
                var registerOne = bridgeOne.RegisterAsync("LightingLink", "WarMachine");
                //string appKeyOne = registerOne.Result;
                bridgeOne.Initialize("NnmhRXVqLmBUw93kmIwi8PPCt6QHgWlHwkTYT9NC");
            }

            if (bridgeIPs.Where(B => B.BridgeId == "001788fffea04d9c").Count() > 0)
            {
                bridgeTwo = new LocalHueClient(bridgeIPs.Where(B => B.BridgeId == "001788fffea04d9c").First().IpAddress);
                var registerTwo = bridgeTwo.RegisterAsync("LightingLink", "WarMachine");
                //string appKeyTwo = registerTwo.Result;
                bridgeTwo.Initialize("2b0AIky9S2g1LgbggOgsCdNV8EzE2JS8QfBOCHHv");
            }

            GetAsusColors();
        }
コード例 #4
0
        static void InitializeDevices()
        {
            exclusive = new OpenConfiguration();
            exclusive.SetOption(OpenOption.Exclusive, true);
            exclusive.SetOption(OpenOption.Interruptible, false);

            corsairLNP = DeviceList.Local.GetHidDevices().Where(d => d.ProductID == 0x0C0B).First();
            lnpStream  = corsairLNP.Open(exclusive);
            LightingNodeUtils.FirstTransaction(lnpStream);

            surface            = RGBSurface.Instance;
            surface.Exception += args => Debug.WriteLine(args.Exception.Message);
            surface.LoadDevices(AsusDeviceProvider.Instance, RGBDeviceType.Mainboard);
            surface.LoadDevices(CorsairDeviceProvider.Instance);

            auraMb              = surface.Devices.OfType <AsusMainboardRGBDevice>().First();
            auraMb.UpdateMode   = DeviceUpdateMode.SyncBack;
            corsairKeyboard     = surface.Devices.OfType <CorsairKeyboardRGBDevice>().First();
            corsairMousepad     = surface.Devices.OfType <CorsairMousepadRGBDevice>().First();
            corsairHeadsetStand = surface.Devices.OfType <CorsairHeadsetStandRGBDevice>().First();

            GetAsusColors();
        }