From 04077d0ecffe69139a361a26c087831b525f407a Mon Sep 17 00:00:00 2001 From: Sviatoslav Date: Tue, 14 May 2024 14:43:22 +0200 Subject: [PATCH 1/8] Update shared & currentPane use --- Changelog.md | 6 ++++++ package-lock.json | 46 ++++++++++++++++++++-------------------------- package.json | 6 +++--- src/index.tsx | 8 ++++++-- src/utils/panes.ts | 9 ++++++--- 5 files changed, 41 insertions(+), 34 deletions(-) diff --git a/Changelog.md b/Changelog.md index e9f2b9f..c29482b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +## 2.4.1 - UNRELEASED + +### Added + +- Support for Apple silicon. + ## 2.4.0 - 2024-04-09 ### Changed diff --git a/package-lock.json b/package-lock.json index e746a73..1e76587 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "pc-nrfconnect-dtm", - "version": "2.4.0", + "version": "2.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pc-nrfconnect-dtm", - "version": "2.4.0", + "version": "2.4.1", "license": "SEE LICENSE IN LICENSE", "devDependencies": { - "@nordicsemiconductor/pc-nrfconnect-shared": "^170.0.0", + "@nordicsemiconductor/pc-nrfconnect-shared": "^176.0.0", "@testing-library/user-event": "^13.1.9", "chart.js": "^4.0.1", "chartjs-plugin-datalabels": "2.2.0", @@ -17,7 +17,7 @@ "react-chartjs-2": "^5.0.1" }, "engines": { - "nrfconnect": ">=4.4.1" + "nrfconnect": ">=5.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2873,13 +2873,13 @@ } }, "node_modules/@nordicsemiconductor/pc-nrfconnect-shared": { - "version": "170.0.0", - "resolved": "https://registry.npmjs.org/@nordicsemiconductor/pc-nrfconnect-shared/-/pc-nrfconnect-shared-170.0.0.tgz", - "integrity": "sha512-mZMPYpJRkqjwb74ueA2cHsR8HZVRboXeIvqfL8aScBUKRyC1aMEeV8JPCwxRVvM4FArWKUz9WOgWxuJtGNUUTA==", + "version": "176.0.0", + "resolved": "https://registry.npmjs.org/@nordicsemiconductor/pc-nrfconnect-shared/-/pc-nrfconnect-shared-176.0.0.tgz", + "integrity": "sha512-stdE9Y4UvVfCKvO+WvlXjgIUSnWULJJ1D5xZ6eio3nRWxRR8dnj1SEIvL2h107+kK817FQOfIxzt0NoY4c0gew==", "dev": true, "hasInstallScript": true, "dependencies": { - "@electron/remote": "^2.1.1", + "@electron/remote": "^2.1.2", "@mdi/font": "7.2.96", "@mdi/js": "^7.2.96", "@mdi/react": "^1.6.1", @@ -2912,7 +2912,7 @@ "bootstrap": "4.6.2", "commander": "10.0.0", "date-fns": "2.29.3", - "electron": "^28.1.4", + "electron": "^30.0.2", "electron-store": "8.1.0", "esbuild": "0.19.2", "esbuild-sass-plugin": "2.13.0", @@ -4453,10 +4453,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", - "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==", - "dev": true + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.2", @@ -6982,14 +6985,14 @@ "dev": true }, "node_modules/electron": { - "version": "28.2.2", - "resolved": "https://registry.npmjs.org/electron/-/electron-28.2.2.tgz", - "integrity": "sha512-8UcvIGFcjplHdjPFNAHVFg5bS0atDyT3Zx21WwuE4iLfxcAMsyMEOgrQX3im5LibA8srwsUZs7Cx0JAUfcQRpw==", + "version": "30.0.4", + "resolved": "https://registry.npmjs.org/electron/-/electron-30.0.4.tgz", + "integrity": "sha512-z8tGQeiVM6CHj0t8PKWVhAB4FZTRNN0vSrd1jA4edX1aOjBztddk4d0Gyw91pQb4arIVf2RGPu0hYbHG2+vDcA==", "dev": true, "hasInstallScript": true, "dependencies": { "@electron/get": "^2.0.0", - "@types/node": "^18.11.18", + "@types/node": "^20.9.0", "extract-zip": "^2.0.1" }, "bin": { @@ -7018,15 +7021,6 @@ "integrity": "sha512-aoCqgU6r9+o9/S7wkcSbmPRFi7OWZWiXS9rtjEd+Ouyu/Xyw5RSq2XN8s5Qp8IaFOLiRrhQCphCIjAxgG3eCAg==", "dev": true }, - "node_modules/electron/node_modules/@types/node": { - "version": "18.19.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", - "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/emitter-listener": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", diff --git a/package.json b/package.json index 511c031..a3e2a22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pc-nrfconnect-dtm", - "version": "2.4.0", + "version": "2.4.1", "displayName": "Direct Test Mode", "description": "RF PHY testing of Bluetooth Low Energy devices", "homepage": "https://github.com/NordicSemiconductor/pc-nrfconnect-dtm", @@ -11,7 +11,7 @@ "author": "Nordic Semiconductor ASA", "license": "SEE LICENSE IN LICENSE", "engines": { - "nrfconnect": ">=4.4.1" + "nrfconnect": ">=5.0.0" }, "nrfConnectForDesktop": { "nrfutil": { @@ -45,7 +45,7 @@ "prepare": "husky install" }, "devDependencies": { - "@nordicsemiconductor/pc-nrfconnect-shared": "^170.0.0", + "@nordicsemiconductor/pc-nrfconnect-shared": "^176.0.0", "@testing-library/user-event": "^13.1.9", "chart.js": "^4.0.1", "chartjs-plugin-datalabels": "2.2.0", diff --git a/src/index.tsx b/src/index.tsx index 21ccf24..eb5b570 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -16,6 +16,7 @@ import Receiver from './Receiver'; import appReducer from './reducers'; import SidePanel from './SidePanel'; import Transmitter from './Transmitter'; +import { Panes } from './utils/panes'; import './index.scss'; @@ -28,10 +29,13 @@ render( sidePanel={} panes={[ { - name: 'Transmitter', + name: Panes.TRANSMITTER, Main: Transmitter, }, - { name: 'Receiver', Main: Receiver }, + { + name: Panes.RECEIVER, + Main: Receiver, + }, ]} /> ); diff --git a/src/utils/panes.ts b/src/utils/panes.ts index 71da1d3..b708df0 100644 --- a/src/utils/panes.ts +++ b/src/utils/panes.ts @@ -8,11 +8,14 @@ import { currentPane } from '@nordicsemiconductor/pc-nrfconnect-shared'; import { RootState } from '../reducers/types'; -export const TRANSMITTER = 0; -export const RECEIVER = 1; +// todo: sync with Mode type from 'src/reducers/types.ts' +export enum Panes { + TRANSMITTER = 'Transmitter', + RECEIVER = 'Receiver', +} export const isTransmitterPane = (state: RootState) => - currentPane(state) === TRANSMITTER; + currentPane(state) === Panes.TRANSMITTER; export const paneName = (state: RootState) => isTransmitterPane(state) ? 'transmitter' : 'receiver'; From 5fba9b9261c6e58011fe042a09238fdda72e4e10 Mon Sep 17 00:00:00 2001 From: Pascal Pickel <30871542+boundlesscalm@users.noreply.github.com> Date: Wed, 15 May 2024 14:11:13 +0200 Subject: [PATCH 2/8] fix: sort channels correctly (#160) * fix: sort channels correctly sort() without an argument only sorts based on the first ASCII value This would result in [20, 5].sort() => [20, 5] * Update Changelog.md --------- Co-authored-by: Sviatoslav Svitlychnyi --- Changelog.md | 6 +++++- src/actions/testActions.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index c29482b..71990d9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,9 +1,13 @@ -## 2.4.1 - UNRELEASED +## 2.4.1 - Unreleased ### Added - Support for Apple silicon. +### Fixed + +- Sweep mode in some cases wasn't using the selected channels. + ## 2.4.0 - 2024-04-09 ### Changed diff --git a/src/actions/testActions.ts b/src/actions/testActions.ts index 9716f0a..8281eb6 100644 --- a/src/actions/testActions.ts +++ b/src/actions/testActions.ts @@ -141,7 +141,7 @@ export const startTests = const singleChannelIndexed = bleChannelsValues.indexOf(singleChannel); const channelRangeIndexed = channelRange .map(channel => bleChannelsValues.indexOf(channel)) - .sort(); + .sort((a, b) => a - b); const testMode = paneName(getState()); From c65e88ba15c9de9e1650c078a99825f95fda2e1c Mon Sep 17 00:00:00 2001 From: Sviatoslav Svitlychnyi Date: Wed, 15 May 2024 14:11:57 +0200 Subject: [PATCH 3/8] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3e2a22..13d61f0 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "author": "Nordic Semiconductor ASA", "license": "SEE LICENSE IN LICENSE", "engines": { - "nrfconnect": ">=5.0.0" + "nrfconnect": ">=4.4.1" }, "nrfConnectForDesktop": { "nrfutil": { From 555e9df21792a337f502d9a1a2070bd202beda4b Mon Sep 17 00:00:00 2001 From: Pascal Pickel <30871542+boundlesscalm@users.noreply.github.com> Date: Tue, 21 May 2024 14:29:29 +0200 Subject: [PATCH 4/8] fix: guarantee valid transmit power value (#161) --- Changelog.md | 5 +++++ src/SidePanel/TransmitSetupView.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 71990d9..c399dca 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,6 +15,11 @@ - Integrated the functionality of the Feedback tab in the **Give Feedback** dialog in the About tab. +### Fixed + +- Transmit power was sometimes set to an invalid value when selecting an nRF52 + DK. + ## 2.3.1 - 2024-03-25 ### Fixed diff --git a/src/SidePanel/TransmitSetupView.tsx b/src/SidePanel/TransmitSetupView.tsx index e76e9d0..eea66ca 100644 --- a/src/SidePanel/TransmitSetupView.tsx +++ b/src/SidePanel/TransmitSetupView.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause */ -import React from 'react'; +import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { NumberInput } from '@nordicsemiconductor/pc-nrfconnect-shared'; @@ -21,6 +21,12 @@ const TxPowerView = () => { const dBmValues = fromPCA(boardType).txPower; + useEffect(() => { + if (dBmValues.indexOf(txPowerIdx) === -1) { + dispatch(txPowerChanged(dBmValues.length - 1)); + } + }, [dispatch, dBmValues, txPowerIdx]); + return ( Date: Tue, 21 May 2024 14:30:23 +0200 Subject: [PATCH 5/8] Update Changelog.md --- Changelog.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index c399dca..dcf82fb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,8 @@ ### Fixed - Sweep mode in some cases wasn't using the selected channels. +- Transmit power was sometimes set to an invalid value when selecting an nRF52 + DK. ## 2.4.0 - 2024-04-09 @@ -15,11 +17,6 @@ - Integrated the functionality of the Feedback tab in the **Give Feedback** dialog in the About tab. -### Fixed - -- Transmit power was sometimes set to an invalid value when selecting an nRF52 - DK. - ## 2.3.1 - 2024-03-25 ### Fixed From 3519cc196882236a614a7e2b3dd541cfa136d9bd Mon Sep 17 00:00:00 2001 From: Sviatoslav Svitlychnyi Date: Tue, 21 May 2024 14:54:22 +0200 Subject: [PATCH 6/8] Update Changelog.md --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index dcf82fb..4ee12d6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,7 +7,7 @@ ### Fixed - Sweep mode in some cases wasn't using the selected channels. -- Transmit power was sometimes set to an invalid value when selecting an nRF52 +- Transmit power was sometimes set to an invalid value when selecting the nRF52 DK. ## 2.4.0 - 2024-04-09 From 1fff2b5e68270065952aebb7084346394344db60 Mon Sep 17 00:00:00 2001 From: Sviatoslav Svitlychnyi Date: Tue, 21 May 2024 15:24:17 +0200 Subject: [PATCH 7/8] Update Changelog.md --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 4ee12d6..afcc1f4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,4 @@ -## 2.4.1 - Unreleased +## 2.4.1 - 2024-05-21 ### Added From cf09a34cb2043800d55e63744508e5be2ad414db Mon Sep 17 00:00:00 2001 From: Sviatoslav Date: Tue, 21 May 2024 15:28:12 +0200 Subject: [PATCH 8/8] Eslint fix --- Changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index afcc1f4..a5ecfac 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,8 +7,8 @@ ### Fixed - Sweep mode in some cases wasn't using the selected channels. -- Transmit power was sometimes set to an invalid value when selecting the nRF52 - DK. +- Transmit power was sometimes set to an invalid value when selecting the + nRF52 DK. ## 2.4.0 - 2024-04-09