Documentation
¶
Index ¶
- Constants
- type CANFrame
- func (z *CANFrame) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *CANFrame) EncodeMsg(en *msgp.Writer) (err error)
- func (v CANFrame) MarshalEasyJSON(w *jwriter.Writer)
- func (v CANFrame) MarshalJSON() ([]byte, error)
- func (z *CANFrame) MarshalMsg(b []byte) (o []byte, err error)
- func (z *CANFrame) Msgsize() (s int)
- func (f *CANFrame) String() string
- func (v *CANFrame) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *CANFrame) UnmarshalJSON(data []byte) error
- func (z *CANFrame) UnmarshalMsg(bts []byte) (o []byte, err error)
- type IVTMessage
- func (z *IVTMessage) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *IVTMessage) EncodeMsg(en *msgp.Writer) (err error)
- func (v IVTMessage) MarshalEasyJSON(w *jwriter.Writer)
- func (v IVTMessage) MarshalJSON() ([]byte, error)
- func (z *IVTMessage) MarshalMsg(b []byte) (o []byte, err error)
- func (z *IVTMessage) Msgsize() (s int)
- func (v *IVTMessage) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *IVTMessage) UnmarshalJSON(data []byte) error
- func (z *IVTMessage) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Serializable
- type Timespec
- func (z *Timespec) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Timespec) EncodeMsg(en *msgp.Writer) (err error)
- func (v Timespec) MarshalEasyJSON(w *jwriter.Writer)
- func (v Timespec) MarshalJSON() ([]byte, error)
- func (z Timespec) MarshalMsg(b []byte) (o []byte, err error)
- func (z Timespec) Msgsize() (s int)
- func (v *Timespec) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Timespec) UnmarshalJSON(data []byte) error
- func (z *Timespec) UnmarshalMsg(bts []byte) (o []byte, err error)
Constants ¶
const (
CANFrameLength = 16 // CANFrameLength is total length of the frame in the kernel.
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CANFrame ¶
type CANFrame struct { TimestampSoftware Timespec `json:"tss" msg:"tss"` // Software (kernel) timestamp of the frame TimestampHardware Timespec `json:"tsh" msg:"tsh"` // Hardware timestamp of the frame ID uint32 `json:"id" msg:"id"` // CAN ID DLC uint8 `json:"l" msg:"l"` // CAN DLC (data length code) Data []byte `json:"d" msg:"d"` // CAN Data (0-8 bytes) }
CANFrame is a CAN frame
func (CANFrame) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (CANFrame) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*CANFrame) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*CANFrame) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CANFrame) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CANFrame) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type IVTMessage ¶
type IVTMessage struct { Timestamp Timespec `json:"ts" msg:"ts"` // Timestamp of the message Voltage int32 `json:"u" msg:"u"` // Voltage in mV Current int32 `json:"i" msg:"i"` // Current in mA Temperature int32 `json:"t" msg:"t"` // Temperature of the shunt in 1/10 °C }
IVTMessage is a message received from the IVT sensor, containing the power measurements
func (*IVTMessage) DecodeMsg ¶
func (z *IVTMessage) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*IVTMessage) EncodeMsg ¶
func (z *IVTMessage) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (IVTMessage) MarshalEasyJSON ¶
func (v IVTMessage) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IVTMessage) MarshalJSON ¶
func (v IVTMessage) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IVTMessage) MarshalMsg ¶
func (z *IVTMessage) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*IVTMessage) Msgsize ¶
func (z *IVTMessage) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*IVTMessage) UnmarshalEasyJSON ¶
func (v *IVTMessage) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IVTMessage) UnmarshalJSON ¶
func (v *IVTMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*IVTMessage) UnmarshalMsg ¶
func (z *IVTMessage) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Serializable ¶
type Serializable interface { msgp.Marshaler msgp.Unmarshaler msgp.Encodable msgp.Decodable msgp.Sizer json.Marshaler json.Unmarshaler }
Serializable is an interface that all data to be persisted as logdata must satisfy.
type Timespec ¶
type Timespec struct { Sec int32 `json:"s" msg:"s"` // Seconds Nsec int32 `json:"ns" msg:"ns"` // Nanoseconds }
Timespec is the unix.Timespec struct with msgp tags
func (Timespec) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Timespec) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (Timespec) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Timespec) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Timespec) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Timespec) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface