@nordicsemiconductor/pc-nrfconnect-shared 187.0.0 → 189.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.
- package/Changelog.md +25 -0
- package/nrfutil/device/deviceInfo.ts +15 -1
- package/nrfutil/device/logLibVersions.ts +1 -1
- package/nrfutil/device/program.ts +2 -0
- package/nrfutil/device/setMcuState.ts +3 -2
- package/nrfutil/moduleVersion.ts +1 -1
- package/nrfutil/modules.ts +3 -3
- package/nrfutil/sandbox.ts +6 -4
- package/package.json +6 -6
- package/scripts/nordic-publish.js +25 -25
- package/src/About/SupportCard.tsx +2 -2
- package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +2 -2
- package/src/Device/DeviceSelector/DeviceSelector.test.tsx +3 -3
- package/src/Device/DeviceSelector/DeviceSelector.tsx +1 -1
- package/src/Device/deviceLister.ts +2 -2
- package/src/Device/deviceSetup.ts +6 -6
- package/src/Device/jprogOperations.ts +3 -3
- package/src/Device/sdfuOperations.ts +13 -11
- package/src/Dropdown/DropdownHelpers.test.ts +76 -0
- package/src/Dropdown/DropdownHelpers.ts +44 -0
- package/src/Log/logSlice.ts +1 -1
- package/src/Parsers/shellParser.ts +1 -1
- package/src/SerialPort/ConflictingSettingsDialog.tsx +2 -2
- package/src/index.ts +6 -0
- package/src/logging/index.ts +2 -2
- package/src/utils/persistentStore.ts +2 -2
- package/src/utils/systemReport.ts +1 -1
- package/typings/generated/ipc/schema/packageJson.d.ts +41 -20
- package/typings/generated/ipc/schema/packageJson.d.ts.map +1 -1
- package/typings/generated/ipc/schema/parseJson.d.ts +1 -0
- package/typings/generated/ipc/schema/parseJson.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/device.d.ts +1 -1
- package/typings/generated/nrfutil/device/deviceInfo.d.ts +11 -0
- package/typings/generated/nrfutil/device/deviceInfo.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/program.d.ts +1 -0
- package/typings/generated/nrfutil/device/program.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/setMcuState.d.ts +1 -1
- package/typings/generated/nrfutil/device/setMcuState.d.ts.map +1 -1
- package/typings/generated/nrfutil/sandbox.d.ts.map +1 -1
- package/typings/generated/src/Device/sdfuOperations.d.ts.map +1 -1
- package/typings/generated/src/Dropdown/DropdownHelpers.d.ts +6 -0
- package/typings/generated/src/Dropdown/DropdownHelpers.d.ts.map +1 -0
- package/typings/generated/src/Dropdown/DropdownHelpers.test.d.ts +2 -0
- package/typings/generated/src/Dropdown/DropdownHelpers.test.d.ts.map +1 -0
- package/typings/generated/src/Parsers/shellParser.d.ts +1 -1
- package/typings/generated/src/Parsers/shellParser.d.ts.map +1 -1
- package/typings/generated/src/index.d.ts +1 -0
- package/typings/generated/src/index.d.ts.map +1 -1
|
@@ -77,7 +77,7 @@ export default ({ feedbackCategories }: { feedbackCategories?: string[] }) => {
|
|
|
77
77
|
<div className="tw-w-full">
|
|
78
78
|
<Toggle
|
|
79
79
|
id="enableVerboseLoggin"
|
|
80
|
-
label="
|
|
80
|
+
label="Verbose Logging"
|
|
81
81
|
onToggle={isToggled =>
|
|
82
82
|
dispatch(setIsLoggingVerbose(isToggled))
|
|
83
83
|
}
|
|
@@ -92,7 +92,7 @@ export default ({ feedbackCategories }: { feedbackCategories?: string[] }) => {
|
|
|
92
92
|
doNotResetVerboseLogginOnRestart();
|
|
93
93
|
getCurrentWindow().emit('restart-window');
|
|
94
94
|
}}
|
|
95
|
-
title="Restart application with verbose logging
|
|
95
|
+
title="Restart application with verbose logging toggled on to get log messages from the initial enumeration."
|
|
96
96
|
disabled={!verboseLogging}
|
|
97
97
|
>
|
|
98
98
|
Restart with verbose logging
|
|
@@ -84,10 +84,10 @@ const DeviceList: FC<Props> = ({
|
|
|
84
84
|
<div className="global-auto-reconnect">
|
|
85
85
|
<Toggle
|
|
86
86
|
id="toggle-global-auto-reconnect"
|
|
87
|
-
label="Auto
|
|
87
|
+
label="Auto-reconnect"
|
|
88
88
|
title={
|
|
89
89
|
!canUseAutoReconnect
|
|
90
|
-
? 'Cannot auto
|
|
90
|
+
? 'Cannot auto-reconnect to a device with no serial number.'
|
|
91
91
|
: ''
|
|
92
92
|
}
|
|
93
93
|
disabled={!canUseAutoReconnect}
|
|
@@ -313,7 +313,7 @@ describe('DeviceSelector', () => {
|
|
|
313
313
|
fireEvent.click(screen.getByText(DEVICE_SERIAL_NUMBER));
|
|
314
314
|
|
|
315
315
|
await screen.findByText(
|
|
316
|
-
'Device must be programmed
|
|
316
|
+
'Device must be programmed. Do you want to proceed?'
|
|
317
317
|
);
|
|
318
318
|
});
|
|
319
319
|
|
|
@@ -335,14 +335,14 @@ describe('DeviceSelector', () => {
|
|
|
335
335
|
fireEvent.click(screen.getByText(DEVICE_SERIAL_NUMBER));
|
|
336
336
|
|
|
337
337
|
await screen.findByText(
|
|
338
|
-
'Device must be programmed
|
|
338
|
+
'Device must be programmed. Do you want to proceed?'
|
|
339
339
|
);
|
|
340
340
|
|
|
341
341
|
fireEvent.click(screen.getByText('No'));
|
|
342
342
|
|
|
343
343
|
expect(
|
|
344
344
|
screen.queryByText(
|
|
345
|
-
'Device must be programmed
|
|
345
|
+
'Device must be programmed. Do you want to proceed?'
|
|
346
346
|
)
|
|
347
347
|
).toBeNull();
|
|
348
348
|
|
|
@@ -266,7 +266,7 @@ export const startWatchingDevices =
|
|
|
266
266
|
);
|
|
267
267
|
|
|
268
268
|
logger.info(
|
|
269
|
-
`Auto
|
|
269
|
+
`Auto-reconnecting to device with the serial number: ${deviceWithPersistedData.serialNumber}`
|
|
270
270
|
);
|
|
271
271
|
doSelectDevice(deviceWithPersistedData, true);
|
|
272
272
|
dispatch(setSelectedDeviceInfo(deviceInfo));
|
|
@@ -325,7 +325,7 @@ export const startWatchingDevices =
|
|
|
325
325
|
);
|
|
326
326
|
dispatch(setDisconnectedTime(undefined));
|
|
327
327
|
|
|
328
|
-
logger.info('Wait For Device was
|
|
328
|
+
logger.info('Wait For Device was successful');
|
|
329
329
|
|
|
330
330
|
dispatch(
|
|
331
331
|
clearWaitForDeviceTimeout(
|
|
@@ -100,7 +100,7 @@ export const prepareDevice =
|
|
|
100
100
|
|
|
101
101
|
if (possibleFirmware.length === 0) {
|
|
102
102
|
logger.info(
|
|
103
|
-
`Connected to device with serial number
|
|
103
|
+
`Connected to device with the serial number ${device.serialNumber} ` +
|
|
104
104
|
`and family: ${device.devkit?.deviceFamily || 'Unknown'} `
|
|
105
105
|
);
|
|
106
106
|
if (deviceSetupConfig.allowCustomDevice) {
|
|
@@ -169,8 +169,8 @@ export const prepareDevice =
|
|
|
169
169
|
dispatch(
|
|
170
170
|
preventAppCloseUntilComplete(
|
|
171
171
|
{
|
|
172
|
-
message: `The device is being programmed.
|
|
173
|
-
Closing application right now might result in
|
|
172
|
+
message: `The device is being programmed.
|
|
173
|
+
Closing application right now might result in unknown behavior and might also brick the device.
|
|
174
174
|
Are you sure you want to continue?`,
|
|
175
175
|
},
|
|
176
176
|
task
|
|
@@ -217,7 +217,7 @@ export const prepareDevice =
|
|
|
217
217
|
},
|
|
218
218
|
message:
|
|
219
219
|
deviceSetupConfig.confirmMessage ??
|
|
220
|
-
'Device must be programmed
|
|
220
|
+
'Device must be programmed. Do you want to proceed?',
|
|
221
221
|
})
|
|
222
222
|
);
|
|
223
223
|
} else {
|
|
@@ -225,7 +225,7 @@ export const prepareDevice =
|
|
|
225
225
|
openDeviceSetupDialog({
|
|
226
226
|
message:
|
|
227
227
|
deviceSetupConfig.confirmMessage ??
|
|
228
|
-
'Device must be programmed
|
|
228
|
+
'Device must be programmed. Do you want to proceed?',
|
|
229
229
|
})
|
|
230
230
|
);
|
|
231
231
|
proceedAction(0);
|
|
@@ -279,7 +279,7 @@ export const setupDevice =
|
|
|
279
279
|
error => {
|
|
280
280
|
dispatch(closeDeviceSetupDialog());
|
|
281
281
|
logger.error(
|
|
282
|
-
`Error while setting up device ${device.serialNumber}`
|
|
282
|
+
`Error while setting up device with the serial number ${device.serialNumber}`
|
|
283
283
|
);
|
|
284
284
|
logger.error(describeError(error));
|
|
285
285
|
doDeselectDevice(getState().device.selectedDevice);
|
|
@@ -30,7 +30,7 @@ const programDeviceWithFw =
|
|
|
30
30
|
) {
|
|
31
31
|
batch.recover('Application', {
|
|
32
32
|
onTaskBegin: () =>
|
|
33
|
-
logger.info(`Device protected
|
|
33
|
+
logger.info(`Device protected - recovering device`),
|
|
34
34
|
onTaskEnd: () => logger.info(`Finished recovering device.`),
|
|
35
35
|
onException: () =>
|
|
36
36
|
logger.error(`Failed to recover device.`),
|
|
@@ -56,8 +56,8 @@ const programDeviceWithFw =
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
batch.reset('Application', undefined, {
|
|
59
|
-
onTaskBegin: () => logger.info(`
|
|
60
|
-
onTaskEnd: () => logger.info(`Finished
|
|
59
|
+
onTaskBegin: () => logger.info(`Resetting device`),
|
|
60
|
+
onTaskEnd: () => logger.info(`Finished resetting device.`),
|
|
61
61
|
onException: () => logger.error(`Failed to reset device.`),
|
|
62
62
|
onProgress: progress => {
|
|
63
63
|
onProgress(
|
|
@@ -61,10 +61,10 @@ export const isDeviceInDFUBootloader = (device: Device) => {
|
|
|
61
61
|
|
|
62
62
|
export const ensureBootloaderMode = (device: Device) => {
|
|
63
63
|
if (isDeviceInDFUBootloader(device)) {
|
|
64
|
-
logger.debug('Device is in bootloader mode');
|
|
64
|
+
logger.debug('Device is in the bootloader mode');
|
|
65
65
|
return true;
|
|
66
66
|
}
|
|
67
|
-
logger.debug('Device is NOT in bootloader mode');
|
|
67
|
+
logger.debug('Device is NOT in the bootloader mode');
|
|
68
68
|
return false;
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -92,13 +92,13 @@ const updateBootloader =
|
|
|
92
92
|
onProgress: (progress: number, message?: string) => void
|
|
93
93
|
): AppThunk =>
|
|
94
94
|
async dispatch => {
|
|
95
|
-
logger.info(`Update
|
|
95
|
+
logger.info(`Update bootloader ${device}`);
|
|
96
96
|
const zip = new AdmZip(getAppFile(LATEST_BOOTLOADER));
|
|
97
97
|
const zipBuffer = zip.toBuffer();
|
|
98
98
|
|
|
99
|
-
logger.debug('Starting
|
|
99
|
+
logger.debug('Starting bootloader update');
|
|
100
100
|
|
|
101
|
-
onProgress(0, 'Updating
|
|
101
|
+
onProgress(0, 'Updating bootloader');
|
|
102
102
|
|
|
103
103
|
dispatch(
|
|
104
104
|
setWaitForDevice({
|
|
@@ -192,7 +192,9 @@ export const switchToBootloaderMode =
|
|
|
192
192
|
d => {
|
|
193
193
|
if (!isDeviceInDFUBootloader(d))
|
|
194
194
|
onFail(
|
|
195
|
-
new Error(
|
|
195
|
+
new Error(
|
|
196
|
+
'Failed to switch to the bootloader mode'
|
|
197
|
+
)
|
|
196
198
|
);
|
|
197
199
|
else onSuccess(d);
|
|
198
200
|
},
|
|
@@ -221,7 +223,7 @@ export const switchToApplicationMode =
|
|
|
221
223
|
if (isDeviceInDFUBootloader(d))
|
|
222
224
|
onFail(
|
|
223
225
|
new Error(
|
|
224
|
-
'Failed to switch to
|
|
226
|
+
'Failed to switch to the application mode'
|
|
225
227
|
)
|
|
226
228
|
);
|
|
227
229
|
else onSuccess(d);
|
|
@@ -296,7 +298,7 @@ const askAndUpdateBootloader =
|
|
|
296
298
|
}
|
|
297
299
|
},
|
|
298
300
|
message:
|
|
299
|
-
'Device will be programmed. A
|
|
301
|
+
'Device will be programmed. A newer version of the bootloader is available. Do you want to update it as well?',
|
|
300
302
|
})
|
|
301
303
|
);
|
|
302
304
|
} else {
|
|
@@ -500,7 +502,7 @@ const programInDFUBootloader =
|
|
|
500
502
|
)
|
|
501
503
|
.then(() => {
|
|
502
504
|
logger.info(
|
|
503
|
-
'All
|
|
505
|
+
'All DFU images have been written to the target device.'
|
|
504
506
|
);
|
|
505
507
|
logger.debug('DFU completed successfully!');
|
|
506
508
|
dispatch(
|
|
@@ -512,7 +514,7 @@ const programInDFUBootloader =
|
|
|
512
514
|
onFail,
|
|
513
515
|
})
|
|
514
516
|
);
|
|
515
|
-
onProgress(100, 'Waiting for device to reboot');
|
|
517
|
+
onProgress(100, 'Waiting for device to reboot.');
|
|
516
518
|
})
|
|
517
519
|
.catch(err => {
|
|
518
520
|
if (err) {
|
|
@@ -581,7 +583,7 @@ export const sdfuDeviceSetup = (
|
|
|
581
583
|
isExpectedFirmware: (device, deviceInfo) => () => {
|
|
582
584
|
if (deviceInfo?.dfuTriggerVersion) {
|
|
583
585
|
logger.debug(
|
|
584
|
-
'Device has DFU trigger interface
|
|
586
|
+
'Device has DFU trigger interface; the device is in the application mode'
|
|
585
587
|
);
|
|
586
588
|
|
|
587
589
|
const { semVer } = deviceInfo.dfuTriggerVersion;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
convertToDropDownItems,
|
|
9
|
+
convertToNumberDropDownItems,
|
|
10
|
+
getSelectedDropdownItem,
|
|
11
|
+
} from './DropdownHelpers';
|
|
12
|
+
|
|
13
|
+
describe('getSelectedDropdownItem', () => {
|
|
14
|
+
it('returns the first item if value is undefined', () => {
|
|
15
|
+
const itemList = [{ label: 'foo', value: 'foo' }];
|
|
16
|
+
expect(getSelectedDropdownItem(itemList, undefined)).toBe(itemList[0]);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('returns the first item if value is not found', () => {
|
|
20
|
+
const itemList = [{ label: 'foo', value: 'foo' }];
|
|
21
|
+
expect(getSelectedDropdownItem(itemList, 'bar')).toBe(itemList[0]);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('returns the item with the correct value', () => {
|
|
25
|
+
const itemList = [
|
|
26
|
+
{ label: 'foo', value: 'foo' },
|
|
27
|
+
{ label: 'bar', value: 'bar' },
|
|
28
|
+
];
|
|
29
|
+
expect(getSelectedDropdownItem(itemList, 'bar')).toBe(itemList[1]);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('returns the item with the correct value when value is a boolean', () => {
|
|
33
|
+
const itemList = [
|
|
34
|
+
{ label: 'on', value: 'on' },
|
|
35
|
+
{ label: 'off', value: 'off' },
|
|
36
|
+
];
|
|
37
|
+
expect(getSelectedDropdownItem(itemList, true)).toBe(itemList[0]);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('returns the notFound item if value is not found', () => {
|
|
41
|
+
const itemList = [{ label: 'foo', value: 'foo' }];
|
|
42
|
+
const notFound = { label: 'not found', value: 'not found' };
|
|
43
|
+
expect(getSelectedDropdownItem(itemList, 'bar', notFound)).toBe(
|
|
44
|
+
notFound
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('convertToDropDownItems', () => {
|
|
50
|
+
it('converts an array of strings to dropdown items', () => {
|
|
51
|
+
const data = ['foo', 'bar'];
|
|
52
|
+
expect(convertToDropDownItems(data)).toEqual([
|
|
53
|
+
{ label: 'Default', value: 'undefined' },
|
|
54
|
+
{ label: 'foo', value: 'foo' },
|
|
55
|
+
{ label: 'bar', value: 'bar' },
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('converts an array of strings to dropdown items without default', () => {
|
|
60
|
+
const data = ['foo', 'bar'];
|
|
61
|
+
expect(convertToDropDownItems(data, false)).toEqual([
|
|
62
|
+
{ label: 'foo', value: 'foo' },
|
|
63
|
+
{ label: 'bar', value: 'bar' },
|
|
64
|
+
]);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe('convertToNumberDropDownItems', () => {
|
|
69
|
+
it('converts an array of numbers to dropdown items', () => {
|
|
70
|
+
const data = [1, 2];
|
|
71
|
+
expect(convertToNumberDropDownItems(data)).toEqual([
|
|
72
|
+
{ label: '1', value: 1 },
|
|
73
|
+
{ label: '2', value: 2 },
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { NumberDropdownItem } from '../InlineInput/NumberInputWithDropdown';
|
|
8
|
+
import { DropdownItem } from './Dropdown';
|
|
9
|
+
|
|
10
|
+
export const getSelectedDropdownItem = (
|
|
11
|
+
itemList: DropdownItem[],
|
|
12
|
+
value: unknown,
|
|
13
|
+
notFound?: DropdownItem
|
|
14
|
+
) => {
|
|
15
|
+
if (typeof value === 'boolean') value = value ? 'on' : 'off';
|
|
16
|
+
|
|
17
|
+
if (value === undefined) return notFound ?? itemList[0];
|
|
18
|
+
|
|
19
|
+
const result = itemList[itemList.findIndex(e => e.value === `${value}`)];
|
|
20
|
+
|
|
21
|
+
return result === undefined ? notFound ?? itemList[0] : result;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const convertToDropDownItems: <T>(
|
|
25
|
+
data: T[],
|
|
26
|
+
addAuto?: boolean
|
|
27
|
+
) => DropdownItem[] = (data, addAuto = true) => {
|
|
28
|
+
const mappedData = data.map(v => ({
|
|
29
|
+
label: `${v}`,
|
|
30
|
+
value: `${v}`,
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
return addAuto
|
|
34
|
+
? [{ label: 'Default', value: 'undefined' }, ...mappedData]
|
|
35
|
+
: mappedData;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const convertToNumberDropDownItems: (
|
|
39
|
+
data: number[]
|
|
40
|
+
) => NumberDropdownItem[] = data =>
|
|
41
|
+
data.map(v => ({
|
|
42
|
+
label: `${v}`,
|
|
43
|
+
value: v,
|
|
44
|
+
}));
|
package/src/Log/logSlice.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { Terminal } from '@xterm/headless';
|
|
7
8
|
import EventEmitter from 'events';
|
|
8
|
-
import { Terminal } from 'xterm-headless';
|
|
9
9
|
|
|
10
10
|
import logger from '../logging';
|
|
11
11
|
import { SerialPort } from '../SerialPort/SerialPort';
|
|
@@ -71,7 +71,7 @@ const ConflictingSettingsDialog = ({
|
|
|
71
71
|
onCancel();
|
|
72
72
|
} else {
|
|
73
73
|
console.error(
|
|
74
|
-
'Port could not be opened. Verify it is not used by
|
|
74
|
+
'Port could not be opened. Verify it is not used by other applications.'
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -180,7 +180,7 @@ const DisplayConflictingSettings = ({
|
|
|
180
180
|
))}
|
|
181
181
|
</ul>
|
|
182
182
|
) : (
|
|
183
|
-
<p>Could not retrieve the current settings
|
|
183
|
+
<p>Could not retrieve the current settings.</p>
|
|
184
184
|
)}
|
|
185
185
|
</div>
|
|
186
186
|
<div className="tw-pr-7">
|
package/src/index.ts
CHANGED
|
@@ -181,6 +181,12 @@ export {
|
|
|
181
181
|
newSuccessFlashMessage,
|
|
182
182
|
} from './FlashMessage/FlashMessageSlice';
|
|
183
183
|
|
|
184
|
+
export {
|
|
185
|
+
getSelectedDropdownItem,
|
|
186
|
+
convertToDropDownItems,
|
|
187
|
+
convertToNumberDropDownItems,
|
|
188
|
+
} from './Dropdown/DropdownHelpers';
|
|
189
|
+
|
|
184
190
|
export {
|
|
185
191
|
inMain as apps,
|
|
186
192
|
type App as AppType,
|
package/src/logging/index.ts
CHANGED
|
@@ -90,7 +90,7 @@ logger.openLogFile = () => {
|
|
|
90
90
|
try {
|
|
91
91
|
openFile(logFilePath());
|
|
92
92
|
} catch (error) {
|
|
93
|
-
logger.logError('Unable to open log file', error);
|
|
93
|
+
logger.logError('Unable to open the log file', error);
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
@@ -98,7 +98,7 @@ logger.openLogFileLocation = () => {
|
|
|
98
98
|
try {
|
|
99
99
|
openFileLocation(logFilePath());
|
|
100
100
|
} catch (error) {
|
|
101
|
-
logger.logError('Unable to open log file location', error);
|
|
101
|
+
logger.logError('Unable to open the log file location', error);
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
|
|
@@ -84,7 +84,7 @@ export const getPersistedSerialPortSettings = (
|
|
|
84
84
|
): SerialSettings | undefined => {
|
|
85
85
|
const appName = packageJson().name;
|
|
86
86
|
logger.info(
|
|
87
|
-
`Getting
|
|
87
|
+
`Getting serial port options from the persistent store for ${serialNumber}.${appName}`
|
|
88
88
|
);
|
|
89
89
|
return sharedStore.get(`${serialNumber}.${appName}`);
|
|
90
90
|
};
|
|
@@ -106,7 +106,7 @@ export const getPersistedTerminalSettings = (
|
|
|
106
106
|
): TerminalSettings | undefined => {
|
|
107
107
|
if (device.serialNumber) {
|
|
108
108
|
logger.info(
|
|
109
|
-
`Get terminal settings from persistent store ${device.serialNumber}.vCom-${vComIndex}.TerminalSettings`
|
|
109
|
+
`Get terminal settings from the persistent store for ${device.serialNumber}.vCom-${vComIndex}.TerminalSettings`
|
|
110
110
|
);
|
|
111
111
|
return sharedStore.get(
|
|
112
112
|
`${device.serialNumber}.vCom-${vComIndex}.TerminalSettings`
|
|
@@ -83,7 +83,7 @@ const generalInfoReport = async () => {
|
|
|
83
83
|
` - nrfjprog DLL: ${describeVersion(
|
|
84
84
|
resolveModuleVersion('jprog', dependencies)
|
|
85
85
|
)}`,
|
|
86
|
-
` -
|
|
86
|
+
` - SEGGER J-Link: ${describeVersion(
|
|
87
87
|
resolveModuleVersion('JlinkARM', dependencies)
|
|
88
88
|
)}`,
|
|
89
89
|
'',
|
|
@@ -20,10 +20,13 @@ export declare const parsePackageJson: (content: string) => z.SafeParseSuccess<{
|
|
|
20
20
|
}> | {
|
|
21
21
|
error: import("zod-validation-error").ValidationError;
|
|
22
22
|
success: false;
|
|
23
|
+
data?: undefined;
|
|
23
24
|
};
|
|
24
|
-
declare const packageJsonApp: z.ZodObject<{
|
|
25
|
+
declare const packageJsonApp: z.ZodObject<z.objectUtil.extendShape<{
|
|
25
26
|
name: z.ZodString;
|
|
26
27
|
version: z.ZodString;
|
|
28
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, {
|
|
27
30
|
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
28
31
|
description: z.ZodString;
|
|
29
32
|
homepage: z.ZodOptional<z.ZodString>;
|
|
@@ -61,7 +64,7 @@ declare const packageJsonApp: z.ZodObject<{
|
|
|
61
64
|
type: string;
|
|
62
65
|
url: string;
|
|
63
66
|
}>>;
|
|
64
|
-
}
|
|
67
|
+
}>, "strip", z.ZodTypeAny, {
|
|
65
68
|
name: string;
|
|
66
69
|
version: string;
|
|
67
70
|
displayName: string;
|
|
@@ -132,15 +135,18 @@ export declare const parsePackageJsonApp: (content: string) => z.SafeParseSucces
|
|
|
132
135
|
}> | {
|
|
133
136
|
error: import("zod-validation-error").ValidationError;
|
|
134
137
|
success: false;
|
|
138
|
+
data?: undefined;
|
|
135
139
|
};
|
|
136
|
-
declare const packageJsonLegacyApp: z.ZodObject<{
|
|
140
|
+
declare const packageJsonLegacyApp: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
137
141
|
name: z.ZodString;
|
|
138
142
|
version: z.ZodString;
|
|
139
|
-
displayName: z.ZodString
|
|
143
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, {
|
|
140
145
|
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
141
146
|
description: z.ZodString;
|
|
142
147
|
homepage: z.ZodOptional<z.ZodString>;
|
|
143
148
|
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
149
|
+
displayName: z.ZodString;
|
|
144
150
|
engines: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{
|
|
145
151
|
nrfconnect: z.ZodString;
|
|
146
152
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -148,6 +154,19 @@ declare const packageJsonLegacyApp: z.ZodObject<{
|
|
|
148
154
|
}, {
|
|
149
155
|
nrfconnect: string;
|
|
150
156
|
}>>;
|
|
157
|
+
nrfConnectForDesktop: z.ZodObject<{
|
|
158
|
+
supportedDevices: z.ZodOptional<z.ZodArray<z.ZodEnum<["PCA10028", "PCA10031", "PCA10040", "PCA10056", "PCA10059", "PCA10090", "PCA10095", "PCA10100", "PCA10121", "PCA20020", "PCA20035", "PCA10143", "PCA10152", "PCA10153", "PCA10165", "PCA20049", "PCA10171", "PCA10156", "PCA10175"]>, "atleastone">>;
|
|
159
|
+
nrfutil: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "atleastone">>>;
|
|
160
|
+
html: z.ZodString;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
html: string;
|
|
163
|
+
supportedDevices?: ["PCA10028" | "PCA10031" | "PCA10040" | "PCA10056" | "PCA10059" | "PCA10090" | "PCA10095" | "PCA10100" | "PCA10121" | "PCA20020" | "PCA20035" | "PCA10143" | "PCA10152" | "PCA10153" | "PCA10165" | "PCA20049" | "PCA10171" | "PCA10156" | "PCA10175", ...("PCA10028" | "PCA10031" | "PCA10040" | "PCA10056" | "PCA10059" | "PCA10090" | "PCA10095" | "PCA10100" | "PCA10121" | "PCA20020" | "PCA20035" | "PCA10143" | "PCA10152" | "PCA10153" | "PCA10165" | "PCA20049" | "PCA10171" | "PCA10156" | "PCA10175")[]] | undefined;
|
|
164
|
+
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
html: string;
|
|
167
|
+
supportedDevices?: ["PCA10028" | "PCA10031" | "PCA10040" | "PCA10056" | "PCA10059" | "PCA10090" | "PCA10095" | "PCA10100" | "PCA10121" | "PCA20020" | "PCA20035" | "PCA10143" | "PCA10152" | "PCA10153" | "PCA10165" | "PCA20049" | "PCA10171" | "PCA10156" | "PCA10175", ...("PCA10028" | "PCA10031" | "PCA10040" | "PCA10056" | "PCA10059" | "PCA10090" | "PCA10095" | "PCA10100" | "PCA10121" | "PCA20020" | "PCA20035" | "PCA10143" | "PCA10152" | "PCA10153" | "PCA10165" | "PCA20049" | "PCA10171" | "PCA10156" | "PCA10175")[]] | undefined;
|
|
168
|
+
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
169
|
+
}>;
|
|
151
170
|
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
152
171
|
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
153
172
|
repository: z.ZodOptional<z.ZodObject<{
|
|
@@ -160,6 +179,7 @@ declare const packageJsonLegacyApp: z.ZodObject<{
|
|
|
160
179
|
type: string;
|
|
161
180
|
url: string;
|
|
162
181
|
}>>;
|
|
182
|
+
}>, {
|
|
163
183
|
nrfConnectForDesktop: z.ZodOptional<z.ZodObject<{
|
|
164
184
|
supportedDevices: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
165
185
|
nrfutil: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "atleastone">>>;
|
|
@@ -173,7 +193,7 @@ declare const packageJsonLegacyApp: z.ZodObject<{
|
|
|
173
193
|
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
174
194
|
html?: string | undefined;
|
|
175
195
|
}>>;
|
|
176
|
-
}
|
|
196
|
+
}>, "strip", z.ZodTypeAny, {
|
|
177
197
|
name: string;
|
|
178
198
|
version: string;
|
|
179
199
|
displayName: string;
|
|
@@ -184,17 +204,17 @@ declare const packageJsonLegacyApp: z.ZodObject<{
|
|
|
184
204
|
dependencies?: Record<string, string | undefined> | undefined;
|
|
185
205
|
homepage?: string | undefined;
|
|
186
206
|
devDependencies?: Record<string, string | undefined> | undefined;
|
|
207
|
+
nrfConnectForDesktop?: {
|
|
208
|
+
supportedDevices?: [string, ...string[]] | undefined;
|
|
209
|
+
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
210
|
+
html?: string | undefined;
|
|
211
|
+
} | undefined;
|
|
187
212
|
files?: string[] | undefined;
|
|
188
213
|
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
189
214
|
repository?: {
|
|
190
215
|
type: string;
|
|
191
216
|
url: string;
|
|
192
217
|
} | undefined;
|
|
193
|
-
nrfConnectForDesktop?: {
|
|
194
|
-
supportedDevices?: [string, ...string[]] | undefined;
|
|
195
|
-
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
196
|
-
html?: string | undefined;
|
|
197
|
-
} | undefined;
|
|
198
218
|
}, {
|
|
199
219
|
name: string;
|
|
200
220
|
version: string;
|
|
@@ -206,17 +226,17 @@ declare const packageJsonLegacyApp: z.ZodObject<{
|
|
|
206
226
|
dependencies?: Record<string, string | undefined> | undefined;
|
|
207
227
|
homepage?: string | undefined;
|
|
208
228
|
devDependencies?: Record<string, string | undefined> | undefined;
|
|
229
|
+
nrfConnectForDesktop?: {
|
|
230
|
+
supportedDevices?: [string, ...string[]] | undefined;
|
|
231
|
+
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
232
|
+
html?: string | undefined;
|
|
233
|
+
} | undefined;
|
|
209
234
|
files?: string[] | undefined;
|
|
210
235
|
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
211
236
|
repository?: {
|
|
212
237
|
type: string;
|
|
213
238
|
url: string;
|
|
214
239
|
} | undefined;
|
|
215
|
-
nrfConnectForDesktop?: {
|
|
216
|
-
supportedDevices?: [string, ...string[]] | undefined;
|
|
217
|
-
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
218
|
-
html?: string | undefined;
|
|
219
|
-
} | undefined;
|
|
220
240
|
}>;
|
|
221
241
|
export type PackageJsonLegacyApp = z.infer<typeof packageJsonLegacyApp>;
|
|
222
242
|
export declare const parsePackageJsonLegacyApp: (content: string) => z.SafeParseSuccess<{
|
|
@@ -230,20 +250,21 @@ export declare const parsePackageJsonLegacyApp: (content: string) => z.SafeParse
|
|
|
230
250
|
dependencies?: Record<string, string | undefined> | undefined;
|
|
231
251
|
homepage?: string | undefined;
|
|
232
252
|
devDependencies?: Record<string, string | undefined> | undefined;
|
|
253
|
+
nrfConnectForDesktop?: {
|
|
254
|
+
supportedDevices?: [string, ...string[]] | undefined;
|
|
255
|
+
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
256
|
+
html?: string | undefined;
|
|
257
|
+
} | undefined;
|
|
233
258
|
files?: string[] | undefined;
|
|
234
259
|
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
235
260
|
repository?: {
|
|
236
261
|
type: string;
|
|
237
262
|
url: string;
|
|
238
263
|
} | undefined;
|
|
239
|
-
nrfConnectForDesktop?: {
|
|
240
|
-
supportedDevices?: [string, ...string[]] | undefined;
|
|
241
|
-
nrfutil?: Record<string, [string, ...string[]]> | undefined;
|
|
242
|
-
html?: string | undefined;
|
|
243
|
-
} | undefined;
|
|
244
264
|
}> | {
|
|
245
265
|
error: import("zod-validation-error").ValidationError;
|
|
246
266
|
success: false;
|
|
267
|
+
data?: undefined;
|
|
247
268
|
};
|
|
248
269
|
export {};
|
|
249
270
|
//# sourceMappingURL=packageJson.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/packageJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,WAAW;;;;;;;;;;;;EAKf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/packageJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,WAAW;;;;;;;;;;;;EAKf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB;;;;;;;;CACgC,CAAC;AAgB9D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBlB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CACmC,CAAC;AAIpE,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKxB,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;CACyC,CAAC"}
|
|
@@ -2,5 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const parseWithPrettifiedErrorMessage: <Out, T extends z.ZodType<Out, z.ZodTypeDef, Out> = z.ZodTypeAny>(schema: T) => (content: string) => z.SafeParseSuccess<Out> | {
|
|
3
3
|
error: import("zod-validation-error").ValidationError;
|
|
4
4
|
success: false;
|
|
5
|
+
data?: undefined;
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=parseJson.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/parseJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B,4FAE9B,MAAM
|
|
1
|
+
{"version":3,"file":"parseJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/parseJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B,4FAE9B,MAAM;;;;CAef,CAAC"}
|
|
@@ -10,7 +10,7 @@ declare const _default: {
|
|
|
10
10
|
getProtectionStatus: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("..").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getProtectionStatus").GetProtectionStatusResult>;
|
|
11
11
|
setProtectionStatus: (device: import("./common").NrfutilDevice, region: "All" | "SecureRegions" | "Region0" | "Region0Region1", core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("..").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
|
|
12
12
|
getFwInfo: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("..").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getFwInfo").FWInfo>;
|
|
13
|
-
setMcuState: (device: import("./common").NrfutilDevice, state: import("./setMcuState").McuState, onProgress?: ((progress: import("..").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<void>;
|
|
13
|
+
setMcuState: (device: import("./common").NrfutilDevice, state: import("./setMcuState").McuState, onProgress?: ((progress: import("..").Progress) => void) | undefined, controller?: AbortController | undefined, target?: string | undefined) => Promise<void>;
|
|
14
14
|
getCoreInfo: (device: import("./common").NrfutilDevice, core?: import("./common").DeviceCore | undefined, onProgress?: ((progress: import("..").Progress) => void) | undefined, controller?: AbortController | undefined) => Promise<import("./getCoreInfo").DeviceCoreInfo>;
|
|
15
15
|
list: (traits: import("./common").DeviceTraits, onEnumerated: (devices: import("./common").NrfutilDevice[]) => void, onError: (error: Error, pid?: number | undefined) => void, onHotplugEvent?: {
|
|
16
16
|
onDeviceArrived: (device: import("./common").NrfutilDevice) => void;
|