Documentation
¶
Overview ¶
Package pus implements the ECSS Packet Utilization Standard, PUS-C, per ECSS-E-ST-70-41C (15 April 2016).
PUS defines what travels inside a CCSDS Space Packet. Where pkg/spp gives you a packet with an application-defined payload, PUS says how that payload is laid out: a secondary header naming a service and subtype, then the request or report body that pair implies.
The two secondary header types here implement spp.SecondaryHeader, so they plug straight into spp.WithSecondaryHeader and spp.WithDecodeSecondaryHeader without either package knowing about the other.
PUS is a tailoring standard. Several field widths are declared per mission rather than fixed by the text, so every codec in this package takes a MissionProfile. There is no package-level state and no implicit default: a profile is always passed explicitly, because two missions that disagree about widths cannot read each other's packets.
Index ¶
- Constants
- Variables
- type AckFlags
- type AddFMONDefinitionsRequest
- type AddPMONDefinitionsRequest
- type AreYouAliveReport
- type AreYouAliveRequest
- type ChangeTransitionDelayRequest
- type CheckCriteria
- type CheckTransition
- type CheckTransitionReport
- type CheckType
- type CreateSchedulingGroupsRequest
- type DeltaCheck
- type DisabledEventsReport
- type EventControlRequest
- type EventReport
- type ExpectedValueCheck
- type FMONCheckingStatus
- type FMONDefinition
- type FMONDefinitionReport
- type FMONProtectionStatus
- type FMONStatus
- type FMONStatusEntry
- type FMONStatusReport
- type FunctionArgument
- type FunctionArguments
- type HousekeepingControlRequest
- type HousekeepingReport
- type HousekeepingStructure
- type InsertActivitiesRequest
- type LimitCheck
- type MessageKey
- type MissionProfile
- func (p MissionProfile) APIDSize() int
- func (p MissionProfile) CheckTypeSize() int
- func (p MissionProfile) DeltaValueCountSize() int
- func (p MissionProfile) EventDefinitionIDSize() int
- func (p MissionProfile) FMONCheckingStatusSize() int
- func (p MissionProfile) FMONIDSize() int
- func (p MissionProfile) FMONProtectionStatusSize() int
- func (p MissionProfile) FMONStatusSize() int
- func (p MissionProfile) FunctionArgumentCountSize() int
- func (p MissionProfile) FunctionArgumentIDSize() int
- func (p MissionProfile) FunctionIDSize() int
- func (p MissionProfile) GroupIDSize() int
- func (p MissionProfile) MinPMONFailingSize() int
- func (p MissionProfile) MonitorCountSize() int
- func (p MissionProfile) MonitoringIntervalSize() int
- func (p MissionProfile) NewTCHeader(service, subtype uint8, sourceID uint16, ack AckFlags) *TCHeader
- func (p MissionProfile) NewTMHeader(service, subtype uint8, destinationID uint16, t time.Time) *TMHeader
- func (p MissionProfile) PMONCheckingStatusSize() int
- func (p MissionProfile) PMONIDSize() int
- func (p MissionProfile) PMONStatusSize() int
- func (p MissionProfile) ParameterIDSize() int
- func (p MissionProfile) RelativeCoarseSize() int
- func (p MissionProfile) RelativeFineSize() int
- func (p MissionProfile) RelativeTimeSize() int
- func (p MissionProfile) RepetitionNumberSize() int
- func (p MissionProfile) ScheduleAPIDSize() int
- func (p MissionProfile) ScheduleCountSize() int
- func (p MissionProfile) ScheduleRequestIDSize() int
- func (p MissionProfile) ScheduleSeqCountSize() int
- func (p MissionProfile) ScheduleSourceIDSize() int
- func (p MissionProfile) ScheduleStatusSize() int
- func (p MissionProfile) SubScheduleIDSize() int
- func (p MissionProfile) TCHeaderSize() int
- func (p MissionProfile) TMHeaderSize() int
- func (p MissionProfile) TimeSize() int
- func (p MissionProfile) TimeWindowTypeSize() int
- func (p MissionProfile) TransitionDelaySize() int
- func (p MissionProfile) Validate() error
- type ModifyPMONDefinitionsRequest
- type MonitorControlRequest
- type MonitorIDListRequest
- type OnBoardConnectionReport
- type OnBoardConnectionRequest
- type PMONCheckingStatus
- type PMONDefinition
- type PMONDefinitionReport
- type PMONStatus
- type PMONStatusEntry
- type PMONStatusReport
- type ParameterLayout
- type ParameterResolver
- type PerformFunctionRequest
- type Registry
- func (r *Registry) DecodeReport(key MessageKey, data []byte) (Report, error)
- func (r *Registry) DecodeRequest(key MessageKey, data []byte) (Request, error)
- func (r *Registry) KnownReports() []MessageKey
- func (r *Registry) KnownRequests() []MessageKey
- func (r *Registry) ParameterResolver() ParameterResolver
- func (r *Registry) Profile() MissionProfile
- func (r *Registry) RegisterReport(key MessageKey, decoder ReportDecoder) error
- func (r *Registry) RegisterRequest(key MessageKey, decoder RequestDecoder) error
- type RegistryOption
- type RelativeTime
- type Report
- type ReportDecoder
- type ReportDisabledEventsRequest
- type Request
- type RequestDecoder
- type RequestID
- type ScheduleControlRequest
- type ScheduleDetailReport
- type ScheduleFilter
- type ScheduleFilterRequest
- type ScheduleIDListRequest
- type ScheduleRequestID
- type ScheduleRequestIDListRequest
- type ScheduleStatus
- type ScheduleStatusEntry
- type ScheduleSummaryReport
- type ScheduledActivity
- type SchedulingGroupStatusReport
- type Severity
- type SubScheduleStatusReport
- type SummaryActivity
- type SuperCommutatedSet
- type TCHeader
- type TMHeader
- type TimeFormat
- type TimeShiftAllRequest
- type TimeShiftByFilterRequest
- type TimeShiftByRequestIDRequest
- type TimeWindow
- type TimeWindowType
- type ValidityCondition
- type VerificationReport
Constants ¶
const ( // SourceIDSize is the TC source ID width (16 bits, Figure 7-9). SourceIDSize = 2 // MessageTypeCounterSize is the TM message type counter width // (16 bits, Figure 7-7). MessageTypeCounterSize = 2 // DestinationIDSize is the TM destination ID width (16 bits, Figure 7-7). DestinationIDSize = 2 )
Field widths the standard fixes outright, in octets. These are not mission-tailorable: Figure 7-7 and Figure 7-9 give them explicit bit counts.
const ( ServiceRequestVerification uint8 = 1 SubtypeAcceptSuccess uint8 = 1 // TM[1,1] clause 8.1.2.1 SubtypeAcceptFailure uint8 = 2 // TM[1,2] clause 8.1.2.2 SubtypeStartSuccess uint8 = 3 // TM[1,3] clause 8.1.2.3 SubtypeStartFailure uint8 = 4 // TM[1,4] clause 8.1.2.4 SubtypeProgressSuccess uint8 = 5 // TM[1,5] clause 8.1.2.5 SubtypeProgressFailure uint8 = 6 // TM[1,6] clause 8.1.2.6 SubtypeCompleteSuccess uint8 = 7 // TM[1,7] clause 8.1.2.7 SubtypeCompleteFailure uint8 = 8 // TM[1,8] clause 8.1.2.8 SubtypeRoutingFailure uint8 = 10 // TM[1,10] clause 8.1.2.10 )
ST[01] request verification, per ECSS-E-ST-70-41C clause 8.1.
Every report in this service carries a request ID naming the telecommand it concerns, and the failure reports add a failure notice.
const ( ServiceHousekeeping uint8 = 3 SubtypeCreateHKStructure uint8 = 1 // TC[3,1] clause 8.3.2.1 SubtypeDeleteHKStructure uint8 = 3 // TC[3,3] clause 8.3.2.3 SubtypeEnableHKGeneration uint8 = 5 // TC[3,5] clause 8.3.2.5 SubtypeDisableHKGeneration uint8 = 6 // TC[3,6] clause 8.3.2.6 SubtypeHKParameterReport uint8 = 25 // TM[3,25] clause 8.3.2.25 )
ST[03] housekeeping, per ECSS-E-ST-70-41C clause 8.3.
A housekeeping parameter report structure names a set of on-board parameters and how often to sample them. Once defined and enabled, the on-board system emits TM[3,25] reports carrying those parameters' values.
This package handles the structure definitions and the report framing. It does not sample anything: parameter values are supplied by the caller, since only the flight software knows what they mean.
const ( ServiceEventReporting uint8 = 5 SubtypeInformativeEvent uint8 = 1 // TM[5,1] clause 8.5.2.1 SubtypeLowSeverity uint8 = 2 // TM[5,2] clause 8.5.2.2 SubtypeMediumSeverity uint8 = 3 // TM[5,3] clause 8.5.2.3 SubtypeHighSeverity uint8 = 4 // TM[5,4] clause 8.5.2.4 SubtypeEnableEvents uint8 = 5 // TC[5,5] clause 8.5.2.5 SubtypeDisableEvents uint8 = 6 // TC[5,6] clause 8.5.2.6 SubtypeReportDisabled uint8 = 7 // TC[5,7] clause 8.5.2.7 SubtypeDisabledList uint8 = 8 // TM[5,8] clause 8.5.2.8 )
ST[05] event reporting, per ECSS-E-ST-70-41C clause 8.5.
An on-board event produces a report at one of four severities. Each report carries an event definition ID and, optionally, auxiliary data whose structure that ID implies.
const ( ServiceFunctionManagement uint8 = 8 SubtypePerformFunction uint8 = 1 // TC[8,1] clause 8.8.2.1 )
ST[08] function management, per ECSS-E-ST-70-41C clauses 6.8 and 8.8.
One service, one subservice, one message type: TC[8,1] tells an application process to perform one of the functions it declares. What those functions are, what arguments they take and what performing one does are all outside the standard (clause 6.8.1.1). The standard fixes only the envelope.
The standard also says, in that same clause, that missions should prefer their own service types over this one, and that ST[08] "remains in this version of the Standard for backward compatibility reasons". It is here because packets carrying it still fly, not because it is the good way to do this.
const ( ServiceTimeBasedScheduling uint8 = 11 SubtypeEnableScheduleExecution uint8 = 1 // TC[11,1] clause 8.11.2.1 SubtypeDisableScheduleExecution uint8 = 2 // TC[11,2] clause 8.11.2.2 SubtypeResetSchedule uint8 = 3 // TC[11,3] clause 8.11.2.3 SubtypeInsertActivities uint8 = 4 // TC[11,4] clause 8.11.2.4 SubtypeDeleteByRequestID uint8 = 5 // TC[11,5] clause 8.11.2.5 SubtypeDeleteByFilter uint8 = 6 // TC[11,6] clause 8.11.2.6 SubtypeTimeShiftByRequestID uint8 = 7 // TC[11,7] clause 8.11.2.7 SubtypeTimeShiftByFilter uint8 = 8 // TC[11,8] clause 8.11.2.8 SubtypeDetailReportByRequestID uint8 = 9 // TC[11,9] clause 8.11.2.9 SubtypeScheduleDetailReport uint8 = 10 // TM[11,10] clause 8.11.2.10 SubtypeDetailReportByFilter uint8 = 11 // TC[11,11] clause 8.11.2.11 SubtypeSummaryReportByRequestID uint8 = 12 // TC[11,12] clause 8.11.2.12 SubtypeScheduleSummaryReport uint8 = 13 // TM[11,13] clause 8.11.2.13 SubtypeSummaryReportByFilter uint8 = 14 // TC[11,14] clause 8.11.2.14 SubtypeTimeShiftAll uint8 = 15 // TC[11,15] clause 8.11.2.15 SubtypeDetailReportAll uint8 = 16 // TC[11,16] clause 8.11.2.16 SubtypeSummaryReportAll uint8 = 17 // TC[11,17] clause 8.11.2.17 SubtypeReportSubScheduleStatus uint8 = 18 // TC[11,18] clause 8.11.2.18 SubtypeSubScheduleStatusReport uint8 = 19 // TM[11,19] clause 8.11.2.19 SubtypeEnableSubSchedules uint8 = 20 // TC[11,20] clause 8.11.2.20 SubtypeDisableSubSchedules uint8 = 21 // TC[11,21] clause 8.11.2.21 SubtypeCreateSchedulingGroups uint8 = 22 // TC[11,22] clause 8.11.2.22 SubtypeDeleteSchedulingGroups uint8 = 23 // TC[11,23] clause 8.11.2.23 SubtypeEnableSchedulingGroups uint8 = 24 // TC[11,24] clause 8.11.2.24 SubtypeDisableSchedulingGroups uint8 = 25 // TC[11,25] clause 8.11.2.25 SubtypeReportSchedulingGroups uint8 = 26 // TC[11,26] clause 8.11.2.26 SubtypeSchedulingGroupStatusRept uint8 = 27 // TM[11,27] clause 8.11.2.27 )
ST[11] time-based scheduling, per ECSS-E-ST-70-41C clauses 6.11 and 8.11.
The schedule holds telecommands with a release time. The ground inserts them, shifts them, deletes them and asks what is in there; the spacecraft releases each one when its time comes. Twenty-seven message types, and this package implements the wire format of all of them.
What it does not implement is the schedule itself. Clause 6.11 specifies a stateful machine (sub-schedules and groups that can be enabled and disabled, a release window, interlocks between activities) and running it is flight software's job, not a codec's. Every consistency check here is one a message can fail on its own.
Three things about these figures needed care rather than transcription.
The sub-schedule ID and group ID fields are marked optional, and what makes them present is not a flag in the message: clause 6.11.4.1 declares whether the subservice supports sub-schedules and groups at all. So the profile carries SupportsSubSchedules and SupportsGroups, and a decoder without them would mis-split every activity in a list.
The two time tags of a filter have "deduced presence", deduced from the window type. Clause 6.11.10.3c settles which: item (b) sends the from tag for "from time tag" and "from time tag to time tag", item (c) sends the to tag for "to time tag" and "from time tag to time tag". So "to time tag" carries a tag in the second slot with the first slot absent, not a tag in the first slot.
The request ID of figure 8-92 is not the request ID of figure 8-1. See ScheduleRequestID.
const ( ServiceOnBoardMonitoring uint8 = 12 SubtypeEnablePMONDefinitions uint8 = 1 // TC[12,1] clause 8.12.2.1 SubtypeDisablePMONDefinitions uint8 = 2 // TC[12,2] clause 8.12.2.2 SubtypeChangeTransitionDelay uint8 = 3 // TC[12,3] clause 8.12.2.3 SubtypeDeleteAllPMON uint8 = 4 // TC[12,4] clause 8.12.2.4 SubtypeAddPMONDefinitions uint8 = 5 // TC[12,5] clause 8.12.2.5 SubtypeDeletePMONDefinitions uint8 = 6 // TC[12,6] clause 8.12.2.6 SubtypeModifyPMONDefinitions uint8 = 7 // TC[12,7] clause 8.12.2.7 SubtypeReportPMONDefinitions uint8 = 8 // TC[12,8] clause 8.12.2.8 SubtypePMONDefinitionReport uint8 = 9 // TM[12,9] clause 8.12.2.9 SubtypeReportOutOfLimits uint8 = 10 // TC[12,10] clause 8.12.2.10 SubtypeOutOfLimitsReport uint8 = 11 // TM[12,11] clause 8.12.2.11 SubtypeCheckTransitionReport uint8 = 12 // TM[12,12] clause 8.12.2.12 SubtypeReportPMONStatus uint8 = 13 // TC[12,13] clause 8.12.2.13 SubtypePMONStatusReport uint8 = 14 // TM[12,14] clause 8.12.2.14 SubtypeEnablePMONFunction uint8 = 15 // TC[12,15] clause 8.12.2.15 SubtypeDisablePMONFunction uint8 = 16 // TC[12,16] clause 8.12.2.16 SubtypeEnableFMONFunction uint8 = 17 // TC[12,17] clause 8.12.2.17 SubtypeDisableFMONFunction uint8 = 18 // TC[12,18] clause 8.12.2.18 SubtypeEnableFMONDefinitions uint8 = 19 // TC[12,19] clause 8.12.2.19 SubtypeDisableFMONDefinitions uint8 = 20 // TC[12,20] clause 8.12.2.20 SubtypeProtectFMONDefinitions uint8 = 21 // TC[12,21] clause 8.12.2.21 SubtypeUnprotectFMONDefinition uint8 = 22 // TC[12,22] clause 8.12.2.22 SubtypeAddFMONDefinitions uint8 = 23 // TC[12,23] clause 8.12.2.23 SubtypeDeleteFMONDefinitions uint8 = 24 // TC[12,24] clause 8.12.2.24 SubtypeReportFMONDefinitions uint8 = 25 // TC[12,25] clause 8.12.2.25 SubtypeFMONDefinitionReport uint8 = 26 // TM[12,26] clause 8.12.2.26 SubtypeReportFMONStatus uint8 = 27 // TC[12,27] clause 8.12.2.27 SubtypeFMONStatusReport uint8 = 28 // TM[12,28] clause 8.12.2.28 )
const ( ServiceTest uint8 = 17 SubtypeAreYouAlive uint8 = 1 // TC[17,1] clause 8.17.2.1 SubtypeAreYouAliveReport uint8 = 2 // TM[17,2] clause 8.17.2.2 SubtypeOnBoardConnection uint8 = 3 // TC[17,3] clause 8.17.2.3 SubtypeOnBoardReport uint8 = 4 // TM[17,4] clause 8.17.2.4 )
ST[17] test, per ECSS-E-ST-70-41C clause 8.17.
The simplest service in the standard: a liveness check. The ground asks whether an application process is alive and it answers. Neither message carries a body.
const RequestIDSize = 4
RequestIDSize is the encoded width of a request ID, in octets. Figure 8-1 lays it out as packet version number (3) + packet type (1) + secondary header flag (1) + APID (11) + sequence flags (2) + sequence count (14), which is 32 bits, exactly the first four octets of a CCSDS primary header.
const Version = 2
Version is the TC and TM packet PUS version number for PUS-C, per clauses 7.4.3.1c and 7.4.4.1c. Version 0 was the ESA PUS, version 1 was ECSS-E-70-41A.
Variables ¶
var ( // ErrDataTooShort indicates the input ended before a field it must contain. ErrDataTooShort = errors.New("data too short for the PUS field being read") // ErrInvalidVersion indicates a PUS version other than 2, the value // ECSS-E-ST-70-41C clauses 7.4.3.1c and 7.4.4.1c require for PUS-C. ErrInvalidVersion = errors.New("invalid PUS version: this implementation speaks PUS-C (version 2)") // ErrInvalidProfile indicates mission-tailorable widths that cannot work. ErrInvalidProfile = errors.New("invalid mission profile") // ErrHeaderTooLarge indicates a mission profile whose secondary header is // wider than this package accepts. The bound is this package's own; CCSDS // 133.0-B-2 puts no upper limit on a Packet Secondary Header beyond the // packet data field maximum. ErrHeaderTooLarge = errors.New("PUS secondary header exceeds the 63-octet mission profile limit") // ErrUnknownMessageType indicates no codec is registered for a // (service, subtype) pair. ErrUnknownMessageType = errors.New("unknown PUS message type") // ErrDuplicateMessageType indicates two codecs registered for one // (service, subtype) pair. ErrDuplicateMessageType = errors.New("duplicate PUS message type registration") // ErrWrongMessageType indicates a decoder was handed another type's bytes. ErrWrongMessageType = errors.New("message type does not match the decoder") // ErrValueTooLarge indicates a value too wide for the field the profile // allocates to it. ErrValueTooLarge = errors.New("value does not fit the width the mission profile declares") // ErrUnsupportedTimeFormat indicates a time format this package cannot encode. ErrUnsupportedTimeFormat = errors.New("unsupported time format") // ErrInvalidSeverity indicates an event severity outside ST[05]'s four subtypes. ErrInvalidSeverity = errors.New("invalid event severity") // ErrTrailingBytes indicates octets left over after a fixed-size message // body. The PUS acceptance checks verify a request against its type's // structure, so a body longer than its type allows is rejected rather // than silently truncated. ErrTrailingBytes = errors.New("trailing octets after a fixed-size PUS message body") // ErrInvalidTimeWindow indicates a time-window type outside Table 8-5's // four values, or a "from time tag" greater than the "to time tag". // Clause 6.11.10.3d makes both a rejection. ErrInvalidTimeWindow = errors.New("invalid ST[11] time window") // ErrCapabilityNotSupported indicates a message carrying sub-schedule or // group identifiers while the profile declares that the subservice does // not support them (clause 6.11.4.1). Encoding them would produce octets // the peer is not expecting the fields for and so cannot parse. ErrCapabilityNotSupported = errors.New("mission profile does not declare this ST[11] capability") // ErrPacketLengthMismatch indicates an embedded telecommand packet whose // own length field disagrees with the octets supplied. In a scheduled // activity list that would desynchronise every activity after it. ErrPacketLengthMismatch = errors.New("embedded packet length field disagrees with the octets given") // ErrInvalidCheckType indicates a check type outside Table 8-6's three // values. ErrInvalidCheckType = errors.New("invalid ST[12] check type") // ErrCheckCriteriaMismatch indicates check criteria whose set alternative // does not match its check type. The receiving end reads the criteria // according to the type, so a mismatch would be misread rather than // noticed. ErrCheckCriteriaMismatch = errors.New("ST[12] check criteria do not match the check type") // ErrNoParameterResolver indicates an ST[12] message carrying fields whose // widths come from the mission's parameter definitions, decoded by a // registry that was given no ParameterResolver. Guessing would mis-split // the definition list silently. ErrNoParameterResolver = errors.New("this ST[12] message type needs a ParameterResolver") // ErrInvalidParameterLayout indicates a resolver that returned a negative // width. ErrInvalidParameterLayout = errors.New("invalid parameter layout") // ErrFieldWidthMismatch indicates a value whose length is not the width // the parameter's layout declares. These fields sit before others in a // repeated group, so a wrong width shifts everything after it. ErrFieldWidthMismatch = errors.New("value length does not match the width the parameter layout declares") // ErrHeaderNotWordAligned indicates a secondary header whose size is not a // whole number of mission words (clauses 7.4.3.1l and 7.4.4.1g), when the // profile declares a word size to check against. ErrHeaderNotWordAligned = errors.New("PUS secondary header is not a whole number of mission words") )
Sentinel errors returned by the PUS codecs.
Functions ¶
This section is empty.
Types ¶
type AckFlags ¶
type AckFlags uint8
AckFlags are the four acknowledgement request bits of a TC secondary header, per ECSS-E-ST-70-41C clause 7.4.4.1d.
Each bit asks the destination application process for one verification report from service ST[01]. The bit positions are fixed by the standard: bit 3 acceptance, bit 2 start, bit 1 progress, bit 0 completion.
const ( // AckCompletion asks for a report on successful completion of execution // (bit 0, clause 7.4.4.1d.4). AckCompletion AckFlags = 1 << 0 // AckProgress asks for reports on successful progress of execution // (bit 1, clause 7.4.4.1d.3). AckProgress AckFlags = 1 << 1 // AckStart asks for a report on successful start of execution // (bit 2, clause 7.4.4.1d.2). AckStart AckFlags = 1 << 2 // AckAcceptance asks for a report on successful acceptance // (bit 3, clause 7.4.4.1d.1). AckAcceptance AckFlags = 1 << 3 )
type AddFMONDefinitionsRequest ¶ added in v0.4.0
type AddFMONDefinitionsRequest struct {
Profile MissionProfile
// Resolve gives the widths of the validity condition's deduced fields.
// Required only when the profile sets SupportsFMONConditionalChecking,
// because that is the only part of this message that needs it.
Resolve ParameterResolver
// Definitions are the functional monitoring definitions to add.
Definitions []FMONDefinition
}
AddFMONDefinitionsRequest is TC[12,23], per Figure 8-135.
func DecodeAddFMONDefinitionsRequest ¶ added in v0.4.0
func DecodeAddFMONDefinitionsRequest(profile MissionProfile, resolve ParameterResolver, data []byte) (*AddFMONDefinitionsRequest, error)
DecodeAddFMONDefinitionsRequest parses TC[12,23].
func (AddFMONDefinitionsRequest) Encode ¶ added in v0.4.0
func (r AddFMONDefinitionsRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (AddFMONDefinitionsRequest) Humanize ¶ added in v0.4.0
func (r AddFMONDefinitionsRequest) Humanize() string
Humanize returns a human-readable summary.
func (AddFMONDefinitionsRequest) Key ¶ added in v0.4.0
func (AddFMONDefinitionsRequest) Key() MessageKey
Key returns the message type.
type AddPMONDefinitionsRequest ¶ added in v0.4.0
type AddPMONDefinitionsRequest struct {
Profile MissionProfile
// Resolve gives the widths of the deduced fields. Required.
Resolve ParameterResolver
// Definitions are the parameter monitoring definitions to add.
Definitions []PMONDefinition
}
AddPMONDefinitionsRequest is TC[12,5], per Figure 8-114.
func DecodeAddPMONDefinitionsRequest ¶ added in v0.4.0
func DecodeAddPMONDefinitionsRequest(profile MissionProfile, resolve ParameterResolver, data []byte) (*AddPMONDefinitionsRequest, error)
DecodeAddPMONDefinitionsRequest parses TC[12,5].
func (AddPMONDefinitionsRequest) Encode ¶ added in v0.4.0
func (r AddPMONDefinitionsRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (AddPMONDefinitionsRequest) Humanize ¶ added in v0.4.0
func (r AddPMONDefinitionsRequest) Humanize() string
Humanize returns a human-readable summary.
func (AddPMONDefinitionsRequest) Key ¶ added in v0.4.0
func (AddPMONDefinitionsRequest) Key() MessageKey
Key returns the message type.
type AreYouAliveReport ¶
type AreYouAliveReport struct{}
AreYouAliveReport is TM[17,2]. Its source data field is empty.
func (AreYouAliveReport) Encode ¶
func (AreYouAliveReport) Encode() ([]byte, error)
Encode returns an empty source data field.
func (AreYouAliveReport) Humanize ¶
func (AreYouAliveReport) Humanize() string
Humanize returns a human-readable summary.
func (AreYouAliveReport) Key ¶
func (AreYouAliveReport) Key() MessageKey
Key returns the message type.
type AreYouAliveRequest ¶
type AreYouAliveRequest struct{}
AreYouAliveRequest is TC[17,1]. Its application data field is empty.
func (AreYouAliveRequest) Encode ¶
func (AreYouAliveRequest) Encode() ([]byte, error)
Encode returns an empty application data field.
func (AreYouAliveRequest) Humanize ¶
func (AreYouAliveRequest) Humanize() string
Humanize returns a human-readable summary.
func (AreYouAliveRequest) Key ¶
func (AreYouAliveRequest) Key() MessageKey
Key returns the message type.
type ChangeTransitionDelayRequest ¶ added in v0.4.0
type ChangeTransitionDelayRequest struct {
Profile MissionProfile
// MaxReportingDelay is the new maximum transition reporting delay.
MaxReportingDelay uint64
}
ChangeTransitionDelayRequest is TC[12,3], per Figure 8-113: one unsigned integer and nothing else.
func DecodeChangeTransitionDelayRequest ¶ added in v0.4.0
func DecodeChangeTransitionDelayRequest(profile MissionProfile, data []byte) (*ChangeTransitionDelayRequest, error)
DecodeChangeTransitionDelayRequest parses TC[12,3].
func (ChangeTransitionDelayRequest) Encode ¶ added in v0.4.0
func (r ChangeTransitionDelayRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (ChangeTransitionDelayRequest) Humanize ¶ added in v0.4.0
func (r ChangeTransitionDelayRequest) Humanize() string
Humanize returns a human-readable summary.
func (ChangeTransitionDelayRequest) Key ¶ added in v0.4.0
func (ChangeTransitionDelayRequest) Key() MessageKey
Key returns the message type.
type CheckCriteria ¶ added in v0.4.0
type CheckCriteria struct {
Type CheckType
ExpectedValue *ExpectedValueCheck
Limit *LimitCheck
Delta *DeltaCheck
}
CheckCriteria is the "check type dependent criteria" field of Figures 8-114, 8-119 and 8-124.
Exactly one of the three pointers matches Type. Anything else is refused rather than encoded, because the receiving end reads the criteria according to the type and would misread a mismatch.
type CheckTransition ¶ added in v0.4.0
type CheckTransition struct {
// PMONID names the definition.
PMONID uint64
// MonitoredParameterID names the parameter, and its layout gives the
// widths of the three deduced fields below.
MonitoredParameterID uint64
// CheckType is the kind of check, and it decides whether the mask is
// present.
CheckType CheckType
// ExpectedValueCheckMask is present only for expected-value-checking
// (Figure 8-128 note 1). This is the one "deduced presence" in ST[12]
// that another field in the same entry decides.
ExpectedValueCheckMask []byte
// ParameterValue is the sampled value that caused the transition.
ParameterValue []byte
// LimitCrossed is the limit or threshold it crossed.
LimitCrossed []byte
// PreviousCheckingStatus and CurrentCheckingStatus are read against
// CheckType, since Tables 8-7, 8-8 and 8-9 give the same raw values
// different meanings.
PreviousCheckingStatus PMONCheckingStatus
CurrentCheckingStatus PMONCheckingStatus
// TransitionTime is when the change happened.
TransitionTime time.Time
// RawTransitionTime carries the time when the profile declares TimeRaw.
RawTransitionTime []byte
}
CheckTransition is one entry of TM[12,11] and TM[12,12], per Figures 8-128 and 8-129: a parameter monitoring definition whose checking status changed, and what it changed from and to.
type CheckTransitionReport ¶ added in v0.4.0
type CheckTransitionReport struct {
Profile MissionProfile
// Resolve gives the widths of the deduced fields. Required.
Resolve ParameterResolver
// Subtype is SubtypeOutOfLimitsReport or SubtypeCheckTransitionReport.
Subtype uint8
// Transitions are the entries being reported.
Transitions []CheckTransition
}
CheckTransitionReport is TM[12,11] or TM[12,12], per Figures 8-128 and 8-129. One structure printed twice.
The two differ in what they report, not how. TM[12,11] answers TC[12,10] with every definition currently out of limits; TM[12,12] is sent unprompted when a check transitions. Clause 6.12.3.12c limits which transitions appear in TM[12,11], and that is a matter for whatever fills the report, not for the codec.
func DecodeCheckTransitionReport ¶ added in v0.4.0
func DecodeCheckTransitionReport(profile MissionProfile, resolve ParameterResolver, subtype uint8, data []byte) (*CheckTransitionReport, error)
DecodeCheckTransitionReport parses TM[12,11] or TM[12,12]. The subtype has to be supplied because the two share one structure.
func (CheckTransitionReport) Encode ¶ added in v0.4.0
func (r CheckTransitionReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (CheckTransitionReport) Humanize ¶ added in v0.4.0
func (r CheckTransitionReport) Humanize() string
Humanize returns a human-readable summary.
func (CheckTransitionReport) Key ¶ added in v0.4.0
func (r CheckTransitionReport) Key() MessageKey
Key returns the message type.
type CheckType ¶ added in v0.4.0
type CheckType uint64
CheckType is the kind of check a parameter monitoring definition performs, per Table 8-6.
const ( // CheckExpectedValue compares the masked value to an expected value // (clause 6.12.3.2.1c). Raw value 0. CheckExpectedValue CheckType = 0 // CheckLimit compares the value to a low and a high limit // (clause 6.12.3.2.1b). Raw value 1. CheckLimit CheckType = 1 // CheckDelta compares the change between two consecutive values to a low // and a high threshold (clause 6.12.3.2.2c). Raw value 2. CheckDelta CheckType = 2 )
type CreateSchedulingGroupsRequest ¶ added in v0.4.0
type CreateSchedulingGroupsRequest struct {
Profile MissionProfile
// Groups are the groups to create and their initial statuses.
Groups []ScheduleStatusEntry
}
CreateSchedulingGroupsRequest is TC[11,22], per Figure 8-106: groups to create, each with the status it starts in.
func DecodeCreateSchedulingGroupsRequest ¶ added in v0.4.0
func DecodeCreateSchedulingGroupsRequest(profile MissionProfile, data []byte) (*CreateSchedulingGroupsRequest, error)
DecodeCreateSchedulingGroupsRequest parses TC[11,22].
func (CreateSchedulingGroupsRequest) Encode ¶ added in v0.4.0
func (r CreateSchedulingGroupsRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (CreateSchedulingGroupsRequest) Humanize ¶ added in v0.4.0
func (r CreateSchedulingGroupsRequest) Humanize() string
Humanize returns a human-readable summary.
func (CreateSchedulingGroupsRequest) Key ¶ added in v0.4.0
func (CreateSchedulingGroupsRequest) Key() MessageKey
Key returns the message type.
type DeltaCheck ¶ added in v0.4.0
type DeltaCheck struct {
// LowThreshold is the change the parameter must stay at or above.
LowThreshold []byte
// LowEventDefinitionID is the event to raise on a new "below low
// threshold" status. Zero means no event report.
LowEventDefinitionID uint64
// HighThreshold is the change the parameter must stay at or below.
HighThreshold []byte
// HighEventDefinitionID is the event to raise on a new "above high
// threshold" status. Zero means no event report.
HighEventDefinitionID uint64
// ConsecutiveDeltaValues is how many consecutive delta values the check
// uses.
ConsecutiveDeltaValues uint64
}
DeltaCheck is the delta criteria of Figures 8-117, 8-122 and 8-127.
type DisabledEventsReport ¶
type DisabledEventsReport struct {
Profile MissionProfile
// EventDefinitionIDs names the events whose report generation is disabled.
EventDefinitionIDs []uint64
}
DisabledEventsReport is TM[5,8]: the disabled event definitions list report, per clause 8.5.2.8. It carries a count followed by that many event definition IDs, the answer to TC[5,7].
func DecodeDisabledEventsReport ¶
func DecodeDisabledEventsReport(profile MissionProfile, data []byte) (*DisabledEventsReport, error)
DecodeDisabledEventsReport parses TM[5,8].
func (*DisabledEventsReport) Encode ¶
func (r *DisabledEventsReport) Encode() ([]byte, error)
Encode serializes the source data field: a count followed by that many event definition IDs.
func (*DisabledEventsReport) Humanize ¶
func (r *DisabledEventsReport) Humanize() string
Humanize returns a human-readable summary.
func (*DisabledEventsReport) Key ¶
func (r *DisabledEventsReport) Key() MessageKey
Key returns the message type.
type EventControlRequest ¶
type EventControlRequest struct {
Profile MissionProfile
// Enable selects TC[5,5] when true and TC[5,6] when false.
Enable bool
// EventDefinitionIDs names the events to enable or disable.
EventDefinitionIDs []uint64
}
EventControlRequest is TC[5,5] and TC[5,6]: enable or disable the report generation of a list of event definitions.
func DecodeEventControlRequest ¶
func DecodeEventControlRequest(profile MissionProfile, enable bool, data []byte) (*EventControlRequest, error)
DecodeEventControlRequest parses TC[5,5] or TC[5,6].
func (*EventControlRequest) Encode ¶
func (r *EventControlRequest) Encode() ([]byte, error)
Encode serializes the application data field: a count followed by that many event definition IDs.
func (*EventControlRequest) Humanize ¶
func (r *EventControlRequest) Humanize() string
Humanize returns a human-readable summary.
func (*EventControlRequest) Key ¶
func (r *EventControlRequest) Key() MessageKey
Key returns the message type.
type EventReport ¶
type EventReport struct {
Profile MissionProfile
Severity Severity
// EventDefinitionID, with the application process ID, identifies the
// event definition and therefore the shape of the auxiliary data.
EventDefinitionID uint64
// AuxiliaryData is deduced from the event definition. This package carries
// it verbatim rather than interpreting it.
AuxiliaryData []byte
}
EventReport is TM[5,1] through TM[5,4], per Figure 8-59 and its siblings.
The four subtypes share one structure and differ only in severity, so one type covers them all.
func DecodeEventReport ¶
func DecodeEventReport(profile MissionProfile, severity Severity, data []byte) (*EventReport, error)
DecodeEventReport parses an ST[05] event report of the given severity.
func (*EventReport) Encode ¶
func (r *EventReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (*EventReport) Humanize ¶
func (r *EventReport) Humanize() string
Humanize returns a human-readable summary.
type ExpectedValueCheck ¶ added in v0.4.0
type ExpectedValueCheck struct {
// Mask is applied to the monitored parameter's sampled value.
Mask []byte
// Spare pads the criteria out so all three check types can share a width
// (Figure 8-115 note 2). Present only when the profile declares it, and
// then exactly as wide as an event definition ID.
Spare []byte
// ExpectedValue is what the masked value must equal.
ExpectedValue []byte
// EventDefinitionID is the event to raise on a new "unexpected value"
// status. Zero means no event report (Figure 8-115 note 3).
EventDefinitionID uint64
}
ExpectedValueCheck is the expected-value criteria of Figures 8-115, 8-120 and 8-125.
type FMONCheckingStatus ¶ added in v0.4.0
type FMONCheckingStatus uint64
FMONCheckingStatus is the checking status of a functional monitoring definition, per Table 8-13.
Unlike PMONCheckingStatus this one has a single table, so a raw value names a status on its own.
const ( // FMONUnchecked is raw value 0. FMONUnchecked FMONCheckingStatus = 0 // FMONRunning is raw value 1. FMONRunning FMONCheckingStatus = 1 // FMONInvalid is raw value 2. FMONInvalid FMONCheckingStatus = 2 // FMONFailed is raw value 3. FMONFailed FMONCheckingStatus = 3 )
func (FMONCheckingStatus) String ¶ added in v0.4.0
func (s FMONCheckingStatus) String() string
String names the status the way Table 8-13 writes it.
type FMONDefinition ¶ added in v0.4.0
type FMONDefinition struct {
// ID names the definition.
ID uint64
// Validity is the check validity condition. Present only when the profile
// sets SupportsFMONConditionalChecking (clause 6.12.4.2.1f item 2).
Validity ValidityCondition
// ProtectionStatus is whether the definition is protected from deletion.
// Carried by the report only, and only when the profile sets
// SupportsFMONProtection.
ProtectionStatus FMONProtectionStatus
// Status is whether the definition is enabled. Carried by the report
// only.
Status FMONStatus
// EventDefinitionID is the event to raise when the check fails.
EventDefinitionID uint64
// MinPMONFailing is how many of the definition's parameter monitoring
// definitions must be violated at once for the functional check to fail.
// Present only when the profile sets SupportsMinPMONFailingNumber. A
// value of 1 is a logical OR of the checks; a value equal to the number
// of checks is a logical AND (clause 6.12.4.2.1d notes 2 and 3).
MinPMONFailing uint64
// PMONIDs are the parameter monitoring definitions this one watches.
// Clause 6.12.4.2.1f item 5 requires at least one.
PMONIDs []uint64
}
FMONDefinition is one functional monitoring definition, per clause 6.12.4.2.1f and Figures 8-135 and 8-138.
type FMONDefinitionReport ¶ added in v0.4.0
type FMONDefinitionReport struct {
Profile MissionProfile
// Resolve gives the widths of the validity condition's deduced fields.
Resolve ParameterResolver
// Definitions are the functional monitoring definitions being reported.
Definitions []FMONDefinition
}
FMONDefinitionReport is TM[12,26], per Figure 8-138.
func DecodeFMONDefinitionReport ¶ added in v0.4.0
func DecodeFMONDefinitionReport(profile MissionProfile, resolve ParameterResolver, data []byte) (*FMONDefinitionReport, error)
DecodeFMONDefinitionReport parses TM[12,26].
func (FMONDefinitionReport) Encode ¶ added in v0.4.0
func (r FMONDefinitionReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (FMONDefinitionReport) Humanize ¶ added in v0.4.0
func (r FMONDefinitionReport) Humanize() string
Humanize returns a human-readable summary.
func (FMONDefinitionReport) Key ¶ added in v0.4.0
func (FMONDefinitionReport) Key() MessageKey
Key returns the message type.
type FMONProtectionStatus ¶ added in v0.4.0
type FMONProtectionStatus uint64
FMONProtectionStatus is whether a functional monitoring definition is protected from deletion, per Table 8-11.
const ( // FMONUnprotected is raw value 0. FMONUnprotected FMONProtectionStatus = 0 // FMONProtected is raw value 1. FMONProtected FMONProtectionStatus = 1 )
func (FMONProtectionStatus) String ¶ added in v0.4.0
func (s FMONProtectionStatus) String() string
String names the status the way Table 8-11 writes it.
type FMONStatus ¶ added in v0.4.0
type FMONStatus uint64
FMONStatus is whether a functional monitoring definition is enabled, per Table 8-12.
const ( // FMONDisabled is raw value 0. FMONDisabled FMONStatus = 0 // FMONEnabled is raw value 1. FMONEnabled FMONStatus = 1 )
func (FMONStatus) String ¶ added in v0.4.0
func (s FMONStatus) String() string
String names the status the way Table 8-12 writes it.
type FMONStatusEntry ¶ added in v0.4.0
type FMONStatusEntry struct {
// ID names the functional monitoring definition.
ID uint64
// ProtectionStatus is whether the definition is protected from deletion,
// per Table 8-11. Present only when the profile sets
// SupportsFMONProtection.
ProtectionStatus FMONProtectionStatus
// Status is whether the definition is enabled, per Table 8-12.
Status FMONStatus
// CheckingStatus is the outcome of its last evaluation, per Table 8-13.
CheckingStatus FMONCheckingStatus
}
FMONStatusEntry is one entry of TM[12,28], per Figure 8-139.
type FMONStatusReport ¶ added in v0.4.0
type FMONStatusReport struct {
Profile MissionProfile
// Definitions are the functional monitoring definitions and their
// statuses.
Definitions []FMONStatusEntry
}
FMONStatusReport is TM[12,28], per Figure 8-139.
func DecodeFMONStatusReport ¶ added in v0.4.0
func DecodeFMONStatusReport(profile MissionProfile, data []byte) (*FMONStatusReport, error)
DecodeFMONStatusReport parses TM[12,28].
func (FMONStatusReport) Encode ¶ added in v0.4.0
func (r FMONStatusReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (FMONStatusReport) Humanize ¶ added in v0.4.0
func (r FMONStatusReport) Humanize() string
Humanize returns a human-readable summary.
func (FMONStatusReport) Key ¶ added in v0.4.0
func (FMONStatusReport) Key() MessageKey
Key returns the message type.
type FunctionArgument ¶ added in v0.4.0
type FunctionArgument struct {
// ID identifies the argument within its function.
ID uint64
// Value is the argument value, still uninterpreted: the declaration gives
// its width, not its meaning.
Value []byte
}
FunctionArgument is one decoded argument of TC[8,1].
type FunctionArguments ¶ added in v0.4.0
type FunctionArguments struct {
// Count is N, the number of arguments the instruction supplies. Whether
// that is every argument of the function or only the ones being updated
// depends on the function's supplying-arguments policy, clause 6.8.3.1c.
Count uint64
// Raw holds the argument ID and argument value fields, N times, exactly as
// they travel.
Raw []byte
}
FunctionArguments is the optional argument group of TC[8,1]: the count N and the argument octets that follow it.
The group is present only when the function takes arguments (clause 6.8.4c item 2), so a request for a function that takes none carries no count field at all rather than a count of zero.
Raw is not split into individual arguments because it cannot be. Figure 8-87 types each argument value as "deduced": its width comes from the function's argument declaration (clause 6.8.3.1b), which is mission configuration this package does not hold. Both ends of the link already share that declaration, so the octets are moved verbatim. Use SplitArguments when you do hold it.
func (*FunctionArguments) SplitArguments ¶ added in v0.4.0
func (a *FunctionArguments) SplitArguments(profile MissionProfile, width func(argumentID uint64) (int, error)) ([]FunctionArgument, error)
SplitArguments splits the raw argument octets into individual arguments, using a caller-supplied width for each argument value.
The width function is the mission's argument declaration, clause 6.8.3.1b: given an argument ID it returns how many octets that argument's value occupies. This package cannot supply it, and a decoder that guessed would mis-split the block silently.
The count in the message is untrusted, so it is not used to size anything. The octets are walked until they run out, and a block that does not divide evenly into Count arguments is an error rather than a partial answer.
type HousekeepingControlRequest ¶
type HousekeepingControlRequest struct {
Profile MissionProfile
// Subtype selects which of the three requests this is.
Subtype uint8
// StructureIDs names the report structures to act on.
StructureIDs []uint64
}
HousekeepingControlRequest is TC[3,3], TC[3,5] and TC[3,6]: delete report structures, or enable and disable their periodic generation. All three carry a count followed by that many structure IDs.
func DecodeHousekeepingControlRequest ¶
func DecodeHousekeepingControlRequest(profile MissionProfile, subtype uint8, data []byte) (*HousekeepingControlRequest, error)
DecodeHousekeepingControlRequest parses TC[3,3], TC[3,5] or TC[3,6].
func (*HousekeepingControlRequest) Encode ¶
func (r *HousekeepingControlRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (*HousekeepingControlRequest) Humanize ¶
func (r *HousekeepingControlRequest) Humanize() string
Humanize returns a human-readable summary.
func (*HousekeepingControlRequest) Key ¶
func (r *HousekeepingControlRequest) Key() MessageKey
Key returns the message type.
func (*HousekeepingControlRequest) Validate ¶
func (r *HousekeepingControlRequest) Validate() error
Validate checks the request.
type HousekeepingReport ¶
type HousekeepingReport struct {
Profile MissionProfile
// StructureID names the report structure these values belong to.
StructureID uint64
// ParameterValues holds the sampled values, laid out as the structure
// definition dictates. The caller supplies and interprets them.
ParameterValues []byte
}
HousekeepingReport is TM[3,25]: a housekeeping parameter report.
The report carries the structure ID and then the sampled parameter values back to back. Their layout is deduced from the structure definition, which both ends already share, so this package moves the values verbatim.
func DecodeHousekeepingReport ¶
func DecodeHousekeepingReport(profile MissionProfile, data []byte) (*HousekeepingReport, error)
DecodeHousekeepingReport parses TM[3,25].
func (*HousekeepingReport) Encode ¶
func (r *HousekeepingReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (*HousekeepingReport) Humanize ¶
func (r *HousekeepingReport) Humanize() string
Humanize returns a human-readable summary.
func (*HousekeepingReport) Key ¶
func (r *HousekeepingReport) Key() MessageKey
Key returns the message type.
type HousekeepingStructure ¶
type HousekeepingStructure struct {
Profile MissionProfile
// StructureID names this report structure.
StructureID uint64
// CollectionInterval is how often the report is generated, in the units
// the mission declares.
CollectionInterval uint64
// ParameterIDs are the parameters sampled once per interval.
ParameterIDs []uint64
// SuperCommutated are the parameter groups sampled several times per
// interval.
SuperCommutated []SuperCommutatedSet
}
HousekeepingStructure is TC[3,1]: create a housekeeping parameter report structure, per Figure 8-21.
func DecodeHousekeepingStructure ¶
func DecodeHousekeepingStructure(profile MissionProfile, data []byte) (*HousekeepingStructure, error)
DecodeHousekeepingStructure parses TC[3,1].
func (*HousekeepingStructure) Encode ¶
func (s *HousekeepingStructure) Encode() ([]byte, error)
Encode serializes the application data field per Figure 8-21: structure ID, collection interval, N1, N1 parameter IDs, NFA, then for each of NFA groups a repetition number, N2, and N2 parameter IDs.
func (*HousekeepingStructure) Humanize ¶
func (s *HousekeepingStructure) Humanize() string
Humanize returns a human-readable summary.
func (*HousekeepingStructure) Key ¶
func (s *HousekeepingStructure) Key() MessageKey
Key returns the message type.
func (*HousekeepingStructure) Validate ¶
func (s *HousekeepingStructure) Validate() error
Validate checks the structure definition.
type InsertActivitiesRequest ¶ added in v0.4.0
type InsertActivitiesRequest struct {
Profile MissionProfile
// SubScheduleID names the sub-schedule to insert into. Present only when
// the profile sets SupportsSubSchedules.
SubScheduleID uint64
// Activities are the telecommands to schedule, each with its release time.
Activities []ScheduledActivity
}
InsertActivitiesRequest is TC[11,4], per Figure 8-91.
The sub-schedule ID comes once, before the count, so one request inserts into one sub-schedule. The detail report of TM[11,10] puts it inside the repeated group instead, because a report can span sub-schedules.
func DecodeInsertActivitiesRequest ¶ added in v0.4.0
func DecodeInsertActivitiesRequest(profile MissionProfile, data []byte) (*InsertActivitiesRequest, error)
DecodeInsertActivitiesRequest parses TC[11,4].
func (InsertActivitiesRequest) Encode ¶ added in v0.4.0
func (r InsertActivitiesRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (InsertActivitiesRequest) Humanize ¶ added in v0.4.0
func (r InsertActivitiesRequest) Humanize() string
Humanize returns a human-readable summary.
func (InsertActivitiesRequest) Key ¶ added in v0.4.0
func (InsertActivitiesRequest) Key() MessageKey
Key returns the message type.
type LimitCheck ¶ added in v0.4.0
type LimitCheck struct {
// LowLimit is the value the parameter must stay at or above.
LowLimit []byte
// LowEventDefinitionID is the event to raise on a new "below low limit"
// status. Zero means no event report.
LowEventDefinitionID uint64
// HighLimit is the value the parameter must stay at or below.
HighLimit []byte
// HighEventDefinitionID is the event to raise on a new "above high limit"
// status. Zero means no event report.
HighEventDefinitionID uint64
}
LimitCheck is the limit criteria of Figures 8-116, 8-121 and 8-126.
type MessageKey ¶
MessageKey names one PUS message type: a service type ID and a message subtype ID, the pair that clause 5.3.3.1c calls the message type identifier.
It is written TC[service,subtype] for requests and TM[service,subtype] for reports, which is how the standard refers to them throughout.
func (MessageKey) String ¶
func (k MessageKey) String() string
String renders the key the way the standard writes it.
type MissionProfile ¶
type MissionProfile struct {
// TCSpareBytes and TMSpareBytes pad each secondary header out to the
// mission's word size. Clauses 7.4.4.1g and 7.4.3.1l make their presence
// and size a per-application-process declaration.
TCSpareBytes int
TMSpareBytes int
// TimeFormat selects the TM absolute time encoding (clause 7.4.3.1j).
TimeFormat TimeFormat
// CUCCoarseBytes and CUCFineBytes size a CUC time field. Used when
// TimeFormat is TimeCUC or TimeCUCExplicit.
CUCCoarseBytes int
CUCFineBytes int
// CUCEpoch is the epoch a CUC time counts from. The zero value means the
// CCSDS 1958 epoch that pkg/tcf defaults to.
CUCEpoch time.Time
// TimeRawBytes is the width of an opaque time field. Used only when
// TimeFormat is TimeRaw.
TimeRawBytes int
// StepIDBytes sizes the step ID of the ST[01] progress reports, TM[1,5]
// and TM[1,6]. Figures 8-5 and 8-6 mark it enumerated without a width.
StepIDBytes int
// FailureCodeBytes sizes the failure notice code of the ST[01] failure
// reports. Figure 8-2 and its siblings mark it enumerated.
FailureCodeBytes int
// EventDefinitionIDBytes sizes the ST[05] event definition ID
// (Figure 8-59, enumerated).
EventDefinitionIDBytes int
// Housekeeping widths for ST[03] (Figure 8-21, all enumerated or
// unsigned integer without a stated width).
HousekeepingStructureIDBytes int
ParameterIDBytes int
CollectionIntervalBytes int
CountBytes int
// RelativeTimeCoarseBytes and RelativeTimeFineBytes size a PTC 10
// relative time field: the time offsets of ST[11]. Table 7-11's PFC 3 to
// 18 allow 1 to 4 coarse octets and 0 to 3 fine, and the split is the
// PFC's, not the absolute time field's. A mission may declare a different
// width for the two. Zero selects 4 coarse and 0 fine, whole seconds,
// which is what a schedule shift usually needs.
RelativeTimeCoarseBytes int
RelativeTimeFineBytes int
// Time-based scheduling widths for ST[11] (Figures 8-91 to 8-110). Every
// one of these is enumerated or an unsigned integer with no stated width.
SubScheduleIDBytes int
GroupIDBytes int
ScheduleCountBytes int
ScheduleStatusBytes int
TimeWindowTypeBytes int
ScheduleSourceIDBytes int
ScheduleAPIDBytes int
ScheduleSeqCountBytes int
// SupportsSubSchedules and SupportsGroups declare the two capabilities of
// clause 6.11.4.1. They are not widths but they decide field presence:
// figures 8-91, 8-93, 8-97, 8-100 and their siblings mark the sub-schedule
// ID and group ID optional, and what makes them present is the subservice
// supporting the capability. A decoder that guessed would mis-split every
// activity in the list.
SupportsSubSchedules bool
SupportsGroups bool
// On-board monitoring widths for ST[12] (Figures 8-111 to 8-139). All
// enumerated or unsigned integer with no stated width. The monitored and
// validity parameter IDs reuse ParameterIDBytes, and the event definition
// IDs reuse EventDefinitionIDBytes: they name the same things the ST[03]
// and ST[05] fields name, so a mission that sized them once has sized them.
PMONIDBytes int
FMONIDBytes int
MonitorCountBytes int
CheckTypeBytes int
PMONStatusBytes int
PMONCheckingStatusBytes int
FMONStatusBytes int
FMONProtectionStatusBytes int
FMONCheckingStatusBytes int
MonitoringIntervalBytes int
RepetitionNumberBytes int
TransitionDelayBytes int
MinPMONFailingBytes int
DeltaValueCountBytes int
// The five ST[12] subservice declarations that decide field presence.
// Like the ST[11] pair these are not widths, but getting one wrong shifts
// every field after it.
//
// SupportsConditionalChecking is clause 6.12.3.3c: it decides whether a
// parameter monitoring definition carries a check validity condition
// (6.12.3.3g item 3).
//
// PerDefinitionMonitoringInterval is clause 6.12.3.3d: a subservice uses
// either one interval for everything or one per definition, and only the
// second puts an interval in the message (6.12.3.3g item 4).
//
// SupportsTransitionDelayChange is clause 6.12.3.8a: it decides whether
// TM[12,9] leads with the current maximum transition reporting delay
// (6.12.3.10i item 1).
//
// ExpectedValueSpare is clauses 8.12.2.5d, 8.12.2.7e and 8.12.2.9d: a
// spare as wide as an event definition ID, there so all three check types
// can share a width (Figure 8-115 note 2).
//
// SupportsFMONConditionalChecking is clause 6.12.4.2.1c, the functional
// twin of SupportsConditionalChecking (6.12.4.2.1f item 2).
//
// SupportsMinPMONFailingNumber is clause 6.12.4.2.1d: whether a functional
// monitoring definition says how many of its checks must fail at once
// (6.12.4.2.1f item 4).
//
// SupportsFMONProtection is clause 6.12.4.6.1a: a protection status exists
// only for a subservice that can protect definitions.
SupportsConditionalChecking bool
PerDefinitionMonitoringInterval bool
SupportsTransitionDelayChange bool
ExpectedValueSpare bool
SupportsFMONConditionalChecking bool
SupportsMinPMONFailingNumber bool
SupportsFMONProtection bool
// Function management widths for ST[08] (Figure 8-87).
//
// FunctionIDBytes is the width of the fixed character-string that names
// the function. FunctionArgumentCountBytes sizes N, and
// FunctionArgumentIDBytes sizes the enumerated argument ID. The standard
// states no width for any of the three.
FunctionIDBytes int
FunctionArgumentCountBytes int
FunctionArgumentIDBytes int
// APIDBytes sizes the APID field of TC[17,3] and TM[17,4]. Clauses
// 8.17.2.3 and 8.17.2.4 mark it enumerated without a stated width, so it
// is mission-tailorable like the other enumerated fields. Zero selects
// the 2-octet width most missions use.
APIDBytes int
// WordSizeBytes is the mission's word size, in octets. Clauses 7.4.3.1l
// and 7.4.4.1g size the spare fields so each secondary header ends on a
// word boundary. When non-zero, Validate checks that both header sizes are
// whole multiples of this value. Zero disables the check, leaving word
// alignment to the caller-supplied spare widths.
WordSizeBytes int
}
MissionProfile pins every width that ECSS-E-ST-70-41C leaves to the mission. It is a value type and must not be mutated once codecs are using it.
Widths the standard fixes (TC source ID, TM message type counter, TM destination ID, all 16 bits) are deliberately absent. They are constants.
func DefaultProfile ¶
func DefaultProfile() MissionProfile
DefaultProfile returns a profile using the widths most European missions pick: no spare padding, a 6-octet CUC time, and one or two octets for the enumerated identifiers.
It is a convenience for tooling and tests, not a standard-mandated default. ECSS-E-ST-70-41C states no defaults for these fields; a real mission declares them.
func (MissionProfile) APIDSize ¶
func (p MissionProfile) APIDSize() int
APIDSize returns the width of the ST[17] APID field in octets: APIDBytes, or the 2-octet default when the profile leaves it zero.
func (MissionProfile) CheckTypeSize ¶ added in v0.4.0
func (p MissionProfile) CheckTypeSize() int
CheckTypeSize returns the width of a check type field.
func (MissionProfile) DeltaValueCountSize ¶ added in v0.4.0
func (p MissionProfile) DeltaValueCountSize() int
DeltaValueCountSize returns the width of a number-of-consecutive-delta-values field.
func (MissionProfile) EventDefinitionIDSize ¶ added in v0.4.0
func (p MissionProfile) EventDefinitionIDSize() int
EventDefinitionIDSize returns the width of an event definition ID, shared by ST[05] and ST[12].
func (MissionProfile) FMONCheckingStatusSize ¶ added in v0.4.0
func (p MissionProfile) FMONCheckingStatusSize() int
FMONCheckingStatusSize returns the width of an FMON checking status field.
func (MissionProfile) FMONIDSize ¶ added in v0.4.0
func (p MissionProfile) FMONIDSize() int
FMONIDSize returns the width of a functional monitoring definition ID.
func (MissionProfile) FMONProtectionStatusSize ¶ added in v0.4.0
func (p MissionProfile) FMONProtectionStatusSize() int
FMONProtectionStatusSize returns the width of an FMON protection status field.
func (MissionProfile) FMONStatusSize ¶ added in v0.4.0
func (p MissionProfile) FMONStatusSize() int
FMONStatusSize returns the width of an FMON status field.
func (MissionProfile) FunctionArgumentCountSize ¶ added in v0.4.0
func (p MissionProfile) FunctionArgumentCountSize() int
FunctionArgumentCountSize returns the width of the ST[08] argument count N, or 1 when the profile leaves it zero.
func (MissionProfile) FunctionArgumentIDSize ¶ added in v0.4.0
func (p MissionProfile) FunctionArgumentIDSize() int
FunctionArgumentIDSize returns the width of the ST[08] argument ID, or 1 when the profile leaves it zero.
func (MissionProfile) FunctionIDSize ¶ added in v0.4.0
func (p MissionProfile) FunctionIDSize() int
FunctionIDSize returns the width of the ST[08] function ID field in octets: FunctionIDBytes, or 8 when the profile leaves it zero. Eight is this package's choice, not the standard's, figure 8-87 gives the field no width.
func (MissionProfile) GroupIDSize ¶ added in v0.4.0
func (p MissionProfile) GroupIDSize() int
GroupIDSize returns the width of an ST[11] group ID, or 1 by default.
func (MissionProfile) MinPMONFailingSize ¶ added in v0.4.0
func (p MissionProfile) MinPMONFailingSize() int
MinPMONFailingSize returns the width of a minimum PMON failing number field.
func (MissionProfile) MonitorCountSize ¶ added in v0.4.0
func (p MissionProfile) MonitorCountSize() int
MonitorCountSize returns the width of an ST[12] N field.
func (MissionProfile) MonitoringIntervalSize ¶ added in v0.4.0
func (p MissionProfile) MonitoringIntervalSize() int
MonitoringIntervalSize returns the width of a monitoring interval field. Clause 6.12.3.3f expresses the interval in on-board parameter minimum sampling interval units, not in seconds.
func (MissionProfile) NewTCHeader ¶
func (p MissionProfile) NewTCHeader(service, subtype uint8, sourceID uint16, ack AckFlags) *TCHeader
NewTCHeader builds a telecommand secondary header under a profile.
func (MissionProfile) NewTMHeader ¶
func (p MissionProfile) NewTMHeader(service, subtype uint8, destinationID uint16, t time.Time) *TMHeader
NewTMHeader builds a telemetry secondary header under a profile.
func (MissionProfile) PMONCheckingStatusSize ¶ added in v0.4.0
func (p MissionProfile) PMONCheckingStatusSize() int
PMONCheckingStatusSize returns the width of a PMON checking status field.
func (MissionProfile) PMONIDSize ¶ added in v0.4.0
func (p MissionProfile) PMONIDSize() int
The ST[12] field widths. Each returns the profile's value, or the default noted on the constant when the profile leaves it zero. No standard states any of them.
func (MissionProfile) PMONStatusSize ¶ added in v0.4.0
func (p MissionProfile) PMONStatusSize() int
PMONStatusSize returns the width of a PMON status field.
func (MissionProfile) ParameterIDSize ¶ added in v0.4.0
func (p MissionProfile) ParameterIDSize() int
ParameterIDSize returns the width of an on-board parameter ID, shared by ST[03] and ST[12].
func (MissionProfile) RelativeCoarseSize ¶ added in v0.4.0
func (p MissionProfile) RelativeCoarseSize() int
RelativeCoarseSize returns the coarse octets of a relative time field, or 4 when the profile leaves it zero.
func (MissionProfile) RelativeFineSize ¶ added in v0.4.0
func (p MissionProfile) RelativeFineSize() int
RelativeFineSize returns the fine octets of a relative time field. Zero is a real answer here (whole seconds) so there is no default to substitute.
func (MissionProfile) RelativeTimeSize ¶ added in v0.4.0
func (p MissionProfile) RelativeTimeSize() int
RelativeTimeSize returns the width of a PTC 10 relative time field in octets: coarse plus fine, with no P-field, since Table 7-11 makes it implicit for every PFC it lists.
func (MissionProfile) RepetitionNumberSize ¶ added in v0.4.0
func (p MissionProfile) RepetitionNumberSize() int
RepetitionNumberSize returns the width of a repetition number field.
func (MissionProfile) ScheduleAPIDSize ¶ added in v0.4.0
func (p MissionProfile) ScheduleAPIDSize() int
ScheduleAPIDSize returns the width of an ST[11] application process ID.
func (MissionProfile) ScheduleCountSize ¶ added in v0.4.0
func (p MissionProfile) ScheduleCountSize() int
ScheduleCountSize returns the width of an ST[11] N field, or 1 by default.
func (MissionProfile) ScheduleRequestIDSize ¶ added in v0.4.0
func (p MissionProfile) ScheduleRequestIDSize() int
ScheduleRequestIDSize returns the width of a whole ST[11] request ID.
func (MissionProfile) ScheduleSeqCountSize ¶ added in v0.4.0
func (p MissionProfile) ScheduleSeqCountSize() int
ScheduleSeqCountSize returns the width of an ST[11] sequence count.
func (MissionProfile) ScheduleSourceIDSize ¶ added in v0.4.0
func (p MissionProfile) ScheduleSourceIDSize() int
ScheduleSourceIDSize, ScheduleAPIDSize and ScheduleSeqCountSize return the three widths of an ST[11] request ID (Figure 8-92), each defaulting to 2.
func (MissionProfile) ScheduleStatusSize ¶ added in v0.4.0
func (p MissionProfile) ScheduleStatusSize() int
ScheduleStatusSize returns the width of an ST[11] sub-schedule or group status field, or 1 by default. Tables 8-3 and 8-4 give both the same two values, so one width covers both.
func (MissionProfile) SubScheduleIDSize ¶ added in v0.4.0
func (p MissionProfile) SubScheduleIDSize() int
SubScheduleIDSize returns the width of an ST[11] sub-schedule ID, or 1 when the profile leaves it zero.
func (MissionProfile) TCHeaderSize ¶
func (p MissionProfile) TCHeaderSize() int
TCHeaderSize returns the encoded width of a TC secondary header: version and ack flags (1) + service (1) + subtype (1) + source ID (2) + spare (Figure 7-9).
func (MissionProfile) TMHeaderSize ¶
func (p MissionProfile) TMHeaderSize() int
TMHeaderSize returns the encoded width of a TM secondary header: version and time reference status (1) + service (1) + subtype (1) + message type counter (2) + destination ID (2) + time + spare (Figure 7-7).
func (MissionProfile) TimeSize ¶
func (p MissionProfile) TimeSize() int
TimeSize returns the width of the TM absolute time field in octets.
func (MissionProfile) TimeWindowTypeSize ¶ added in v0.4.0
func (p MissionProfile) TimeWindowTypeSize() int
TimeWindowTypeSize returns the width of an ST[11] time window type field, or 1 by default.
func (MissionProfile) TransitionDelaySize ¶ added in v0.4.0
func (p MissionProfile) TransitionDelaySize() int
TransitionDelaySize returns the width of a maximum transition reporting delay field.
func (MissionProfile) Validate ¶
func (p MissionProfile) Validate() error
Validate checks the profile's widths.
Both header sizes must be at least 1 octet and no more than 63. Only the lower bound comes from a standard: CCSDS 133.0-B-2 4.1.4.2.1.3 requires the Packet Secondary Header to be a whole number of octets, and pkg/spp refuses a zero-length one. The Blue Book sets no upper limit at all. The data field maximum is the only ceiling it gives. The 63-octet cap here is this package's own sanity bound on a mission profile: a PUS secondary header of that width already carries an 8-octet time code and 50-odd octets of spare, so a larger one is far more likely to be a mistyped profile than a real design. Missions that genuinely need more should raise it here.
type ModifyPMONDefinitionsRequest ¶ added in v0.4.0
type ModifyPMONDefinitionsRequest struct {
Profile MissionProfile
// Resolve gives the widths of the deduced fields. Required.
Resolve ParameterResolver
// Definitions are the modifications to apply.
Definitions []PMONDefinition
}
ModifyPMONDefinitionsRequest is TC[12,7], per Figure 8-119.
It carries neither a check validity condition nor a monitoring interval: clause 6.12.3.9.4 modifies the check in an existing definition rather than replacing the definition. Clause 8.12.2.7c adds that the check type must match the definition's original one, which only the flight software can verify. It holds the original.
func DecodeModifyPMONDefinitionsRequest ¶ added in v0.4.0
func DecodeModifyPMONDefinitionsRequest(profile MissionProfile, resolve ParameterResolver, data []byte) (*ModifyPMONDefinitionsRequest, error)
DecodeModifyPMONDefinitionsRequest parses TC[12,7].
func (ModifyPMONDefinitionsRequest) Encode ¶ added in v0.4.0
func (r ModifyPMONDefinitionsRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (ModifyPMONDefinitionsRequest) Humanize ¶ added in v0.4.0
func (r ModifyPMONDefinitionsRequest) Humanize() string
Humanize returns a human-readable summary.
func (ModifyPMONDefinitionsRequest) Key ¶ added in v0.4.0
func (ModifyPMONDefinitionsRequest) Key() MessageKey
Key returns the message type.
type MonitorControlRequest ¶ added in v0.4.0
type MonitorControlRequest struct {
// Subtype is one of the eight; anything else is refused on encode.
Subtype uint8
}
MonitorControlRequest is any of the eight ST[12] requests that carry no body.
TC[12,4] is worth singling out: it deletes every parameter monitoring definition, and clause 6.12.3.9.2 gives it no arguments at all. There is no selective form of it, TC[12,6] is that.
func (MonitorControlRequest) Encode ¶ added in v0.4.0
func (r MonitorControlRequest) Encode() ([]byte, error)
Encode returns an empty application data field.
func (MonitorControlRequest) Humanize ¶ added in v0.4.0
func (r MonitorControlRequest) Humanize() string
Humanize returns a human-readable summary.
func (MonitorControlRequest) Key ¶ added in v0.4.0
func (r MonitorControlRequest) Key() MessageKey
Key returns the message type.
type MonitorIDListRequest ¶ added in v0.4.0
type MonitorIDListRequest struct {
Profile MissionProfile
// Subtype is one of the ten.
Subtype uint8
// IDs are the definitions the request names.
IDs []uint64
}
MonitorIDListRequest is any of the ten ST[12] requests whose body is a count and a list of identifiers, per Figures 8-111, 8-112, 8-118, 8-123, 8-131 to 8-134, 8-136 and 8-137.
Four carry parameter monitoring IDs and six carry functional monitoring IDs; the subtype says which, and the two are sized separately.
Two of the ten give an empty list a meaning: clauses 8.12.2.8c and 8.12.2.25c say that setting N to 0 reports all definitions. The other eight say nothing about it, so IsAll only reports true for those two. An empty enable request is an empty enable request, not a request to enable everything.
func DecodeMonitorIDListRequest ¶ added in v0.4.0
func DecodeMonitorIDListRequest(profile MissionProfile, subtype uint8, data []byte) (*MonitorIDListRequest, error)
DecodeMonitorIDListRequest parses one of the ten ID-list requests. The subtype has to be supplied because the octets do not say which of the ten they are, and because it decides whether the IDs are PMON or FMON IDs.
func (MonitorIDListRequest) Encode ¶ added in v0.4.0
func (r MonitorIDListRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (MonitorIDListRequest) Humanize ¶ added in v0.4.0
func (r MonitorIDListRequest) Humanize() string
Humanize returns a human-readable summary.
func (MonitorIDListRequest) IsAll ¶ added in v0.4.0
func (r MonitorIDListRequest) IsAll() bool
IsAll reports whether an empty list means "all definitions" for this subtype, which only TC[12,8] and TC[12,25] say it does.
func (MonitorIDListRequest) Key ¶ added in v0.4.0
func (r MonitorIDListRequest) Key() MessageKey
Key returns the message type.
type OnBoardConnectionReport ¶
type OnBoardConnectionReport struct {
Profile MissionProfile
// APID identifies the application process that was tested.
APID uint16
}
OnBoardConnectionReport is TM[17,4], the answer to TC[17,3]. Its APID field uses the same profile-declared width as the request.
func DecodeOnBoardConnectionReport ¶
func DecodeOnBoardConnectionReport(profile MissionProfile, data []byte) (*OnBoardConnectionReport, error)
DecodeOnBoardConnectionReport parses TM[17,4].
func (OnBoardConnectionReport) Encode ¶
func (r OnBoardConnectionReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (OnBoardConnectionReport) Humanize ¶
func (r OnBoardConnectionReport) Humanize() string
Humanize returns a human-readable summary.
func (OnBoardConnectionReport) Key ¶
func (OnBoardConnectionReport) Key() MessageKey
Key returns the message type.
type OnBoardConnectionRequest ¶
type OnBoardConnectionRequest struct {
Profile MissionProfile
// APID identifies the application process to test.
APID uint16
}
OnBoardConnectionRequest is TC[17,3]: a connection test addressed to another application process on board. The APID of the process under test travels in the application data field, at the width the profile's APIDBytes declares (two octets when unset).
func DecodeOnBoardConnectionRequest ¶
func DecodeOnBoardConnectionRequest(profile MissionProfile, data []byte) (*OnBoardConnectionRequest, error)
DecodeOnBoardConnectionRequest parses TC[17,3].
func (OnBoardConnectionRequest) Encode ¶
func (r OnBoardConnectionRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (OnBoardConnectionRequest) Humanize ¶
func (r OnBoardConnectionRequest) Humanize() string
Humanize returns a human-readable summary.
func (OnBoardConnectionRequest) Key ¶
func (OnBoardConnectionRequest) Key() MessageKey
Key returns the message type.
type PMONCheckingStatus ¶ added in v0.4.0
type PMONCheckingStatus uint64
PMONCheckingStatus is the checking status of a parameter monitoring definition.
Its raw values mean different things depending on the check type: clause 8.12.3.1b gives three tables, 8-7 for expected-value-checking, 8-8 for limit-checking and 8-9 for delta-checking. Values 0, 1 and 2 line up (the nominal status, "unchecked" and "invalid") but 3 and 4 do not. So a raw value on its own does not name a status, and NameFor takes the check type.
const ( // PMONNominal is raw value 0: "expected value" for an expected-value // check, "within limits" for a limit check, "within thresholds" for a // delta check. PMONNominal PMONCheckingStatus = 0 // PMONUnchecked is raw value 1 in all three tables. PMONUnchecked PMONCheckingStatus = 1 // PMONInvalid is raw value 2 in all three tables. PMONInvalid PMONCheckingStatus = 2 // PMONUnexpectedValue is raw value 3 for expected-value-checking only // (Table 8-7). PMONUnexpectedValue PMONCheckingStatus = 3 // PMONBelowLowLimit is raw value 3 for limit-checking (Table 8-8). PMONBelowLowLimit PMONCheckingStatus = 3 // PMONAboveHighLimit is raw value 4 for limit-checking (Table 8-8). PMONAboveHighLimit PMONCheckingStatus = 4 // PMONBelowLowThreshold is raw value 3 for delta-checking (Table 8-9). PMONBelowLowThreshold PMONCheckingStatus = 3 // PMONAboveHighThreshold is raw value 4 for delta-checking (Table 8-9). PMONAboveHighThreshold PMONCheckingStatus = 4 )
func (PMONCheckingStatus) NameFor ¶ added in v0.4.0
func (s PMONCheckingStatus) NameFor(check CheckType) string
NameFor returns the engineering value this raw status has under the given check type, per Tables 8-7, 8-8 and 8-9.
The check type is required because the tables disagree: raw 3 is "unexpected value" for an expected-value check, "below low limit" for a limit check and "below low threshold" for a delta check. Reporting the wrong one is a plausible-looking error in an operator display.
type PMONDefinition ¶ added in v0.4.0
type PMONDefinition struct {
// ID names the definition.
ID uint64
// MonitoredParameterID names the on-board parameter being watched. Its
// layout gives the widths of every deduced field in Criteria.
MonitoredParameterID uint64
// Validity is the check validity condition. Carried by the add request
// and the report, and only when the profile sets
// SupportsConditionalChecking.
Validity ValidityCondition
// MonitoringInterval is how long between two evaluations, in on-board
// parameter minimum sampling interval units (clause 6.12.3.3f). Carried
// by the add request and the report, and only when the profile sets
// PerDefinitionMonitoringInterval.
MonitoringInterval uint64
// Status is whether the definition is enabled. Carried by the report
// only.
Status PMONStatus
// RepetitionNumber is how many consecutive consistent checks establish a
// new checking status (clause 6.12.3.3j item 1). Always carried.
RepetitionNumber uint64
// Criteria is the check itself.
Criteria CheckCriteria
}
PMONDefinition is one parameter monitoring definition, per clause 6.12.3.3g and Figures 8-114, 8-119 and 8-124.
One type serves the add request, the modify request and the report, because they differ only in which fields they carry, and the differences are worth naming. The add request carries the check validity condition and the monitoring interval; the modify request carries neither, because clause 6.12.3.9.4 modifies a check rather than replacing a definition. The report carries both plus the PMON status.
type PMONDefinitionReport ¶ added in v0.4.0
type PMONDefinitionReport struct {
Profile MissionProfile
// Resolve gives the widths of the deduced fields. Required.
Resolve ParameterResolver
// MaxReportingDelay is the current maximum transition reporting delay.
// Present only when the profile sets SupportsTransitionDelayChange.
MaxReportingDelay uint64
// Definitions are the parameter monitoring definitions being reported.
Definitions []PMONDefinition
}
PMONDefinitionReport is TM[12,9], per Figure 8-124.
Clause 6.12.3.10i item 1 puts the current maximum transition reporting delay at the front, but only for a subservice that supports changing it. The profile declares that with SupportsTransitionDelayChange.
func DecodePMONDefinitionReport ¶ added in v0.4.0
func DecodePMONDefinitionReport(profile MissionProfile, resolve ParameterResolver, data []byte) (*PMONDefinitionReport, error)
DecodePMONDefinitionReport parses TM[12,9].
func (PMONDefinitionReport) Encode ¶ added in v0.4.0
func (r PMONDefinitionReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (PMONDefinitionReport) Humanize ¶ added in v0.4.0
func (r PMONDefinitionReport) Humanize() string
Humanize returns a human-readable summary.
func (PMONDefinitionReport) Key ¶ added in v0.4.0
func (PMONDefinitionReport) Key() MessageKey
Key returns the message type.
type PMONStatus ¶ added in v0.4.0
type PMONStatus uint64
PMONStatus is whether a parameter monitoring definition is enabled, per Table 8-10.
const ( // PMONDisabled is raw value 0. PMONDisabled PMONStatus = 0 // PMONEnabled is raw value 1. PMONEnabled PMONStatus = 1 )
func (PMONStatus) String ¶ added in v0.4.0
func (s PMONStatus) String() string
String names the status the way Table 8-10 writes it.
type PMONStatusEntry ¶ added in v0.4.0
type PMONStatusEntry struct {
// ID names the definition.
ID uint64
// Status is whether it is enabled, per Table 8-10.
Status PMONStatus
}
PMONStatusEntry pairs a parameter monitoring definition with its status.
type PMONStatusReport ¶ added in v0.4.0
type PMONStatusReport struct {
Profile MissionProfile
// Definitions are the parameter monitoring definitions and their statuses.
Definitions []PMONStatusEntry
}
PMONStatusReport is TM[12,14], per Figure 8-130.
func DecodePMONStatusReport ¶ added in v0.4.0
func DecodePMONStatusReport(profile MissionProfile, data []byte) (*PMONStatusReport, error)
DecodePMONStatusReport parses TM[12,14].
func (PMONStatusReport) Encode ¶ added in v0.4.0
func (r PMONStatusReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (PMONStatusReport) Humanize ¶ added in v0.4.0
func (r PMONStatusReport) Humanize() string
Humanize returns a human-readable summary.
func (PMONStatusReport) Key ¶ added in v0.4.0
func (PMONStatusReport) Key() MessageKey
Key returns the message type.
type ParameterLayout ¶ added in v0.4.0
type ParameterLayout struct {
// ValueBytes is the width of the parameter's value, and so of a limit, a
// delta threshold or an expected value compared against it.
ValueBytes int
// MaskBytes is the width of a bit mask applied to that value.
MaskBytes int
}
ParameterLayout is the on-wire width of one on-board parameter's value and of a bit mask over it, both in octets.
The two are separate because the standard never says they are equal. It says only that each is "specific to" or "derived from" the parameter, Figure 8-114 note 2, Figure 8-115 note 1 and their siblings. A mask over a value is normally the same width, but a mission that declares otherwise is not contradicting the standard, so this type does not decide for it.
type ParameterResolver ¶ added in v0.4.0
type ParameterResolver func(parameterID uint64) (ParameterLayout, error)
ParameterResolver returns the layout of the on-board parameter with this ID.
It is the mission's parameter definition, and there is no way for this package to supply it. Without one, the seven ST[12] message types that carry deduced fields cannot be decoded at all (see the package comment on st12.go) so a registry built without a resolver refuses them rather than guessing.
type PerformFunctionRequest ¶ added in v0.4.0
type PerformFunctionRequest struct {
Profile MissionProfile
// FunctionID names the function to perform. Figure 8-87 types it as a
// fixed character-string, so it travels in exactly FunctionIDSize octets:
// a shorter name is padded with NUL, and a longer one is refused rather
// than truncated, because a truncated name can name a different function.
FunctionID string
// Arguments is nil when the function takes no arguments.
Arguments *FunctionArguments
}
PerformFunctionRequest is TC[8,1], a request to perform a function.
Clause 6.8.4b allows exactly one instruction per request, so there is no count of instructions and no list: the function ID and its arguments are the whole body.
func DecodePerformFunctionRequest ¶ added in v0.4.0
func DecodePerformFunctionRequest(profile MissionProfile, data []byte) (*PerformFunctionRequest, error)
DecodePerformFunctionRequest parses TC[8,1].
The argument group's presence is what figure 8-87 calls "deduced": nothing in the message flags it. Here it is deduced from the message length, which is the one thing a decoder without the mission's function declarations can read. A body that is exactly the function ID carries no arguments; a longer one carries the group.
func (PerformFunctionRequest) Encode ¶ added in v0.4.0
func (r PerformFunctionRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (PerformFunctionRequest) Humanize ¶ added in v0.4.0
func (r PerformFunctionRequest) Humanize() string
Humanize returns a human-readable summary.
func (PerformFunctionRequest) Key ¶ added in v0.4.0
func (PerformFunctionRequest) Key() MessageKey
Key returns the message type.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps message types to the codecs that handle them.
A mission registers the services it supports; anything unregistered decodes to ErrUnknownMessageType rather than being guessed at. That matters because PUS lets missions define their own service types in the ranges the standard leaves open.
A Registry is safe for concurrent use once built.
func NewDefaultRegistry ¶
func NewDefaultRegistry(profile MissionProfile, opts ...RegistryOption) (*Registry, error)
NewDefaultRegistry returns a registry with every service this package implements already registered: ST[01] request verification, ST[03] housekeeping, ST[05] event reporting, ST[08] function management, ST[11] time-based scheduling, ST[12] on-board monitoring, and ST[17] test.
Pass WithParameterResolver to decode the seven ST[12] message types that carry fields sized by the mission's parameter definitions.
func NewRegistry ¶
func NewRegistry(profile MissionProfile, opts ...RegistryOption) (*Registry, error)
NewRegistry returns an empty registry bound to a mission profile.
func (*Registry) DecodeReport ¶
func (r *Registry) DecodeReport(key MessageKey, data []byte) (Report, error)
DecodeReport parses the source data of a telemetry packet.
func (*Registry) DecodeRequest ¶
func (r *Registry) DecodeRequest(key MessageKey, data []byte) (Request, error)
DecodeRequest parses the application data of a telecommand.
func (*Registry) KnownReports ¶
func (r *Registry) KnownReports() []MessageKey
KnownReports lists the registered report types.
func (*Registry) KnownRequests ¶
func (r *Registry) KnownRequests() []MessageKey
KnownRequests lists the registered request types.
func (*Registry) ParameterResolver ¶ added in v0.4.0
func (r *Registry) ParameterResolver() ParameterResolver
ParameterResolver returns the resolver this registry decodes ST[12] against, or nil if it was built without one.
func (*Registry) Profile ¶
func (r *Registry) Profile() MissionProfile
Profile returns the mission profile this registry decodes against.
func (*Registry) RegisterReport ¶
func (r *Registry) RegisterReport(key MessageKey, decoder ReportDecoder) error
RegisterReport adds a report decoder.
func (*Registry) RegisterRequest ¶
func (r *Registry) RegisterRequest(key MessageKey, decoder RequestDecoder) error
RegisterRequest adds a request decoder. Registering a key twice is an error rather than a silent overwrite.
type RegistryOption ¶ added in v0.4.0
type RegistryOption func(*Registry)
RegistryOption configures a Registry at construction.
func WithParameterResolver ¶ added in v0.4.0
func WithParameterResolver(resolve ParameterResolver) RegistryOption
WithParameterResolver supplies the mission's on-board parameter layouts.
ST[12] needs them: seven of its twenty-eight message types carry limits, thresholds, expected values and masks whose widths come from the monitored parameter's own definition, and those fields sit in the middle of a repeated group rather than at the end of the message. Without the widths there is no way to find where the next definition starts.
A registry built without one still decodes the other twenty-one ST[12] types. The seven return ErrNoParameterResolver rather than guessing.
type RelativeTime ¶ added in v0.4.0
type RelativeTime struct {
// Ticks is the coarse-and-fine field read as one signed integer, in units
// of 2^-(8*FineBytes) seconds.
Ticks int64
// FineBytes is how many of the field's octets are fraction. Zero means
// Ticks is whole seconds.
FineBytes int
}
RelativeTime is a PTC 10 relative time offset: a signed number of seconds and fractions of a second (clause 7.3.11).
Clause 7.3.11b's note says "a negative time offset is expressed as the '2's complement' of the corresponding positive time offset", of the whole coarse-and-fine field, not of the coarse part alone. So the field is one two's-complement integer, and that is what Ticks holds. Table 7-11's PFC 3 to 18 fix the split: coarse octets are (PFC+1)/4 and fine octets are (PFC+1) mod 4.
Ticks rather than a time.Duration because the two do not round-trip. A fine field of three octets resolves 2^-24 of a second, about 60 ns, and the nearest whole nanosecond is not the same number: a Duration would lose the low bits and re-encode to different octets. Duration is offered as a convenience for arithmetic, not as the stored form.
func NewRelativeTime ¶ added in v0.4.0
func NewRelativeTime(p MissionProfile, d time.Duration) (RelativeTime, error)
NewRelativeTime converts a duration to a relative time at the profile's declared widths.
The conversion truncates toward zero when the duration is finer than the fine field resolves. It is the caller's arithmetic that decides whether that matters; nothing here is stored lossily.
func (RelativeTime) Duration ¶ added in v0.4.0
func (r RelativeTime) Duration() time.Duration
Duration converts the offset to a time.Duration, rounding toward zero when the fine field resolves finer than a nanosecond.
type Report ¶
type Report interface {
// Key returns the message type this report carries.
Key() MessageKey
// Encode serializes the source data field.
Encode() ([]byte, error)
}
Report is the source data of a telemetry packet: the body that follows the TM secondary header. Clause 8 specifies the structure for each report type.
type ReportDecoder ¶
type ReportDecoder func(profile MissionProfile, data []byte) (Report, error)
ReportDecoder parses the source data of one report type.
type ReportDisabledEventsRequest ¶
type ReportDisabledEventsRequest struct{}
ReportDisabledEventsRequest is TC[5,7]: report the list of event definitions whose report generation is disabled, per clause 8.5.2.7. Its application data field is empty; the answer is a TM[5,8] report.
func DecodeReportDisabledEventsRequest ¶
func DecodeReportDisabledEventsRequest(data []byte) (*ReportDisabledEventsRequest, error)
DecodeReportDisabledEventsRequest parses TC[5,7], whose body is empty.
func (ReportDisabledEventsRequest) Encode ¶
func (ReportDisabledEventsRequest) Encode() ([]byte, error)
Encode returns an empty application data field.
func (ReportDisabledEventsRequest) Humanize ¶
func (ReportDisabledEventsRequest) Humanize() string
Humanize returns a human-readable summary.
func (ReportDisabledEventsRequest) Key ¶
func (ReportDisabledEventsRequest) Key() MessageKey
Key returns the message type.
type Request ¶
type Request interface {
// Key returns the message type this request carries.
Key() MessageKey
// Encode serializes the application data field.
Encode() ([]byte, error)
}
Request is the application data of a telecommand: the body that follows the TC secondary header. Clause 6 specifies the structure for each request type.
type RequestDecoder ¶
type RequestDecoder func(profile MissionProfile, data []byte) (Request, error)
RequestDecoder parses the application data of one request type.
type RequestID ¶
type RequestID struct {
PacketVersion uint8 // 3 bits
PacketType uint8 // 1 bit
SecondaryHeaderFlag uint8 // 1 bit
APID uint16 // 11 bits
SequenceFlags uint8 // 2 bits
SequenceCount uint16 // 14 bits
}
RequestID identifies the telecommand a verification report concerns (Figure 8-1).
It does not name the source of the request. As the standard's note points out, that comes from the destination ID of the report's own secondary header.
func DecodeRequestID ¶
DecodeRequestID parses a request ID from the front of data.
type ScheduleControlRequest ¶ added in v0.4.0
type ScheduleControlRequest struct {
// Subtype is one of the seven; anything else is refused on encode.
Subtype uint8
}
ScheduleControlRequest is any of the seven ST[11] requests that carry no body: TC[11,1], TC[11,2], TC[11,3], TC[11,16], TC[11,17], TC[11,18] and TC[11,26].
They are one type because they are one structure. The subtype is what distinguishes them, so it is a field rather than seven near-identical declarations.
func (ScheduleControlRequest) Encode ¶ added in v0.4.0
func (r ScheduleControlRequest) Encode() ([]byte, error)
Encode returns an empty application data field.
func (ScheduleControlRequest) Humanize ¶ added in v0.4.0
func (r ScheduleControlRequest) Humanize() string
Humanize returns a human-readable summary.
func (ScheduleControlRequest) Key ¶ added in v0.4.0
func (r ScheduleControlRequest) Key() MessageKey
Key returns the message type.
type ScheduleDetailReport ¶ added in v0.4.0
type ScheduleDetailReport struct {
Profile MissionProfile
// Activities are the scheduled activities being reported, in full.
Activities []ScheduledActivity
}
ScheduleDetailReport is TM[11,10], per Figure 8-97.
Unlike the insert request, each reported activity carries its own sub-schedule ID, so one report can span sub-schedules.
func DecodeScheduleDetailReport ¶ added in v0.4.0
func DecodeScheduleDetailReport(profile MissionProfile, data []byte) (*ScheduleDetailReport, error)
DecodeScheduleDetailReport parses TM[11,10].
func (ScheduleDetailReport) Encode ¶ added in v0.4.0
func (r ScheduleDetailReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (ScheduleDetailReport) Humanize ¶ added in v0.4.0
func (r ScheduleDetailReport) Humanize() string
Humanize returns a human-readable summary.
func (ScheduleDetailReport) Key ¶ added in v0.4.0
func (ScheduleDetailReport) Key() MessageKey
Key returns the message type.
type ScheduleFilter ¶ added in v0.4.0
type ScheduleFilter struct {
Window TimeWindow
// SubScheduleIDs narrows the selection to these sub-schedules. Present
// only when the profile sets SupportsSubSchedules. An empty list with the
// capability supported still carries its count field, as N1 = 0.
SubScheduleIDs []uint64
// GroupIDs narrows the selection to these groups. Present only when the
// profile sets SupportsGroups.
GroupIDs []uint64
}
ScheduleFilter is the whole filter of Figures 8-93, 8-95, 8-98 and 8-101: a time window, then optionally a list of sub-schedules, then optionally a list of groups.
The two lists are intersected with the window, not unioned with it (clause 6.11.10.2.5). Each list is present only when the subservice supports that capability, which the profile declares.
func (ScheduleFilter) Humanize ¶ added in v0.4.0
func (f ScheduleFilter) Humanize() string
Humanize returns a human-readable summary.
type ScheduleFilterRequest ¶ added in v0.4.0
type ScheduleFilterRequest struct {
Profile MissionProfile
// Subtype is one of the three.
Subtype uint8
// Filter selects the activities the request concerns.
Filter ScheduleFilter
}
ScheduleFilterRequest is TC[11,6], TC[11,11] or TC[11,14], per Figures 8-93, 8-98 and 8-101, again one structure printed three times.
func DecodeScheduleFilterRequest ¶ added in v0.4.0
func DecodeScheduleFilterRequest(profile MissionProfile, subtype uint8, data []byte) (*ScheduleFilterRequest, error)
DecodeScheduleFilterRequest parses TC[11,6], TC[11,11] or TC[11,14]. The subtype has to be supplied for the same reason as above.
func (ScheduleFilterRequest) Encode ¶ added in v0.4.0
func (r ScheduleFilterRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (ScheduleFilterRequest) Humanize ¶ added in v0.4.0
func (r ScheduleFilterRequest) Humanize() string
Humanize returns a human-readable summary.
func (ScheduleFilterRequest) Key ¶ added in v0.4.0
func (r ScheduleFilterRequest) Key() MessageKey
Key returns the message type.
type ScheduleIDListRequest ¶ added in v0.4.0
type ScheduleIDListRequest struct {
Profile MissionProfile
// Subtype is one of the five.
Subtype uint8
// IDs are the sub-schedules or groups the request names. Empty means all.
IDs []uint64
}
ScheduleIDListRequest is TC[11,20], TC[11,21], TC[11,23], TC[11,24] or TC[11,25], per Figures 8-104, 8-105, 8-107, 8-108 and 8-109, one structure printed five times, over sub-schedule IDs for the first two and group IDs for the last three.
An empty list is not "nothing": clauses 8.11.2.20c, 8.11.2.21c, 8.11.2.23c, 8.11.2.24c and 8.11.2.25c all say that N set to 0 means all of them. So a zero-length ID list enables, disables or deletes everything, and IsAll says so rather than leaving the caller to remember.
func DecodeScheduleIDListRequest ¶ added in v0.4.0
func DecodeScheduleIDListRequest(profile MissionProfile, subtype uint8, data []byte) (*ScheduleIDListRequest, error)
DecodeScheduleIDListRequest parses TC[11,20], TC[11,21], TC[11,23], TC[11,24] or TC[11,25]. The subtype decides whether the IDs are sub-schedule IDs or group IDs, so it has to be supplied.
func (ScheduleIDListRequest) Encode ¶ added in v0.4.0
func (r ScheduleIDListRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (ScheduleIDListRequest) Humanize ¶ added in v0.4.0
func (r ScheduleIDListRequest) Humanize() string
Humanize returns a human-readable summary.
func (ScheduleIDListRequest) IsAll ¶ added in v0.4.0
func (r ScheduleIDListRequest) IsAll() bool
IsAll reports whether this request applies to every sub-schedule or group, which is what an N of 0 means.
func (ScheduleIDListRequest) Key ¶ added in v0.4.0
func (r ScheduleIDListRequest) Key() MessageKey
Key returns the message type.
type ScheduleRequestID ¶ added in v0.4.0
type ScheduleRequestID struct {
// SourceID identifies where the request came from, the field ST[01]'s
// request ID lacks.
SourceID uint64
// APID is the application process the request was addressed to.
APID uint64
// SequenceCount is the request's packet sequence count.
SequenceCount uint64
}
ScheduleRequestID identifies one scheduled activity, per Figure 8-92.
This is not the RequestID of ST[01]. That one (Figure 8-1) is a bit-packed 32-bit copy of the CCSDS primary header, and its own note says it "cannot be used to identify the request since it does not contain the identifier of the source of that request". Figure 8-92 fixes exactly that: it carries a source ID as well, and all three of its fields are whole octets at mission-declared widths rather than bitfields. Encoding one with the other's codec produces the wrong bytes and no error, so the two are separate types.
func (ScheduleRequestID) Humanize ¶ added in v0.4.0
func (r ScheduleRequestID) Humanize() string
Humanize returns a human-readable summary.
type ScheduleRequestIDListRequest ¶ added in v0.4.0
type ScheduleRequestIDListRequest struct {
Profile MissionProfile
// Subtype is one of the three.
Subtype uint8
// RequestIDs names the activities the request concerns.
RequestIDs []ScheduleRequestID
}
ScheduleRequestIDListRequest is TC[11,5], TC[11,9] or TC[11,12], per Figures 8-92, 8-96 and 8-99, one structure printed three times.
func DecodeScheduleRequestIDListRequest ¶ added in v0.4.0
func DecodeScheduleRequestIDListRequest(profile MissionProfile, subtype uint8, data []byte) (*ScheduleRequestIDListRequest, error)
DecodeScheduleRequestIDListRequest parses TC[11,5], TC[11,9] or TC[11,12].
The subtype has to be supplied because the three share one structure: the octets alone do not say which of the three they are.
func (ScheduleRequestIDListRequest) Encode ¶ added in v0.4.0
func (r ScheduleRequestIDListRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (ScheduleRequestIDListRequest) Humanize ¶ added in v0.4.0
func (r ScheduleRequestIDListRequest) Humanize() string
Humanize returns a human-readable summary.
func (ScheduleRequestIDListRequest) Key ¶ added in v0.4.0
func (r ScheduleRequestIDListRequest) Key() MessageKey
Key returns the message type.
type ScheduleStatus ¶ added in v0.4.0
type ScheduleStatus uint64
ScheduleStatus is a sub-schedule or scheduling group status.
Tables 8-3 and 8-4 define the two separately and give them the same two values, so one type serves both.
const ( // ScheduleDisabled is raw value 0 (Tables 8-3 and 8-4). ScheduleDisabled ScheduleStatus = 0 // ScheduleEnabled is raw value 1. ScheduleEnabled ScheduleStatus = 1 )
func (ScheduleStatus) String ¶ added in v0.4.0
func (s ScheduleStatus) String() string
String names the status the way Tables 8-3 and 8-4 write it.
type ScheduleStatusEntry ¶ added in v0.4.0
type ScheduleStatusEntry struct {
// ID is a sub-schedule ID or a group ID, depending on the message.
ID uint64
// Status is the enabled or disabled state, per Tables 8-3 and 8-4.
Status ScheduleStatus
}
ScheduleStatusEntry pairs an identifier with its status.
type ScheduleSummaryReport ¶ added in v0.4.0
type ScheduleSummaryReport struct {
Profile MissionProfile
// Activities are the scheduled activities being summarised.
Activities []SummaryActivity
}
ScheduleSummaryReport is TM[11,13], per Figure 8-100.
func DecodeScheduleSummaryReport ¶ added in v0.4.0
func DecodeScheduleSummaryReport(profile MissionProfile, data []byte) (*ScheduleSummaryReport, error)
DecodeScheduleSummaryReport parses TM[11,13].
func (ScheduleSummaryReport) Encode ¶ added in v0.4.0
func (r ScheduleSummaryReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (ScheduleSummaryReport) Humanize ¶ added in v0.4.0
func (r ScheduleSummaryReport) Humanize() string
Humanize returns a human-readable summary.
func (ScheduleSummaryReport) Key ¶ added in v0.4.0
func (ScheduleSummaryReport) Key() MessageKey
Key returns the message type.
type ScheduledActivity ¶ added in v0.4.0
type ScheduledActivity struct {
// SubScheduleID names the sub-schedule the activity belongs to. Carried
// per activity in a detail report (Figure 8-97) but once for the whole
// request in an insert (Figure 8-91), so this field is used only by the
// report.
SubScheduleID uint64
// GroupID names the scheduling group. Present when the profile sets
// SupportsGroups.
GroupID uint64
// ReleaseTime is when the request is to be released.
ReleaseTime time.Time
// RawReleaseTime carries the release time when the profile declares
// TimeRaw.
RawReleaseTime []byte
// Request is the telecommand to release: a whole CCSDS telecommand packet,
// primary header included. Table 7-12 PFC 1 types the field that way, and
// its length comes from the packet's own length field rather than from
// anything in the ST[11] message.
Request []byte
}
ScheduledActivity is one entry of an insert request or a detail report: a telecommand and when to release it.
func (ScheduledActivity) Humanize ¶ added in v0.4.0
func (a ScheduledActivity) Humanize() string
Humanize returns a human-readable summary.
type SchedulingGroupStatusReport ¶ added in v0.4.0
type SchedulingGroupStatusReport struct {
Profile MissionProfile
// Groups are the scheduling groups and their statuses.
Groups []ScheduleStatusEntry
}
SchedulingGroupStatusReport is TM[11,27], per Figure 8-110.
func DecodeSchedulingGroupStatusReport ¶ added in v0.4.0
func DecodeSchedulingGroupStatusReport(profile MissionProfile, data []byte) (*SchedulingGroupStatusReport, error)
DecodeSchedulingGroupStatusReport parses TM[11,27].
func (SchedulingGroupStatusReport) Encode ¶ added in v0.4.0
func (r SchedulingGroupStatusReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (SchedulingGroupStatusReport) Humanize ¶ added in v0.4.0
func (r SchedulingGroupStatusReport) Humanize() string
Humanize returns a human-readable summary.
func (SchedulingGroupStatusReport) Key ¶ added in v0.4.0
func (SchedulingGroupStatusReport) Key() MessageKey
Key returns the message type.
type Severity ¶
type Severity uint8
Severity names the four levels of ST[05] event report.
const ( // SeverityInformative is a normal, expected event. SeverityInformative Severity = Severity(SubtypeInformativeEvent) // SeverityLow is a low severity anomaly. SeverityLow Severity = Severity(SubtypeLowSeverity) // SeverityMedium is a medium severity anomaly. SeverityMedium Severity = Severity(SubtypeMediumSeverity) // SeverityHigh is a high severity anomaly. SeverityHigh Severity = Severity(SubtypeHighSeverity) )
type SubScheduleStatusReport ¶ added in v0.4.0
type SubScheduleStatusReport struct {
Profile MissionProfile
// SubSchedules are the sub-schedules and their statuses.
SubSchedules []ScheduleStatusEntry
}
SubScheduleStatusReport is TM[11,19], per Figure 8-103.
func DecodeSubScheduleStatusReport ¶ added in v0.4.0
func DecodeSubScheduleStatusReport(profile MissionProfile, data []byte) (*SubScheduleStatusReport, error)
DecodeSubScheduleStatusReport parses TM[11,19].
func (SubScheduleStatusReport) Encode ¶ added in v0.4.0
func (r SubScheduleStatusReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (SubScheduleStatusReport) Humanize ¶ added in v0.4.0
func (r SubScheduleStatusReport) Humanize() string
Humanize returns a human-readable summary.
func (SubScheduleStatusReport) Key ¶ added in v0.4.0
func (SubScheduleStatusReport) Key() MessageKey
Key returns the message type.
type SummaryActivity ¶ added in v0.4.0
type SummaryActivity struct {
// SubScheduleID names the sub-schedule. Present when the profile sets
// SupportsSubSchedules.
SubScheduleID uint64
// GroupID names the scheduling group. Present when the profile sets
// SupportsGroups.
GroupID uint64
// ReleaseTime is when the request is to be released.
ReleaseTime time.Time
// RawReleaseTime carries the release time when the profile declares
// TimeRaw.
RawReleaseTime []byte
// RequestID names the activity. This is the summary: where the detail
// report carries the whole telecommand, this carries only its identity.
RequestID ScheduleRequestID
}
SummaryActivity is one entry of TM[11,13], per Figure 8-100: an activity named by its request ID rather than carried in full.
type SuperCommutatedSet ¶
type SuperCommutatedSet struct {
// RepetitionNumber is how many times each parameter in this set is
// sampled per collection interval.
RepetitionNumber uint64
// ParameterIDs names the parameters in the set.
ParameterIDs []uint64
}
SuperCommutatedSet is one group of parameters sampled more than once per collection interval (Figure 8-21).
Ordinary parameters are sampled once per interval. A super-commutated set repeats its sampling a fixed number of times, which is how a fast-changing value rides in a slow report.
type TCHeader ¶
type TCHeader struct {
// Profile pins the mission-tailorable widths. A TCHeader without one
// cannot encode, which is deliberate.
Profile MissionProfile
// AckFlags asks for verification reports (clause 7.4.4.1d).
AckFlags AckFlags
// Service and Subtype are the message type ID (clause 7.4.4.1e).
Service uint8
Subtype uint8
// SourceID identifies the issuing entity (clause 7.4.4.1f), 16 bits.
SourceID uint16
// Spare pads the header to the mission's word size. Its length must match
// the profile's TCSpareBytes.
Spare []byte
}
TCHeader is the telecommand packet secondary header of Figure 7-9.
It implements spp.SecondaryHeader, so a PUS telecommand is built by handing one to spp.WithSecondaryHeader.
func (*TCHeader) Decode ¶
Decode parses the header. The receiving header must already carry the profile, since the wire format is not self-describing.
func (*TCHeader) Key ¶
func (h *TCHeader) Key() MessageKey
Key returns the message type this header names.
type TMHeader ¶
type TMHeader struct {
// Profile pins the mission-tailorable widths and the time format.
Profile MissionProfile
// TimeReferenceStatus reports the status of the on-board time reference
// used to time tag this packet (clause 7.4.3.1d). An application process
// that cannot report it sets zero (clause 7.4.3.1e).
TimeReferenceStatus uint8
// Service and Subtype are the message type ID (clause 7.4.3.1f).
Service uint8
Subtype uint8
// MessageTypeCounter counts messages of this type per destination
// (clause 7.4.3.1g), 16 bits. Zero when the capability is absent
// (clause 7.4.3.1h).
MessageTypeCounter uint16
// DestinationID is the application process user identifier of the
// addressed process (clause 7.4.3.1i), 16 bits.
DestinationID uint16
// Time is the time tag of the report (clause 7.4.3.1k). Used when the
// profile selects TimeCUC.
Time time.Time
// RawTime carries the time field verbatim when the profile selects
// TimeRaw. Its length must match the profile's TimeRawBytes.
RawTime []byte
// Spare pads the header to the mission's word size. Its length must match
// the profile's TMSpareBytes.
Spare []byte
}
TMHeader is the telemetry packet secondary header of Figure 7-7.
It implements spp.SecondaryHeader, so a PUS report is built by handing one to spp.WithSecondaryHeader.
func (*TMHeader) Decode ¶
Decode parses the header. The receiving header must already carry the profile, since the wire format is not self-describing.
func (*TMHeader) Key ¶
func (h *TMHeader) Key() MessageKey
Key returns the message type this header names.
type TimeFormat ¶
type TimeFormat uint8
TimeFormat selects how the TM secondary header's absolute time field is encoded. Clause 7.4.3.1j leaves the PFC to the mission's time service.
const ( // TimeNone omits the time field. Useful for ground tooling and tests; // a flight profile normally carries a time. TimeNone TimeFormat = iota // TimeCUC encodes a CCSDS Unsegmented Time Code with an implicit P-field, // which is what PFC 3 to 46 of Table 7-10 specify: the field carries the // coarse and fine octets alone, because the PFC already says how wide they // are. This is the usual choice. TimeCUC // TimeCUCExplicit encodes a CUC that carries its own P-field, which is // PFC 0 of Table 7-10: "explicit definition of time format (CUC or CDS), // i.e. including the P-field". TimeCUCExplicit // TimeRaw carries a fixed-width opaque field the mission defines // elsewhere. This package moves the bytes without interpreting them. TimeRaw )
type TimeShiftAllRequest ¶ added in v0.4.0
type TimeShiftAllRequest struct {
Profile MissionProfile
// Offset is how far to shift every scheduled activity.
Offset RelativeTime
}
TimeShiftAllRequest is TC[11,15], per Figure 8-102: an offset and nothing else.
func DecodeTimeShiftAllRequest ¶ added in v0.4.0
func DecodeTimeShiftAllRequest(profile MissionProfile, data []byte) (*TimeShiftAllRequest, error)
DecodeTimeShiftAllRequest parses TC[11,15].
func (TimeShiftAllRequest) Encode ¶ added in v0.4.0
func (r TimeShiftAllRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (TimeShiftAllRequest) Humanize ¶ added in v0.4.0
func (r TimeShiftAllRequest) Humanize() string
Humanize returns a human-readable summary.
func (TimeShiftAllRequest) Key ¶ added in v0.4.0
func (TimeShiftAllRequest) Key() MessageKey
Key returns the message type.
type TimeShiftByFilterRequest ¶ added in v0.4.0
type TimeShiftByFilterRequest struct {
Profile MissionProfile
// Offset is how far to shift.
Offset RelativeTime
// Filter selects the activities to shift.
Filter ScheduleFilter
}
TimeShiftByFilterRequest is TC[11,8], per Figure 8-95.
func DecodeTimeShiftByFilterRequest ¶ added in v0.4.0
func DecodeTimeShiftByFilterRequest(profile MissionProfile, data []byte) (*TimeShiftByFilterRequest, error)
DecodeTimeShiftByFilterRequest parses TC[11,8].
func (TimeShiftByFilterRequest) Encode ¶ added in v0.4.0
func (r TimeShiftByFilterRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (TimeShiftByFilterRequest) Humanize ¶ added in v0.4.0
func (r TimeShiftByFilterRequest) Humanize() string
Humanize returns a human-readable summary.
func (TimeShiftByFilterRequest) Key ¶ added in v0.4.0
func (TimeShiftByFilterRequest) Key() MessageKey
Key returns the message type.
type TimeShiftByRequestIDRequest ¶ added in v0.4.0
type TimeShiftByRequestIDRequest struct {
Profile MissionProfile
// Offset is how far to shift, positive or negative (clause 7.3.11b).
Offset RelativeTime
// RequestIDs names the activities to shift.
RequestIDs []ScheduleRequestID
}
TimeShiftByRequestIDRequest is TC[11,7], per Figure 8-94: an offset, then the activities to shift.
func DecodeTimeShiftByRequestIDRequest ¶ added in v0.4.0
func DecodeTimeShiftByRequestIDRequest(profile MissionProfile, data []byte) (*TimeShiftByRequestIDRequest, error)
DecodeTimeShiftByRequestIDRequest parses TC[11,7].
func (TimeShiftByRequestIDRequest) Encode ¶ added in v0.4.0
func (r TimeShiftByRequestIDRequest) Encode() ([]byte, error)
Encode serializes the application data field.
func (TimeShiftByRequestIDRequest) Humanize ¶ added in v0.4.0
func (r TimeShiftByRequestIDRequest) Humanize() string
Humanize returns a human-readable summary.
func (TimeShiftByRequestIDRequest) Key ¶ added in v0.4.0
func (TimeShiftByRequestIDRequest) Key() MessageKey
Key returns the message type.
type TimeWindow ¶ added in v0.4.0
type TimeWindow struct {
// Type selects which of the four filtering mechanisms of clause
// 6.11.10.2.2 applies, and with it which tags travel.
Type TimeWindowType
// From is the "from time tag". It travels for WindowFrom and WindowFromTo.
From time.Time
// To is the "to time tag". It travels for WindowTo and WindowFromTo.
To time.Time
// RawFrom and RawTo carry the tags when the profile declares TimeRaw.
RawFrom []byte
RawTo []byte
}
TimeWindow is the time-window part of a filter, per Figures 8-93 and its siblings.
func (TimeWindow) Humanize ¶ added in v0.4.0
func (w TimeWindow) Humanize() string
Humanize returns a human-readable summary.
type TimeWindowType ¶ added in v0.4.0
type TimeWindowType uint64
TimeWindowType is the type of a time-window filter, per Table 8-5.
const ( // WindowSelectAll selects every activity; neither time tag travels. WindowSelectAll TimeWindowType = 0 // WindowFromTo selects activities between and including both tags // (clause 6.11.10.2.2b). Both tags travel. WindowFromTo TimeWindowType = 1 // WindowFrom selects activities at and after the from tag // (clause 6.11.10.2.2c). Only the from tag travels. WindowFrom TimeWindowType = 2 // WindowTo selects activities before and at the to tag // (clause 6.11.10.2.2d). Only the to tag travels. WindowTo TimeWindowType = 3 )
func (TimeWindowType) String ¶ added in v0.4.0
func (t TimeWindowType) String() string
String names the type the way Table 8-5 writes it.
type ValidityCondition ¶ added in v0.4.0
type ValidityCondition struct {
// ParameterID names the validity parameter, whose layout gives the widths
// of the two fields below.
ParameterID uint64
// Mask is the bit mask to apply to the sampled value.
Mask []byte
// ExpectedValue is what the masked value must equal.
ExpectedValue []byte
}
ValidityCondition is the check validity condition of Figures 8-114, 8-124, 8-135 and 8-138: a parameter, a mask over it, and the value the masked parameter must equal for the check to run.
Clause 6.12.3.2.1i spells out the evaluation: bitwise-and the mask with the sampled value of the validity parameter, and declare the condition true when the result equals the expected value.
The whole group is present only when the subservice supports conditional checking, clause 6.12.3.3c for parameter monitoring, 6.12.4.2.1c for functional monitoring. The profile declares each separately.
type VerificationReport ¶
type VerificationReport struct {
Profile MissionProfile
Subtype uint8
// RequestID names the telecommand being reported on.
RequestID RequestID
// StepID is present on TM[1,5] and TM[1,6] only. Its width comes from the
// profile, since Figures 8-5 and 8-6 mark it enumerated without one.
StepID uint64
// FailureCode and FailureData form the failure notice on the even
// subtypes. FailureData is deduced from the code and carried verbatim.
FailureCode uint64
FailureData []byte
}
VerificationReport is any of the nine ST[01] reports: TM[1,1] to TM[1,8], plus the TM[1,10] failed routing verification report.
Which fields carry meaning depends on the subtype: the progress reports (subtypes 5 and 6) add a step ID, and the failure reports (even subtypes, including TM[1,10]) add a failure notice.
func DecodeVerificationReport ¶
func DecodeVerificationReport(profile MissionProfile, subtype uint8, data []byte) (*VerificationReport, error)
DecodeVerificationReport parses an ST[01] report of the given subtype.
func (*VerificationReport) Encode ¶
func (r *VerificationReport) Encode() ([]byte, error)
Encode serializes the source data field.
func (*VerificationReport) HasStepID ¶
func (r *VerificationReport) HasStepID() bool
HasStepID reports whether this subtype carries a step ID.
func (*VerificationReport) Humanize ¶
func (r *VerificationReport) Humanize() string
Humanize returns a human-readable summary.
func (*VerificationReport) IsFailure ¶
func (r *VerificationReport) IsFailure() bool
IsFailure reports whether this subtype carries a failure notice. The even subtypes are the failures, per clause 8.1.2, including TM[1,10], whose body is a request ID and a failure notice, like TM[1,2].
func (*VerificationReport) Key ¶
func (r *VerificationReport) Key() MessageKey
Key returns the message type.
func (*VerificationReport) Validate ¶
func (r *VerificationReport) Validate() error
Validate checks the report against clause 8.1.2. The valid subtypes are 1 to 8 and 10; the standard defines no TM[1,9].