Documentation
¶
Overview ¶
Package raw defines owned observations from NMEA 2000 transport adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observation ¶
type Observation struct {
Kind Kind `json:"kind"`
// Timestamp is the best source timestamp available. ReceivedAt is always
// the host receipt time. When a gateway exposes only a relative clock,
// TransportTimestamp preserves it without pretending it is wall time.
Timestamp time.Time `json:"timestamp"`
ReceivedAt time.Time `json:"receivedAt"`
TransportTimestamp time.Duration `json:"transportTimestamp,omitempty"`
HasTransportTimestamp bool `json:"hasTransportTimestamp,omitempty"`
AdapterID string `json:"adapterId"`
NetworkID string `json:"networkId"`
Direction Direction `json:"direction"`
Frame *can.Frame `json:"frame,omitempty"`
PGN uint32 `json:"pgn,omitempty"`
Priority uint8 `json:"priority,omitempty"`
Source uint8 `json:"source,omitempty"`
Destination *uint8 `json:"destination,omitempty"`
Payload []byte `json:"payload,omitempty"`
Error string `json:"error,omitempty"`
}
Observation is an owned raw record from a transport Adapter or decode pipeline. Frame observations retain the classical CAN frame; message observations retain an assembled PGN payload; decode-error observations retain the same payload and a stable error string.
func (Observation) Clone ¶
func (o Observation) Clone() Observation
Clone returns a fully owned copy safe for another goroutine or caller to retain and mutate.
Click to show internal directories.
Click to hide internal directories.