@nordicsemiconductor/pc-nrfconnect-shared 121.0.0 → 122.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/Changelog.md +34 -0
  2. package/coverage/cobertura-coverage.xml +1330 -1197
  3. package/nrfutil/device/__mocks__/device.ts +2 -0
  4. package/nrfutil/device/batch.ts +18 -2
  5. package/nrfutil/device/common.ts +17 -38
  6. package/nrfutil/device/device.ts +2 -0
  7. package/nrfutil/device/deviceInfo.ts +70 -0
  8. package/nrfutil/device/erase.ts +2 -2
  9. package/nrfutil/device/firmwareRead.ts +2 -2
  10. package/nrfutil/device/getCoreInfo.ts +2 -2
  11. package/nrfutil/device/getFwInfo.ts +2 -2
  12. package/nrfutil/device/getProtectionStatus.ts +2 -2
  13. package/nrfutil/device/list.ts +4 -30
  14. package/nrfutil/device/program.ts +4 -4
  15. package/nrfutil/device/recover.ts +2 -2
  16. package/nrfutil/device/reset.ts +2 -2
  17. package/nrfutil/device/setMcuState.ts +2 -5
  18. package/nrfutil/device/setProtectionStatus.ts +2 -2
  19. package/nrfutil/index.ts +1 -1
  20. package/nrfutil/moduleVersion.ts +20 -0
  21. package/nrfutil/sandboxTypes.ts +14 -0
  22. package/package.json +1 -1
  23. package/src/About/DeviceCard.tsx +6 -5
  24. package/src/About/SupportCard.tsx +2 -2
  25. package/src/Device/DeviceSelector/BasicDeviceInfo.tsx +12 -6
  26. package/src/Device/DeviceSelector/DeviceList/AnimatedList.tsx +1 -1
  27. package/src/Device/DeviceSelector/DeviceList/Device.tsx +7 -5
  28. package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +23 -5
  29. package/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.tsx +7 -6
  30. package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +26 -30
  31. package/src/Device/DeviceSelector/DeviceList/edit-device-buttons.scss +1 -2
  32. package/src/Device/DeviceSelector/DeviceSelector.test.tsx +17 -37
  33. package/src/Device/DeviceSelector/DeviceSelector.tsx +38 -13
  34. package/src/Device/DeviceSelector/Favorite.tsx +10 -10
  35. package/src/Device/DeviceSelector/basic-device-info.scss +0 -12
  36. package/src/Device/deviceInfo/deviceInfo.ts +2 -2
  37. package/src/Device/deviceLister.ts +52 -43
  38. package/src/Device/deviceSetup.ts +27 -10
  39. package/src/Device/deviceSlice.ts +148 -84
  40. package/src/Device/jprogOperations.ts +56 -27
  41. package/src/Device/sdfuOperations.ts +25 -31
  42. package/src/InlineInput/NumberInlineInput.tsx +1 -1
  43. package/src/InlineInput/NumberInputWithDropdown.tsx +1 -2
  44. package/src/index.ts +1 -0
  45. package/src/logging/sendInitialLogMessages.ts +13 -9
  46. package/src/utils/logLibVersions.ts +1 -1
  47. package/src/utils/systemReport.ts +3 -3
  48. package/typings/generated/nrfutil/device/__mocks__/device.d.ts +1 -0
  49. package/typings/generated/nrfutil/device/__mocks__/device.d.ts.map +1 -1
  50. package/typings/generated/nrfutil/device/batch.d.ts +3 -2
  51. package/typings/generated/nrfutil/device/batch.d.ts.map +1 -1
  52. package/typings/generated/nrfutil/device/common.d.ts +6 -33
  53. package/typings/generated/nrfutil/device/common.d.ts.map +1 -1
  54. package/typings/generated/nrfutil/device/device.d.ts +13 -12
  55. package/typings/generated/nrfutil/device/device.d.ts.map +1 -1
  56. package/typings/generated/nrfutil/device/deviceInfo.d.ts +40 -0
  57. package/typings/generated/nrfutil/device/deviceInfo.d.ts.map +1 -0
  58. package/typings/generated/nrfutil/device/erase.d.ts +2 -2
  59. package/typings/generated/nrfutil/device/erase.d.ts.map +1 -1
  60. package/typings/generated/nrfutil/device/firmwareRead.d.ts +2 -2
  61. package/typings/generated/nrfutil/device/firmwareRead.d.ts.map +1 -1
  62. package/typings/generated/nrfutil/device/getCoreInfo.d.ts +2 -2
  63. package/typings/generated/nrfutil/device/getCoreInfo.d.ts.map +1 -1
  64. package/typings/generated/nrfutil/device/getFwInfo.d.ts +2 -2
  65. package/typings/generated/nrfutil/device/getFwInfo.d.ts.map +1 -1
  66. package/typings/generated/nrfutil/device/getProtectionStatus.d.ts +2 -2
  67. package/typings/generated/nrfutil/device/getProtectionStatus.d.ts.map +1 -1
  68. package/typings/generated/nrfutil/device/list.d.ts +3 -3
  69. package/typings/generated/nrfutil/device/list.d.ts.map +1 -1
  70. package/typings/generated/nrfutil/device/program.d.ts +2 -2
  71. package/typings/generated/nrfutil/device/program.d.ts.map +1 -1
  72. package/typings/generated/nrfutil/device/recover.d.ts +2 -2
  73. package/typings/generated/nrfutil/device/recover.d.ts.map +1 -1
  74. package/typings/generated/nrfutil/device/reset.d.ts +2 -2
  75. package/typings/generated/nrfutil/device/reset.d.ts.map +1 -1
  76. package/typings/generated/nrfutil/device/setMcuState.d.ts +2 -2
  77. package/typings/generated/nrfutil/device/setMcuState.d.ts.map +1 -1
  78. package/typings/generated/nrfutil/device/setProtectionStatus.d.ts +2 -2
  79. package/typings/generated/nrfutil/device/setProtectionStatus.d.ts.map +1 -1
  80. package/typings/generated/nrfutil/index.d.ts +2 -1
  81. package/typings/generated/nrfutil/index.d.ts.map +1 -1
  82. package/typings/generated/nrfutil/moduleVersion.d.ts +4 -0
  83. package/typings/generated/nrfutil/moduleVersion.d.ts.map +1 -1
  84. package/typings/generated/nrfutil/sandboxTypes.d.ts +9 -0
  85. package/typings/generated/nrfutil/sandboxTypes.d.ts.map +1 -1
  86. package/typings/generated/src/About/DeviceCard.d.ts.map +1 -1
  87. package/typings/generated/src/Device/DeviceSelector/BasicDeviceInfo.d.ts.map +1 -1
  88. package/typings/generated/src/Device/DeviceSelector/DeviceList/Device.d.ts +0 -1
  89. package/typings/generated/src/Device/DeviceSelector/DeviceList/Device.d.ts.map +1 -1
  90. package/typings/generated/src/Device/DeviceSelector/DeviceList/DeviceList.d.ts.map +1 -1
  91. package/typings/generated/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.d.ts.map +1 -1
  92. package/typings/generated/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.d.ts +0 -1
  93. package/typings/generated/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.d.ts.map +1 -1
  94. package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts.map +1 -1
  95. package/typings/generated/src/Device/DeviceSelector/Favorite.d.ts +0 -1
  96. package/typings/generated/src/Device/DeviceSelector/Favorite.d.ts.map +1 -1
  97. package/typings/generated/src/Device/deviceLister.d.ts +1 -15
  98. package/typings/generated/src/Device/deviceLister.d.ts.map +1 -1
  99. package/typings/generated/src/Device/deviceSetup.d.ts +6 -5
  100. package/typings/generated/src/Device/deviceSetup.d.ts.map +1 -1
  101. package/typings/generated/src/Device/deviceSlice.d.ts +12 -15
  102. package/typings/generated/src/Device/deviceSlice.d.ts.map +1 -1
  103. package/typings/generated/src/Device/jprogOperations.d.ts.map +1 -1
  104. package/typings/generated/src/Device/sdfuOperations.d.ts.map +1 -1
  105. package/typings/generated/src/InlineInput/NumberInlineInput.d.ts +1 -1
  106. package/typings/generated/src/InlineInput/NumberInlineInput.d.ts.map +1 -1
  107. package/typings/generated/src/InlineInput/NumberInputWithDropdown.d.ts.map +1 -1
  108. package/typings/generated/src/index.d.ts +1 -1
  109. package/typings/generated/src/index.d.ts.map +1 -1
  110. package/typings/generated/src/logging/sendInitialLogMessages.d.ts.map +1 -1
  111. package/typings/generated/src/utils/systemReport.d.ts +1 -1
  112. package/typings/generated/src/utils/systemReport.d.ts.map +1 -1
  113. package/src/Device/DeviceSelector/DeviceList/device.scss +0 -28
  114. package/src/Device/DeviceSelector/DeviceList/more-device-info.scss +0 -33
  115. package/src/Device/DeviceSelector/favorite.scss +0 -17
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import NrfutilDeviceLib from '../../nrfutil/device/device';
8
+ import { DeviceInfo } from '../../nrfutil/device/deviceInfo';
8
9
  import { FWInfo } from '../../nrfutil/device/getFwInfo';
9
10
  import logger from '../logging';
10
11
  import type { AppThunk, RootState } from '../store';
@@ -18,14 +19,15 @@ const getDeviceReadProtection = async (
18
19
  readbackProtection: 'unknown' | 'protected' | 'unprotected';
19
20
  }> => {
20
21
  try {
22
+ logger.info('Checking readback protection on device');
21
23
  const info = await NrfutilDeviceLib.getFwInfo(device);
22
24
  return {
23
25
  fwInfo: info,
24
26
  readbackProtection: 'unprotected',
25
27
  };
26
- } catch (error) {
27
- // @ts-expect-error Wrongly typed in device lib at the moment
28
- if (error.error_code === 24) {
28
+ } catch (e) {
29
+ const error = e as Error;
30
+ if (error.message.includes('NotAvailableBecauseProtection')) {
29
31
  logger.warn(
30
32
  'Readback protection on device enabled. Unable to verify that the firmware version is correct.'
31
33
  );
@@ -49,29 +51,50 @@ const programDeviceWithFw =
49
51
  ): AppThunk<RootState, Promise<Device>> =>
50
52
  async (dispatch, getState) => {
51
53
  try {
52
- if (getState().device.readbackProtection === 'protected') {
53
- logger.info('Recovering device');
54
- onProgress(0, 'Recovering device');
55
- await NrfutilDeviceLib.recover(device, 'Application');
54
+ const batch = NrfutilDeviceLib.batch();
55
+ if (getState().device.readbackProtection !== 'unprotected') {
56
+ batch.recover('Application', {
57
+ onTaskBegin: () =>
58
+ logger.info(`Device protected, recovering device`),
59
+ onTaskEnd: () => logger.info(`Finished recovering device.`),
60
+ onException: () =>
61
+ logger.error(`Failed to recover device.`),
62
+ onProgress: progress => {
63
+ onProgress(
64
+ progress.totalProgressPercentage,
65
+ 'Recovering device'
66
+ );
67
+ },
68
+ });
56
69
  }
57
70
 
58
- logger.debug(
59
- `Programming ${device.serialNumber} with ${selectedFw.fw}`
60
- );
61
- await NrfutilDeviceLib.program(
62
- device,
63
- selectedFw.fw,
64
- progress => {
71
+ batch.program(selectedFw.fw, 'Application', undefined, undefined, {
72
+ onTaskBegin: () => logger.info(`Programming device`),
73
+ onTaskEnd: () => logger.info(`Finished programming device.`),
74
+ onException: () => logger.error(`Failed to program device.`),
75
+ onProgress: progress => {
65
76
  onProgress(
66
77
  progress.totalProgressPercentage,
67
78
  progress.message ?? 'programming'
68
79
  );
69
80
  },
70
- 'Application'
71
- );
72
- logger.debug(`Resetting ${device.serialNumber}`);
73
- onProgress(100, 'Resetting device');
81
+ });
82
+
83
+ batch.reset('Application', undefined, {
84
+ onTaskBegin: () => logger.info(`Resting device`),
85
+ onTaskEnd: () => logger.info(`Finished resting device.`),
86
+ onException: () => logger.error(`Failed to reset device.`),
87
+ onProgress: progress => {
88
+ onProgress(
89
+ progress.totalProgressPercentage,
90
+ 'Resetting device'
91
+ );
92
+ },
93
+ });
94
+
95
+ await batch.run(device);
74
96
  await NrfutilDeviceLib.reset(device);
97
+ onProgress(0, 'Updating readback protection');
75
98
  const { readbackProtection } = await getDeviceReadProtection(
76
99
  device
77
100
  );
@@ -88,12 +111,18 @@ const programDeviceWithFw =
88
111
  return device;
89
112
  };
90
113
 
91
- const firmwareOptions = (device: Device, firmware: JprogEntry[]) =>
114
+ const firmwareOptions = (
115
+ device: Device,
116
+ firmware: JprogEntry[],
117
+ deviceInfo?: DeviceInfo
118
+ ) =>
92
119
  firmware.filter(fw => {
93
- const family = (device.jlink?.deviceFamily || '').toLowerCase();
94
- const deviceType = (device.jlink?.deviceVersion || '').toLowerCase();
120
+ const family = (device.devkit?.deviceFamily || '').toLowerCase();
121
+ const deviceType = (
122
+ deviceInfo?.jlink?.deviceVersion || ''
123
+ ).toLowerCase();
95
124
  const shortDeviceType = deviceType.split('_').shift();
96
- const boardVersion = (device.jlink?.boardVersion || '').toLowerCase();
125
+ const boardVersion = (device.devkit?.boardVersion || '').toLowerCase();
97
126
 
98
127
  const key = fw.key.toLowerCase();
99
128
  return (
@@ -108,11 +137,11 @@ export const jprogDeviceSetup = (
108
137
  firmware: JprogEntry[],
109
138
  needSerialport = false
110
139
  ): DeviceSetup => ({
111
- supportsProgrammingMode: (device: Device) =>
140
+ supportsProgrammingMode: device =>
112
141
  (needSerialport === !!device.traits.serialPorts || !needSerialport) &&
113
142
  !!device.traits.jlink,
114
- getFirmwareOptions: device =>
115
- firmwareOptions(device, firmware).map(firmwareOption => ({
143
+ getFirmwareOptions: (device, deviceInfo) =>
144
+ firmwareOptions(device, firmware, deviceInfo).map(firmwareOption => ({
116
145
  key: firmwareOption.key,
117
146
  description: firmwareOption.description,
118
147
  programDevice: onProgress => dispatch =>
@@ -120,8 +149,8 @@ export const jprogDeviceSetup = (
120
149
  programDeviceWithFw(device, firmwareOption, onProgress)
121
150
  ),
122
151
  })),
123
- isExpectedFirmware: (device: Device) => dispatch => {
124
- const fwVersions = firmwareOptions(device, firmware);
152
+ isExpectedFirmware: (device, deviceInfo) => dispatch => {
153
+ const fwVersions = firmwareOptions(device, firmware, deviceInfo);
125
154
  if (fwVersions.length === 0) {
126
155
  return Promise.resolve({
127
156
  device,
@@ -46,8 +46,9 @@ export const isDeviceInDFUBootloader = (device: Device) => {
46
46
  d.idProduct === NORDIC_DFU_PRODUCT_ID
47
47
  );
48
48
  }
49
- if (device.serialport) {
50
- const { vendorId, productId } = device.serialport;
49
+
50
+ if (device.serialPorts && device.serialPorts[0]) {
51
+ const { vendorId, productId } = device.serialPorts[0];
51
52
  return vendorId === '1915' && productId?.toUpperCase() === '521F';
52
53
  }
53
54
  return false;
@@ -410,9 +411,7 @@ const programInDFUBootloader =
410
411
  onFail: (reason?: unknown) => void
411
412
  ): AppThunk<RootState, Promise<void>> =>
412
413
  async dispatch => {
413
- logger.debug(
414
- `${device.serialNumber} on ${device.serialport?.comName} is now in DFU-Bootloader...`
415
- );
414
+ logger.debug(`${device.serialNumber} on is now in DFU-Bootloader...`);
416
415
  const { application, softdevice } = dfu;
417
416
  const params: Partial<InitPacket> = dfu.params || {};
418
417
 
@@ -545,9 +544,9 @@ export const sdfuDeviceSetup = (
545
544
  dfuFirmware: DfuEntry[],
546
545
  needSerialport = false
547
546
  ): DeviceSetup => ({
548
- supportsProgrammingMode: (device: Device) =>
549
- ((!!device.dfuTriggerVersion &&
550
- device.dfuTriggerVersion.semVer.length > 0) ||
547
+ supportsProgrammingMode: (device, deviceInfo) =>
548
+ ((!!deviceInfo?.dfuTriggerVersion &&
549
+ deviceInfo.dfuTriggerVersion.semVer.length > 0) ||
551
550
  isDeviceInDFUBootloader(device)) &&
552
551
  (needSerialport === device.traits.serialPorts || !needSerialport),
553
552
  getFirmwareOptions: device =>
@@ -559,31 +558,26 @@ export const sdfuDeviceSetup = (
559
558
  programDeviceWithFw(device, firmwareOption, onProgress)
560
559
  ),
561
560
  })),
562
- isExpectedFirmware: (device: Device) => () =>
563
- new Promise<{
564
- device: Device;
565
- validFirmware: boolean;
566
- }>(resolve => {
567
- if (device.dfuTriggerVersion) {
568
- logger.debug(
569
- 'Device has DFU trigger interface, the device is in Application mode'
570
- );
561
+ isExpectedFirmware: (device, deviceInfo) => () => {
562
+ if (deviceInfo?.dfuTriggerVersion) {
563
+ logger.debug(
564
+ 'Device has DFU trigger interface, the device is in Application mode'
565
+ );
571
566
 
572
- const { semVer } = device.dfuTriggerVersion;
567
+ const { semVer } = deviceInfo.dfuTriggerVersion;
573
568
 
574
- resolve({
575
- device,
576
- validFirmware:
577
- dfuFirmware.filter(fw => fw.semver === semVer).length >
578
- 0,
579
- });
580
- } else {
581
- resolve({
582
- device,
583
- validFirmware: false,
584
- });
585
- }
586
- }),
569
+ return Promise.resolve({
570
+ device,
571
+ validFirmware:
572
+ dfuFirmware.filter(fw => fw.semver === semVer).length > 0,
573
+ });
574
+ }
575
+
576
+ return Promise.resolve({
577
+ device,
578
+ validFirmware: false,
579
+ });
580
+ },
587
581
  tryToSwitchToApplicationMode: device => dispatch =>
588
582
  new Promise<Device>((resolve, reject) => {
589
583
  dispatch(switchToApplicationMode(device, resolve, reject));
@@ -19,7 +19,7 @@ import InlineInput from './InlineInput';
19
19
 
20
20
  import './number-inline-input.scss';
21
21
 
22
- export interface NumberInlineInput {
22
+ interface NumberInlineInput {
23
23
  disabled?: boolean;
24
24
  value: number;
25
25
  range: RangeOrValues;
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  import React, { useState } from 'react';
8
- import FormLabel from 'react-bootstrap/esm/FormLabel';
9
8
 
10
9
  import { DropdownItem } from '../Dropdown/Dropdown';
11
10
  import { RangeOrValues } from '../Slider/range';
@@ -66,7 +65,7 @@ export default ({
66
65
  }}
67
66
  title={title}
68
67
  >
69
- <FormLabel className="tw-mb-1 tw-text-xs">{label}</FormLabel>
68
+ <div className="tw-mb-1 tw-text-xs">{label}</div>
70
69
  <div className="tw-flex tw-h-8 tw-w-full">
71
70
  <NumberInlineInput
72
71
  value={inlineValue}
package/src/index.ts CHANGED
@@ -103,6 +103,7 @@ export { sdfuDeviceSetup } from './Device/sdfuOperations';
103
103
 
104
104
  export {
105
105
  selectedDevice,
106
+ selectedDeviceInfo,
106
107
  getReadbackProtection,
107
108
  persistSerialPortOptions,
108
109
  type Device,
@@ -7,7 +7,7 @@
7
7
  import { inMain as appDetails } from '../../ipc/appDetails';
8
8
  import NrfutilDeviceLib from '../../nrfutil/device/device';
9
9
  import {
10
- describeVersion,
10
+ getExpectedVersion,
11
11
  resolveModuleVersion,
12
12
  } from '../../nrfutil/moduleVersion';
13
13
  import { getAppDataDir } from '../utils/appDirs';
@@ -34,7 +34,6 @@ export default async () => {
34
34
  installed,
35
35
  homeDir,
36
36
  tmpDir,
37
- bundledJlink,
38
37
  source,
39
38
  } = details;
40
39
 
@@ -47,16 +46,21 @@ export default async () => {
47
46
  logger.debug(`HomeDir: ${homeDir}`);
48
47
  logger.debug(`TmpDir: ${tmpDir}`);
49
48
 
50
- if (bundledJlink) {
51
- const dependencies = (await NrfutilDeviceLib.getModuleVersion())
52
- .dependencies;
53
- const jlinkVersion = resolveModuleVersion('JlinkARM', dependencies);
49
+ const dependencies = (await NrfutilDeviceLib.getModuleVersion())
50
+ .dependencies;
51
+ const jlinkVersion = resolveModuleVersion('JlinkARM', dependencies);
54
52
 
55
- if (!describeVersion(jlinkVersion).includes(bundledJlink)) {
56
- logger.info(
57
- `Installed JLink version does not match the provided version (${bundledJlink})`
53
+ if (jlinkVersion) {
54
+ const result = getExpectedVersion(jlinkVersion);
55
+ if (!result.isExpectedVersion) {
56
+ logger.warn(
57
+ `Installed JLink version does not match the expected version (${result.expectedVersion})`
58
58
  );
59
59
  }
60
+ } else {
61
+ logger.warn(
62
+ `JLink is not installed. Please install JLink from: https://www.segger.com/downloads/jlink`
63
+ );
60
64
  }
61
65
 
62
66
  if (!udevInstalled()) {
@@ -91,7 +91,7 @@ export default async () => {
91
91
  `It looks like you have installed JLink using ${JLinkInstallerVersion}, but currently we only support their Universal Installer for your system.`
92
92
  );
93
93
  logger.warn(
94
- `Please install JLink: https://www.segger.com/downloads/jlink/JLink_MacOSX_V780c_universal.pkg`
94
+ `Please install JLink: https://www.segger.com/downloads/jlink/JLink_MacOSX_V788j_universal.pkg`
95
95
  );
96
96
  }
97
97
  }
@@ -89,7 +89,7 @@ const allDevicesReport = (allDevices: Device[] = []) => [
89
89
  ...allDevices.map(
90
90
  d =>
91
91
  ` - ${d.serialNumber} ${
92
- d.jlink?.boardVersion || ''
92
+ d.devkit?.boardVersion || ''
93
93
  }: ${d.serialPorts?.map(s => s.comName).join(', ')}`
94
94
  ),
95
95
  '',
@@ -129,14 +129,14 @@ export const generateSystemReport = async (
129
129
  export default async (
130
130
  allDevices: Device[],
131
131
  currentSerialNumber: string,
132
- currentDevice: Device | null
132
+ currentDevice?: Device
133
133
  ) => {
134
134
  logger.info('Generating system report...');
135
135
  const timestamp = new Date().toISOString().replace(/:/g, '-');
136
136
  const report = await generateSystemReport(
137
137
  timestamp,
138
138
  allDevices,
139
- currentDevice ?? undefined,
139
+ currentDevice,
140
140
  currentSerialNumber
141
141
  );
142
142
 
@@ -2,6 +2,7 @@
2
2
  declare const _default: {
3
3
  program: jest.Mock<any, any, any>;
4
4
  programBuffer: jest.Mock<any, any, any>;
5
+ deviceInfo: jest.Mock<Promise<{}>, [], any>;
5
6
  erase: jest.Mock<any, any, any>;
6
7
  recover: jest.Mock<any, any, any>;
7
8
  reset: jest.Mock<any, any, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../../nrfutil/device/__mocks__/device.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA,wBAiBE"}
1
+ {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../../nrfutil/device/__mocks__/device.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,wBAkBE"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { TaskEnd } from '../sandboxTypes';
3
3
  import { Callbacks } from './batchTypes';
4
- import { DeviceCore, DeviceTraits, NrfutilDeviceWithSerialnumber, ResetKind } from './common';
4
+ import { DeviceCore, DeviceTraits, NrfutilDevice, ResetKind } from './common';
5
5
  import { DeviceCoreInfo } from './getCoreInfo';
6
6
  import { FWInfo } from './getFwInfo';
7
7
  import { GetProtectionStatusResult } from './getProtectionStatus';
@@ -10,6 +10,7 @@ export declare class Batch {
10
10
  private operationBatchGeneration;
11
11
  private collectOperations;
12
12
  private enqueueBatchOperationObject;
13
+ getDeviceInfo(core: DeviceCore, callbacks?: Callbacks<FWInfo>): this;
13
14
  erase(core: DeviceCore, callbacks?: Callbacks): this;
14
15
  firmwareRead(core: DeviceCore, callbacks?: Callbacks<Buffer>): this;
15
16
  getCoreInfo(core: DeviceCore, callbacks?: Callbacks<DeviceCoreInfo>): this;
@@ -19,6 +20,6 @@ export declare class Batch {
19
20
  recover(core: DeviceCore, callbacks?: Callbacks): this;
20
21
  reset(core: DeviceCore, reset?: ResetKind, callbacks?: Callbacks): this;
21
22
  collect(count: number, callback: (completedTasks: TaskEnd<unknown>[]) => void): this;
22
- run(device: NrfutilDeviceWithSerialnumber, controller?: AbortController | undefined): Promise<unknown[]>;
23
+ run(device: NrfutilDevice, controller?: AbortController | undefined): Promise<unknown[]>;
23
24
  }
24
25
  //# sourceMappingURL=batch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../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E,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC;IAUzD,mBAAmB,CACtB,IAAI,EAAE,UAAU,EAChB,SAAS,CAAC,EAAE,SAAS,CAAC,yBAAyB,CAAC;IAW7C,OAAO,CACV,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,UAAU,EAChB,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,YAAY,CAAC,EAAE,YAAY,EAC3B,SAAS,CAAC,EAAE,SAAS;IA8ClB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS;IAU/C,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,SAAS;IAWhE,OAAO,CACV,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI;IAW7C,GAAG,CACZ,MAAM,EAAE,aAAa,EACrB,UAAU,CAAC,EAAE,eAAe,GAAG,SAAS,GACzC,OAAO,CAAC,OAAO,EAAE,CAAC;CAqGxB"}
@@ -8,42 +8,22 @@ export interface DeviceArrivedEvent {
8
8
  export interface DeviceLeftEvent {
9
9
  id: number;
10
10
  }
11
- export interface HwInfo {
12
- romSize: number;
13
- ramSize: number;
14
- romPageSize: number;
15
- deviceFamily: string;
16
- deviceVersion: string;
17
- }
18
- export interface DfuTriggerInfo {
19
- wAddress: number;
20
- wVersionMajor: number;
21
- wVersionMinor: number;
22
- wFirmwareId: number;
23
- wFlashSize: number;
24
- wFlashPageSize: number;
25
- }
26
- export interface DfuTriggerVersion {
27
- semVer: string;
11
+ export interface NordicDevKit {
12
+ boardVersion?: string;
13
+ deviceFamily?: string;
28
14
  }
29
15
  export interface NrfutilDevice {
30
16
  id: number;
17
+ devkit?: NordicDevKit;
31
18
  serialNumber?: string;
32
19
  traits: DeviceTraits;
33
20
  usb?: USB;
34
- jlink?: JLink;
35
21
  serialPorts?: Array<SerialPort>;
36
- hwInfo?: HwInfo;
37
- dfuTriggerInfo?: DfuTriggerInfo;
38
- dfuTriggerVersion?: DfuTriggerVersion;
39
22
  broken?: null | {
40
23
  description: string;
41
24
  url: string;
42
25
  };
43
26
  }
44
- export interface NrfutilDeviceWithSerialnumber extends NrfutilDevice {
45
- serialNumber: string;
46
- }
47
27
  export type DeviceFamily = 'NRF51_FAMILY' | 'NRF52_FAMILY' | 'NRF53_FAMILY' | 'NRF91_FAMILY';
48
28
  export type ProtectionStatus = 'NRFDL_PROTECTION_STATUS_NONE' | 'NRFDL_PROTECTION_STATUS_REGION0' | 'NRFDL_PROTECTION_STATUS_REGION0_REGION1' | 'NRFDL_PROTECTION_STATUS_SECURE_REGIONS' | 'NRFDL_PROTECTION_STATUS_ALL';
49
29
  export type VersionType = 'NRFDL_VERSION_TYPE_SEMANTIC' | 'NRFDL_VERSION_TYPE_INCREMENTAL' | 'NRFDL_VERSION_TYPE_STRING';
@@ -103,13 +83,6 @@ export interface USBDevice {
103
83
  descriptor: USBDeviceDescriptor;
104
84
  configList: USBConfiguration;
105
85
  }
106
- export interface JLink {
107
- serialNumber: string;
108
- boardVersion: string | null;
109
- jlinkObFirmwareVersion: string | null;
110
- deviceFamily: string | null;
111
- deviceVersion: string | null;
112
- }
113
86
  export interface SerialPort {
114
87
  serialNumber: string | null;
115
88
  comName: string | null;
@@ -120,6 +93,6 @@ export interface SerialPort {
120
93
  path: string | null;
121
94
  }
122
95
  export declare const getDeviceSandbox: () => Promise<NrfutilSandbox>;
123
- export declare const deviceSingleTaskEndOperation: <T = void>(device: NrfutilDeviceWithSerialnumber, command: string, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController, args?: string[]) => Promise<NonNullable<Awaited<T>>>;
124
- export declare const deviceSingleTaskEndOperationVoid: (device: NrfutilDeviceWithSerialnumber, command: string, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController, args?: string[]) => Promise<void>;
96
+ export declare const deviceSingleTaskEndOperation: <T = void>(device: NrfutilDevice, command: string, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController, args?: string[]) => Promise<NonNullable<Awaited<T>>>;
97
+ export declare const deviceSingleTaskEndOperationVoid: (device: NrfutilDevice, command: string, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController, args?: string[]) => Promise<void>;
125
98
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/common.ts"],"names":[],"mappings":"AAYA,OAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,eAAO,MAAM,kBAAkB,WAAY,YAAY,aAatD,CAAC;AAEF,MAAM,MAAM,SAAS,GACf,cAAc,GACd,YAAY,GACZ,aAAa,GACb,WAAW,CAAC;AAElB,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,M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O,MAAM,gBAAgB,+BAqD5B,CAAC;AAEF,eAAO,MAAM,4BAA4B,qBAC7B,aAAa,WACZ,MAAM,2BACS,QAAQ,KAAK,IAAI,4BAC5B,eAAe,SACtB,MAAM,EAAE,qCAcjB,CAAC;AAEF,eAAO,MAAM,gCAAgC,WACjC,aAAa,WACZ,MAAM,2BACS,QAAQ,KAAK,IAAI,4BAC5B,eAAe,SACtB,MAAM,EAAE,kBAejB,CAAC"}
@@ -2,24 +2,25 @@
2
2
  import { LogLevel, LogMessage } from '../sandboxTypes';
3
3
  import { Batch } from './batch';
4
4
  declare const _default: {
5
- program: (device: import("./common").NrfutilDeviceWithSerialnumber, firmware: import("./program").FirmwareType, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, core?: import("./common").DeviceCore | undefined, programmingOptions?: import("./program").ProgrammingOptions | undefined, controller?: AbortController | undefined) => Promise<void>;
6
- erase: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
7
- recover: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
8
- reset: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, resetKind?: import("./common").ResetKind | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
9
- getProtectionStatus: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getProtectionStatus").GetProtectionStatusResult>;
10
- setProtectionStatus: (device: import("./common").NrfutilDeviceWithSerialnumber, region: "All" | "SecureRegions" | "Region0" | "Region0Region1", core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
11
- getFwInfo: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getFwInfo").FWInfo>;
12
- setMcuState: (device: import("./common").NrfutilDeviceWithSerialnumber, state: import("./setMcuState").McuState, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
13
- getCoreInfo: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getCoreInfo").DeviceCoreInfo>;
14
- list: (traits: import("./common").DeviceTraits, onEnumerated: (devices: import("./common").NrfutilDeviceWithSerialnumber[]) => void, onError: (error: Error) => void, onHotplugEvent?: {
15
- onDeviceArrived: (device: import("./common").NrfutilDeviceWithSerialnumber) => void;
5
+ program: (device: import("./common").NrfutilDevice, firmware: import("./program").FirmwareType, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, core?: import("./common").DeviceCore | undefined, programmingOptions?: import("./program").ProgrammingOptions | undefined, controller?: AbortController | undefined) => Promise<void>;
6
+ deviceInfo: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./deviceInfo").DeviceInfo | undefined>;
7
+ erase: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
8
+ recover: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
9
+ reset: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, resetKind?: import("./common").ResetKind | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
10
+ getProtectionStatus: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getProtectionStatus").GetProtectionStatusResult>;
11
+ setProtectionStatus: (device: import("./common").NrfutilDevice, region: "All" | "SecureRegions" | "Region0" | "Region0Region1", core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
12
+ getFwInfo: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getFwInfo").FWInfo>;
13
+ setMcuState: (device: import("./common").NrfutilDevice, state: import("./setMcuState").McuState, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
14
+ getCoreInfo: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getCoreInfo").DeviceCoreInfo>;
15
+ list: (traits: import("./common").DeviceTraits, onEnumerated: (devices: import("./common").NrfutilDevice[]) => void, onError: (error: Error) => void, onHotplugEvent?: {
16
+ onDeviceArrived: (device: import("./common").NrfutilDevice) => void;
16
17
  onDeviceLeft: (id: number) => void;
17
18
  } | undefined, timeout?: number | undefined) => Promise<{
18
19
  stop: (handler?: (() => void) | undefined) => void;
19
20
  isRunning: () => boolean;
20
21
  onClosed: (handler: (error?: Error | undefined) => void) => () => ((error?: Error | undefined) => void)[];
21
22
  }>;
22
- firmwareRead: (device: import("./common").NrfutilDeviceWithSerialnumber, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<Buffer>;
23
+ firmwareRead: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("../sandboxTypes").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<Buffer>;
23
24
  onLogging: (handler: (logging: LogMessage) => void) => Promise<() => ((logging: LogMessage) => void)[]>;
24
25
  setLogLevel: (level: LogLevel) => Promise<void>;
25
26
  setVerboseLogging: (verbose: boolean) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/device.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AAoChC,wBAiBE"}
1
+ {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/device.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqChC,wBAkBE"}
@@ -0,0 +1,40 @@
1
+ import { Progress } from '../sandboxTypes';
2
+ import { DeviceCore, NrfutilDevice } from './common';
3
+ export interface HwInfo {
4
+ romSize: number;
5
+ ramSize: number;
6
+ romPageSize: number;
7
+ deviceFamily: string;
8
+ deviceVersion: string;
9
+ }
10
+ export interface JLinkDeviceInfo {
11
+ serialNumber: string;
12
+ boardVersion?: string;
13
+ jlinkObFirmwareVersion: string;
14
+ deviceFamily: string | null;
15
+ deviceVersion?: string | null;
16
+ }
17
+ export interface DfuTriggerInfo {
18
+ wAddress: number;
19
+ wVersionMajor: number;
20
+ wVersionMinor: number;
21
+ wFirmwareId: number;
22
+ wFlashSize: number;
23
+ wFlashPageSize: number;
24
+ }
25
+ export interface DfuTriggerVersion {
26
+ semVer: string;
27
+ }
28
+ export interface DeviceInfo {
29
+ hwInfo?: HwInfo;
30
+ jlink?: JLinkDeviceInfo;
31
+ dfuTriggerVersion?: DfuTriggerVersion;
32
+ dfuTriggerInfo?: DfuTriggerInfo;
33
+ }
34
+ export interface DeviceInfoRaw {
35
+ name: 'device-info';
36
+ deviceInfo: DeviceInfo;
37
+ }
38
+ declare const _default: (device: NrfutilDevice, core?: DeviceCore, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController) => Promise<DeviceInfo | undefined>;
39
+ export default _default;
40
+ //# sourceMappingURL=deviceInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceInfo.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/deviceInfo.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,UAAU,EAEV,aAAa,EAChB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CAC1B;AACD,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;CAC1B;iCAGW,aAAa,SACd,UAAU,2BACO,QAAQ,KAAK,IAAI,4BAC5B,eAAe;AAJhC,wBAgBoB"}
@@ -1,5 +1,5 @@
1
1
  import { Progress } from '../sandboxTypes';
2
- import { DeviceCore, NrfutilDeviceWithSerialnumber } from './common';
3
- declare const _default: (device: NrfutilDeviceWithSerialnumber, core?: DeviceCore, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController) => Promise<void>;
2
+ import { DeviceCore, NrfutilDevice } from './common';
3
+ declare const _default: (device: NrfutilDevice, core?: DeviceCore, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController) => Promise<void>;
4
4
  export default _default;
5
5
  //# sourceMappingURL=erase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/erase.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,UAAU,EAEV,6BAA6B,EAChC,MAAM,UAAU,CAAC;iCAGN,6BAA6B,SAC9B,UAAU,2BACO,QAAQ,KAAK,IAAI,4BAC5B,eAAe;AAJhC,wBAYM"}
1
+ {"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/erase.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,UAAU,EAEV,aAAa,EAChB,MAAM,UAAU,CAAC;iCAGN,aAAa,SACd,UAAU,2BACO,QAAQ,KAAK,IAAI,4BAC5B,eAAe;AAJhC,wBAYM"}
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { Progress } from '../sandboxTypes';
3
- import { DeviceCore, NrfutilDeviceWithSerialnumber } from './common';
3
+ import { DeviceCore, NrfutilDevice } from './common';
4
4
  export interface DeviceBuffer {
5
5
  serialNumber: string;
6
6
  buffer: string;
7
7
  }
8
- declare const _default: (device: NrfutilDeviceWithSerialnumber, core?: DeviceCore, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController) => Promise<Buffer>;
8
+ declare const _default: (device: NrfutilDevice, core?: DeviceCore, onProgress?: ((progress: Progress) => void) | undefined, controller?: AbortController) => Promise<Buffer>;
9
9
  export default _default;
10
10
  //# sourceMappingURL=firmwareRead.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"firmwareRead.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/firmwareRead.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,UAAU,EAEV,6BAA6B,EAChC,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB;iCAGW,6BAA6B,SAC9B,UAAU,2BACO,QAAQ,KAAK,IAAI,4BAC5B,eAAe;AAJhC,wBAeE"}
1
+ {"version":3,"file":"firmwareRead.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/firmwareRead.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,UAAU,EAEV,aAAa,EAChB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB;iCAGW,aAAa,SACd,UAAU,2BACO,QAAQ,KAAK,IAAI,4BAC5B,eAAe;AAJhC,wBAeE"}