mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-03 16:32:00 +02:00
Fix trace packet handling (closes #44)
This commit is contained in:
@@ -4,9 +4,11 @@ import {
|
||||
analyzeRepeaterTraffic,
|
||||
buildAmbiguousRepeaterLabel,
|
||||
buildAmbiguousRepeaterNodeId,
|
||||
parsePacket,
|
||||
recordTrafficObservation,
|
||||
type RepeaterTrafficData,
|
||||
} from '../utils/visualizerUtils';
|
||||
import { PayloadType } from '@michaelhart/meshcore-decoder';
|
||||
|
||||
describe('visualizer multibyte hop identity helpers', () => {
|
||||
it('preserves the full hop token in ambiguous node ids', () => {
|
||||
@@ -49,3 +51,13 @@ describe('visualizer traffic pattern grouping', () => {
|
||||
expect(second.shouldSplit).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('visualizer packet parsing', () => {
|
||||
it('uses trace payload hashes instead of outer SNR bytes for TRACE packets', () => {
|
||||
const parsed = parsePacket('260233277e17b0f300000000007df6');
|
||||
|
||||
expect(parsed).not.toBeNull();
|
||||
expect(parsed?.payloadType).toBe(PayloadType.Trace);
|
||||
expect(parsed?.pathBytes).toEqual(['7D', 'F6']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user