public void ConnectToSpecificDevice()
        {
            var serialNumber = "0x1A002944";

            var device = Blink1Connector.Connect(serialNumber);

            Assert.NotNull(device);
        }
示例#2
0
        public static void TurnOff()
        {
            var connected = Blink1Connector.Scan();

            foreach (Blink1 blink in connected.ToArray())
            {
                blink.TurnOff();
            }
        }
示例#3
0
        public static void SetBlinkColor(Color color)
        {
            var connected = Blink1Connector.Scan();

            foreach (Blink1 blink in connected.ToArray())
            {
                blink.Set(color);
            }
        }
        public Blink1Controller()
        {
            var blink1 = Blink1Connector.Scan()?.FirstOrDefault();

            if (blink1 == null)
            {
                throw new InvalidOperationException("No Blink(1) device connected.");
            }

            Blink1 = (Blink1)blink1;
        }
        public void ScanWithNoDevicesFindsNone()
        {
            var devices = Blink1Connector.Scan();

            Assert.Empty(devices);
        }
        public void ScanFindsDevices()
        {
            var devices = Blink1Connector.Scan();

            Assert.NotEmpty(devices);
        }
示例#7
0
 public Blink1Mk2Fixture()
 {
     blink1 = Blink1Connector.Scan().FirstOrDefault(b => (b is IBlink1Mk2)) as IBlink1Mk2;
 }