diff --git a/Changelog.md b/Changelog.md index c3f963f2..90446858 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,8 +1,9 @@ -## 2.2.0 - 2023-12-14 +## 2.2.0 - unreleased ## Added - Persist state of `show log` panel +- Master secret timeout configuration to tracing. ## 2.1.0 - 2023-12-07 diff --git a/package-lock.json b/package-lock.json index 918209a7..1bac577c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,12 +12,12 @@ ], "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@nordicsemiconductor/nrf-monitor-lib-js": "^0.8.4" + "@nordicsemiconductor/nrf-monitor-lib-js": "^0.8.5" }, "devDependencies": { "@mdi/js": "^7.2.96", "@mdi/react": "^1.6.1", - "@nordicsemiconductor/pc-nrfconnect-shared": "^143.0.0", + "@nordicsemiconductor/pc-nrfconnect-shared": "^145.0.0", "@types/redux-mock-store": "^1.0.2", "chart.js": "^4.1.2", "check-disk-space": "^2.1.0", @@ -2891,9 +2891,9 @@ } }, "node_modules/@nordicsemiconductor/nrf-monitor-lib-js": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/@nordicsemiconductor/nrf-monitor-lib-js/-/nrf-monitor-lib-js-0.8.4.tgz", - "integrity": "sha512-2Pglkh4jVtxw93osYNW1sZTDDZKJcx7kjWt9QqvvKsl/uAHbpXIAdYoRj+1WQNNoD1JK43YW/syCBEynA9+mFA==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@nordicsemiconductor/nrf-monitor-lib-js/-/nrf-monitor-lib-js-0.8.5.tgz", + "integrity": "sha512-tH1Nk9Yqdz+wrb80U0/M2/RAbcKLrJkiynx5C4fAbISLTp8hxZR7iAnqWzXkO8kmyOSYNMFQCmyvzps7MWX8Ww==", "hasInstallScript": true, "inBundle": true, "dependencies": { @@ -2901,9 +2901,9 @@ } }, "node_modules/@nordicsemiconductor/pc-nrfconnect-shared": { - "version": "143.0.0", - "resolved": "https://registry.npmjs.org/@nordicsemiconductor/pc-nrfconnect-shared/-/pc-nrfconnect-shared-143.0.0.tgz", - "integrity": "sha512-r/cAKvq6ErLSbd5OBfPqgVjVvzqjYhBI8F0IN/E84b1fVFLJBsGnhs9OdsLA1NJtIGpmJKCoX153NfwccJ0TPA==", + "version": "145.0.0", + "resolved": "https://registry.npmjs.org/@nordicsemiconductor/pc-nrfconnect-shared/-/pc-nrfconnect-shared-145.0.0.tgz", + "integrity": "sha512-Wfq/qh2Hbn1ZIDK1v5OAeXYX9hzBm6kIIPR0A6XFV4TWtFsTRlrPoZTMB8v306ibCUTGm/ItVSBc6icceVO8WA==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/package.json b/package.json index 203a679d..d383847b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pc-nrfconnect-cellularmonitor", - "version": "2.1.1", + "version": "2.2.0", "description": "Capture and analyze modem traces", "displayName": "Cellular Monitor", "homepage": "https://github.com/NordicSemiconductor/pc-nrfconnect-cellularmonitor", @@ -46,7 +46,7 @@ "devDependencies": { "@mdi/js": "^7.2.96", "@mdi/react": "^1.6.1", - "@nordicsemiconductor/pc-nrfconnect-shared": "^143.0.0", + "@nordicsemiconductor/pc-nrfconnect-shared": "^145.0.0", "@types/redux-mock-store": "^1.0.2", "chart.js": "^4.1.2", "check-disk-space": "^2.1.0", @@ -58,7 +58,7 @@ "xterm-headless": "^5.1.0" }, "dependencies": { - "@nordicsemiconductor/nrf-monitor-lib-js": "^0.8.4" + "@nordicsemiconductor/nrf-monitor-lib-js": "^0.8.5" }, "eslintConfig": { "extends": "./node_modules/@nordicsemiconductor/pc-nrfconnect-shared/config/eslintrc" @@ -66,5 +66,8 @@ "prettier": "@nordicsemiconductor/pc-nrfconnect-shared/config/prettier.config.js", "bundledDependencies": [ "@nordicsemiconductor/nrf-monitor-lib-js" + ], + "bundleDependencies": [ + "@nordicsemiconductor/nrf-monitor-lib-js" ] } diff --git a/src/features/SidePanel/TraceOptions.tsx b/src/features/SidePanel/TraceOptions.tsx index 252697cc..3d3a0200 100644 --- a/src/features/SidePanel/TraceOptions.tsx +++ b/src/features/SidePanel/TraceOptions.tsx @@ -4,10 +4,11 @@ * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause */ -import React from 'react'; +import React, { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { CollapsibleGroup, + NumberInputSliderWithUnit, selectedDevice, Toggle, } from '@nordicsemiconductor/pc-nrfconnect-shared'; @@ -15,9 +16,11 @@ import { import { is9160DK } from '../programSample/programSample'; import { getIsTracing, + getMasterSecretTimeout, getRefreshOnStart, getResetDevice, getTraceFormats, + setMasterSecretTimeout, setRefreshOnStart, setResetDevice, } from '../tracing/traceSlice'; @@ -38,6 +41,7 @@ export default () => { + ); }; @@ -76,3 +80,27 @@ const RefreshOnStart = () => { /> ); }; + +const MasterSecretTimeout = () => { + const dispatch = useDispatch(); + const masterSecretTimeout = useSelector(getMasterSecretTimeout); + const [localMasterSecretTimeout, setLocalMasterSecretTimeout] = useState( + masterSecretTimeout ?? 1500 + ); + + return ( +
+ + dispatch(setMasterSecretTimeout(value)) + } + unit="s" + /> +
+ ); +}; diff --git a/src/features/tracing/nrfml.ts b/src/features/tracing/nrfml.ts index 1990f970..94d7f57f 100644 --- a/src/features/tracing/nrfml.ts +++ b/src/features/tracing/nrfml.ts @@ -41,6 +41,7 @@ import { } from './tracePacketEvents'; import { getManualDbFilePath, + getMasterSecretTimeout, getRefreshOnStart, getResetDevice, getTaskId, @@ -62,7 +63,10 @@ const nrfmlConfig = ( source: SourceFormat, sinks: TraceFormat[] ): Configuration => ({ - config: { plugins_directory: getPluginsDir() }, + config: { + plugins_directory: getPluginsDir(), + master_secret_timeout: getMasterSecretTimeout(state), + }, sources: [sourceConfig(state, source)], sinks: sinks.map(format => sinkConfig(state, source, format)), }); diff --git a/src/features/tracing/traceSlice.ts b/src/features/tracing/traceSlice.ts index 2fbf57c2..93f1bbda 100644 --- a/src/features/tracing/traceSlice.ts +++ b/src/features/tracing/traceSlice.ts @@ -42,6 +42,7 @@ interface TraceState { resetDevice: boolean; refreshOnStart: boolean; detectedTraceDbFailed: boolean; + masterSecretTimeout?: number; } const initialState = (): TraceState => ({ @@ -60,6 +61,7 @@ const initialState = (): TraceState => ({ resetDevice: restoreResetDevice(), refreshOnStart: restoreRefreshOnStart(), detectedTraceDbFailed: false, + masterSecretTimeout: 1500, }); const traceSlice = createSlice({ @@ -153,6 +155,13 @@ const traceSlice = createSlice({ setDetectTraceDbFailed: (state, action: PayloadAction) => { state.detectedTraceDbFailed = action.payload; }, + setMasterSecretTimeout: ( + state, + { payload: masterSecretTimeout }: PayloadAction + ) => { + state.masterSecretTimeout = + masterSecretTimeout === 0 ? undefined : masterSecretTimeout; + }, }, }); @@ -202,6 +211,9 @@ export const getRefreshOnStart = (state: RootState) => export const getDetectTraceDbFailed = (state: RootState) => state.app.trace.detectedTraceDbFailed; +export const getMasterSecretTimeout = (state: RootState) => + state.app.trace.masterSecretTimeout; + export const { resetTraceInfo, setTraceIsStarted, @@ -221,6 +233,7 @@ export const { setResetDevice, setRefreshOnStart, setDetectTraceDbFailed, + setMasterSecretTimeout, } = traceSlice.actions; export default traceSlice.reducer;