import nrfdlModule, { Device, // @ts-ignore nrfdlModule Is not a module } from '../../../index'; import { RELEASE_DIR } from './common/config'; require('../../../jasmine_shared.js'); /** * Test API: * - deviceControlSetMCUState() * * Test Schema: * - MCUState */ xdescribe('[MCU operations]: ', () => { jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000; let context = 0; const mcuDevices: Device[] = []; beforeAll(async () => { context = nrfdlModule.createContext({ plugins_dir: RELEASE_DIR }); const mcu: Device[] = await nrfdlModule.enumerate(context, { mcuBoot: true, }); mcuDevices.push(...mcu); }); // todo: finish // Note: Thingy:91 is not supported; Supported: 52 dongle/sdfu it('Test deviceControlSetMCUState()', async () => { expect(mcuDevices.length).toBeGreaterThan(0); console.log('mcuDevices', mcuDevices); const mcuDevicePromises = mcuDevices.map(async dev => { await nrfdlModule.deviceControlSetMcuState(context, dev.id, 'NRFDL_MCU_STATE_APPLICATION'); }); await Promise.all(mcuDevicePromises); }); });