Example #1
0
        public async Task JumpToBootloaderAsync()
        {
            byte[][] expected = { new byte[] { 0xfe, 0x02 } };

            await debug.JumpToBootloaderAsync();

            Assert.That(platform.GetCommands(), Is.EqualTo(expected));
            Assert.That(platform.nDisconnects, Is.EqualTo(1));
        }
        public async Task JumoToBootloaderRouteAsync()
        {
            byte[][] expected =
            {
                new byte[] { 0x09, 0x02, 0x01, 0x01, 0xff, 0x00, 0x06, 0x00, 0x01 },
                new byte[] { 0x0a, 0x02, 0x09, 0x03, 0x00, 0xfe, 0x02,0x00 },
                new byte[] { 0x0a, 0x03 }
            };

            await metawear.GetModule <ISwitch>().State.AddRouteAsync(source => source.Filter(Comparison.Eq, 1).React(token => debug.JumpToBootloaderAsync()));

            Assert.That(platform.nDisconnects, Is.EqualTo(0));
            Assert.That(platform.GetCommands(), Is.EqualTo(expected));
        }