Documentation ¶
Index ¶
- Constants
- func AttachReceiver(ctx model.SimContext, source *telecomm.Connection, ...)
- type BaseTelemetry
- type ClockCalibrated
- type CmdCompleted
- type CmdNotRecognized
- type CmdReceived
- type CommPacket
- type Command
- type Heartbeat
- type MagPwrStateChanged
- type MagReading
- type MagReadingsArray
- type MagSetPwrState
- type Ping
- type Pong
- type Sender
- type Telemetry
- type TlmDropped
Constants ¶
View Source
const ( MagicNumCmd = 0x73133C2C // "tele-exec" PingCID = 0x01000001 MagSetPwrStateCID = 0x02000001 )
View Source
const ( Escape = 0xFF EscEscape = 0x11 EscSOP = 0x22 EscEOP = 0x33 )
View Source
const ( MagicNumTlm = 0x7313DA7A // "tele-data" CmdReceivedTID = 0x01000001 CmdCompletedTID = 0x01000002 CmdNotRecognizedTID = 0x01000003 TlmDroppedTID = 0x01000004 PongTID = 0x01000005 ClockCalibratedTID = 0x01000006 HeartbeatTID = 0x01000007 MagPwrStateChangedTID = 0x02000001 MagReadingsArrayTID = 0x02000002 )
Variables ¶
This section is empty.
Functions ¶
func AttachReceiver ¶
func AttachReceiver(ctx model.SimContext, source *telecomm.Connection, callback func(packet *CommPacket), onErrors func(int))
Types ¶
type BaseTelemetry ¶
type BaseTelemetry struct{}
type ClockCalibrated ¶
type ClockCalibrated struct { BaseTelemetry Adjustment int64 }
func (*ClockCalibrated) String ¶
func (c *ClockCalibrated) String() string
type CmdCompleted ¶
type CmdCompleted struct { BaseTelemetry OriginalTimestamp uint64 OriginalCommandId uint32 Success bool }
func (*CmdCompleted) String ¶
func (c *CmdCompleted) String() string
type CmdNotRecognized ¶
type CmdNotRecognized struct { BaseTelemetry OriginalTimestamp uint64 OriginalCommandId uint32 Length uint32 }
func (*CmdNotRecognized) String ¶
func (c *CmdNotRecognized) String() string
type CmdReceived ¶
type CmdReceived struct { BaseTelemetry OriginalTimestamp uint64 OriginalCommandId uint32 // the CID }
func (*CmdReceived) String ¶
func (c *CmdReceived) String() string
type CommPacket ¶
type CommPacket struct { MagicNumber uint32 CmdTlmId uint32 Timestamp uint64 DataBytes []byte CRC uint32 }
func DecodeCommPacket ¶
func DecodeCommPacket(stream []byte) (packet *CommPacket, bytesUsed int, errors int)
func EncodeCommand ¶
func EncodeCommand(cmd Command, timestamp uint64) *CommPacket
func (*CommPacket) ComputeCRC ¶
func (cp *CommPacket) ComputeCRC() uint32
func (*CommPacket) Encode ¶
func (cp *CommPacket) Encode() []byte
type Heartbeat ¶
type Heartbeat struct {
BaseTelemetry
}
type MagPwrStateChanged ¶
type MagPwrStateChanged struct { BaseTelemetry PowerState bool }
func (*MagPwrStateChanged) String ¶
func (m *MagPwrStateChanged) String() string
type MagReading ¶
func (*MagReading) String ¶
func (m *MagReading) String() string
type MagReadingsArray ¶
type MagReadingsArray struct { Header struct { EarliestTime uint64 LatestTime uint64 } Readings []MagReading }
func (*MagReadingsArray) Decode ¶
func (m *MagReadingsArray) Decode(_ Telemetry, dataBytes []byte, tlmId uint32) error
func (*MagReadingsArray) String ¶
func (m *MagReadingsArray) String() string
type MagSetPwrState ¶
type MagSetPwrState struct {
PowerState bool
}
func (MagSetPwrState) CmdId ¶
func (MagSetPwrState) CmdId() uint32
func (MagSetPwrState) String ¶
func (c MagSetPwrState) String() string
type Pong ¶
type Pong struct { BaseTelemetry PingID uint32 }
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func MakeSender ¶
func MakeSender(ctx model.SimContext, dest *telecomm.Connection) *Sender
func (*Sender) Send ¶
func (s *Sender) Send(packet *CommPacket) bool
type Telemetry ¶
type Telemetry interface { // Decode takes a reference to this interface itself, just to simplify the implementation of BaseTelemetry Decode(t Telemetry, dataBytes []byte, tlmId uint32) error }
func DecodeTelemetry ¶
func DecodeTelemetry(cp *CommPacket) (t Telemetry, timestamp model.VirtualTime, err error)
type TlmDropped ¶
type TlmDropped struct { BaseTelemetry MessagesLost uint32 }
func (*TlmDropped) String ¶
func (t *TlmDropped) String() string
Click to show internal directories.
Click to hide internal directories.