Beispiel #1
0
        private SmartConfigContext CreateContext()
        {
            var provider = new AirkissSmartConfigProvider();
            var ctx      = provider.CreateContext();

            ctx.SetOption(AirkissOptionNames.RandomNumber, (byte)107);

            return(ctx);
        }
Beispiel #2
0
        public void CanParseMacAddress()
        {
            var interpreter = new AirkissDevicePacketInterpreter();
            var packet      = new byte[] { 0x53, 0xc8, 0x2b, 0x96, 0xa1, 0x57, 0x70 };
            var provider    = new AirkissSmartConfigProvider();
            var ctx         = provider.CreateContext();

            ctx.SetOption <byte>(AirkissOptionNames.RandomNumber, 0x53);
            Assert.True(interpreter.Validate(ctx, packet));
            var mac         = interpreter.ParseMacAddress(packet);
            var expectedMac = new PhysicalAddress(new byte[] { 0xc8, 0x2b, 0x96, 0xa1, 0x57, 0x70 });

            Assert.AreEqual(expectedMac, mac);
        }