Beispiel #1
0
        public void ModeCommandTest()
        {
            ViscaModeCommand <WBMode> viscaModeCmd = new ViscaModeCommand <WBMode>(
                1,
                new byte[] {
                Visca.Category.Camera1,
                Visca.Commands.WB
            },
                "WB",
                PolyWBMode.Table);

            viscaModeCmd.Mode.Should().Equals(PolyWBMode.Table);

            viscaModeCmd.Mode = PolyWBMode.Indoor;

            viscaModeCmd.Mode.Should().Equals(PolyWBMode.Indoor);

            visca.EnqueueCommand(viscaModeCmd.SetMode(PolyWBMode.Table));

            Assert.That(sendQueue.TryTake(out byte[] testPacket, 100), Is.True, "Timeout on sending data for ViscaModeCommand<WBMode>");
            Assert.That(testPacket.SequenceEqual(new byte[] { 0x81, 0x01, 0x04, 0x35, 0x06, 0xff }), Is.True, "ViscaModeCommand<WBMode> with PolyWBMode.Table bytes sequence does not match expected");

            // Respond Completion
            visca.ProcessIncomingData(new byte[] { 0x90, 0x50, 0xFF });
        }
        public void ViscaModeCommand()
        {
            OnOffMode mode = OnOffMode.On;
            ViscaModeCommand <OnOffMode> titleCommand = new ViscaModeCommand <OnOffMode>(0x01, new byte[] { Visca.Category.Camera1, Visca.Commands.Title }, "Title", mode);

            byte[] titleCommandBytes = titleCommand;
            Assert.That(titleCommandBytes.SequenceEqual(new byte[] { 0x81, 0x01, 0x04, 0x74, 0x02, 0xff }), Is.True, "Title On bytes sequence does not match expected");
        }