Example #1
0
        public async override Task SetUp()
        {
            platform.fileSuffix = "logging_time_refs";
            metawear            = new MetaWearBoard(platform, platform);

            await metawear.DeserializeAsync();

            await metawear.InitializeAsync();

            logging = metawear.GetModule <ILogging>();
        }
        /// <summary>
        /// Instantiates an <see cref="IMetaWearBoard"/> object corresponding to the BluetoothLE device
        /// </summary>
        /// <param name="device">BluetoothLE device object corresponding to the target MetaWear board</param>
        /// <returns><see cref="IMetaWearBoard"/> object</returns>
        public static IMetaWearBoard GetMetaWearBoard(BluetoothLEDevice device)
        {
            if (btleDevices.TryGetValue(device.BluetoothAddress, out var board))
            {
                return(board);
            }

            board = new MetaWearBoard(new BluetoothLeGatt(device), new IO(device.BluetoothAddress));
            btleDevices.Add(device.BluetoothAddress, board);
            return(board);
        }
Example #3
0
        public async Task LongFirmwareAsync()
        {
            var firmware = "1.3.90";

            platform = new NunitPlatform(new InitializeResponse(firmware, typeof(IGpio), typeof(ILogging)));
            metawear = new MetaWearBoard(platform, platform);

            await metawear.InitializeAsync();

            var info = await metawear.ReadDeviceInformationAsync();

            Assert.That(info.FirmwareRevision, Is.EqualTo(firmware));
        }
Example #4
0
        public async Task SameFirmware()
        {
            byte[][] expected =
            {
                new byte[] { 0x0b, 0x84 }
            };

            platform            = new NunitPlatform(new InitializeResponse());
            platform.fileSuffix = "gpio_feedback";

            metawear = new MetaWearBoard(platform, platform);
            await metawear.DeserializeAsync();

            await metawear.InitializeAsync();

            Assert.That(platform.GetConnectCommands(), Is.EqualTo(expected));
        }
        public async Task NewFirmware()
        {
            byte[][] expected =
            {
                new byte[] { 0x01, 0x80 },
                new byte[] { 0x02, 0x80 },
                new byte[] { 0x03, 0x80 },
                new byte[] { 0x04, 0x80 },
                new byte[] { 0x05, 0x80 },
                new byte[] { 0x06, 0x80 },
                new byte[] { 0x07, 0x80 },
                new byte[] { 0x08, 0x80 },
                new byte[] { 0x09, 0x80 },
                new byte[] { 0x0a, 0x80 },
                new byte[] { 0x0b, 0x80 },
                new byte[] { 0x0c, 0x80 },
                new byte[] { 0x0d, 0x80 },
                new byte[] { 0x0f, 0x80 },
                new byte[] { 0x10, 0x80 },
                new byte[] { 0x11, 0x80 },
                new byte[] { 0x12, 0x80 },
                new byte[] { 0x13, 0x80 },
                new byte[] { 0x14, 0x80 },
                new byte[] { 0x15, 0x80 },
                new byte[] { 0x16, 0x80 },
                new byte[] { 0x17, 0x80 },
                new byte[] { 0x18, 0x80 },
                new byte[] { 0x19, 0x80 },
                new byte[] { 0xfe, 0x80 },
                new byte[] { 0x0b, 0x84 }
            };

            platform = new NunitPlatform(new InitializeResponse("1.3.4", typeof(IGpio), typeof(ILogging)))
            {
                fileSuffix = "scheduled_task"
            };

            metawear = new MetaWearBoard(platform, platform);
            await metawear.DeserializeAsync();

            await metawear.InitializeAsync();

            Assert.That(platform.GetConnectCommands(), Is.EqualTo(expected));
        }
Example #6
0
 public async virtual Task SetUp()
 {
     metawear = new MetaWearBoard(platform, platform);
     await metawear.InitializeAsync();
 }
Example #7
0
 public override Task SetUp()
 {
     metawear = new MetaWearBoard(platform, platform);
     return(Task.FromResult(true));
 }
Example #8
0
 public override void SetUp()
 {
     metawear = new MetaWearBoard(platform, platform);
 }
 public virtual void SetUp()
 {
     metawear = new MetaWearBoard(platform, platform);
     metawear.InitializeAsync().Wait();
 }