Cleaned up the frame.ts by splitting payload parsing to subpackages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Dissected, Segment } from "@hamradio/packet";
|
||||
import { Dissected, Field, Segment } from "@hamradio/packet";
|
||||
|
||||
// Any comment that contains this marker will set the doNotArchive flag on the
|
||||
// decoded payload, which can be used by applications to skip archiving or
|
||||
@@ -141,6 +141,12 @@ export interface ITimestamp {
|
||||
toDate(): Date; // Convert to Date object respecting timezone
|
||||
}
|
||||
|
||||
export interface ITelemetry {
|
||||
sequence: number;
|
||||
analog: number[];
|
||||
digital?: number;
|
||||
}
|
||||
|
||||
// Position Report Payload
|
||||
export interface PositionPayload {
|
||||
type:
|
||||
@@ -390,3 +396,19 @@ export interface DecodedFrame extends IFrame {
|
||||
decoded?: Payload;
|
||||
structure?: Dissected; // Routing and other frame-level sections
|
||||
}
|
||||
|
||||
// Extras is an internal helper type used during decoding to accumulate additional
|
||||
// information that may not fit directly into the standard payload structure,
|
||||
// such as comments, calculated fields, or other metadata that can be useful for
|
||||
// applications consuming the decoded frames.
|
||||
export interface Extras {
|
||||
comment: string;
|
||||
altitude?: number;
|
||||
range?: number;
|
||||
phg?: IPowerHeightGain;
|
||||
dfs?: IDirectionFinding;
|
||||
cse?: number;
|
||||
spd?: number;
|
||||
fields?: Field[];
|
||||
telemetry?: ITelemetry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user