Skip to content

Commit

Permalink
Merge pull request #151 from NordicSemiconductor/fix/channel-mapping
Browse files Browse the repository at this point in the history
Fix/channel mapping
  • Loading branch information
kylebonnici authored Mar 21, 2024
2 parents c228db6 + 135900f commit 63cedee
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/actions/testActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ export const startTests =
const modulationMode = getModulation(state);
const phy = getPhy(state);

const singleChannelIndexed = bleChannelsValues.indexOf(singleChannel);
const channelRangeIndexed = channelRange.map(channel =>
bleChannelsValues.indexOf(channel)
);

const testMode = paneName(getState());

const { single, sweep } = DTM_CHANNEL_MODE;
Expand Down Expand Up @@ -171,16 +176,14 @@ export const startTests =
testPromise = dtm.singleChannelTransmitterTest(
bitpattern,
length,
bleChannelsValues.indexOf(singleChannel),
singleChannelIndexed,
timeoutms
);
} else if (testMode === 'transmitter' && channelMode === sweep) {
testPromise = dtm.sweepTransmitterTest(
bitpattern,
length,
...channelRange.map(channel =>
bleChannelsValues.indexOf(channel)
),
...channelRangeIndexed,
sweepTime,
timeoutms
);
Expand All @@ -196,16 +199,16 @@ export const startTests =
testPromise = dtm.sweepReceiverTest(
bitpattern,
length,
singleChannel,
singleChannel,
singleChannelIndexed,
singleChannelIndexed,
sweepTime,
timeoutms
);
} else {
testPromise = dtm.sweepReceiverTest(
bitpattern,
length,
...channelRange,
...channelRangeIndexed,
sweepTime,
timeoutms
);
Expand All @@ -219,7 +222,7 @@ export const startTests =
receivedChannels = new Array(40).fill(0);

if (received !== undefined) {
receivedChannels[singleChannel] = received;
receivedChannels[singleChannelIndexed] = received;
}
}
const testTypeStr =
Expand Down

0 comments on commit 63cedee

Please sign in to comment.