Documentation ¶
Index ¶
- Constants
- func BoolValue(x interface{}) (bool, bool)
- func Decode(s *DecoderState, vs ...interface{}) error
- func Encode(s *EncoderState, vs ...interface{}) error
- func IntValue(x interface{}) (int, bool)
- type Alarm
- type AlarmLimit
- type Control
- type DecoderState
- type Display
- type EncoderState
- type Enum
- type FieldDesc
- type FieldDescer
- type PVAny
- type PVArray
- type PVBitSet
- type PVBoolean
- type PVBoundedString
- type PVByte
- type PVDouble
- type PVField
- type PVFloat
- type PVInt
- type PVLong
- type PVShort
- type PVSize
- type PVStatus
- type PVString
- type PVStructure
- type PVStructureDiff
- type PVStructureDiffPut
- type PVUByte
- type PVUInt
- type PVULong
- type PVUShort
- type Reader
- type StructFieldDesc
- type Time
- type TypeIDer
- type ValueAlarm
- type Writer
Constants ¶
View Source
const ( PVStatus_OK = PVByte(0) PVStatus_WARNING = PVByte(1) PVStatus_ERROR = PVByte(2) PVStatus_FATAL = PVByte(3) )
View Source
const ( NULL_TYPE_CODE = 0xFF ONLY_ID_TYPE_CODE = 0xFE FULL_WITH_ID_TYPE_CODE = 0xFD FULL_TAGGED_ID_TYPE_CODE = 0xFC )
View Source
const ( BOOLEAN = 0x00 BYTE = 0x20 SHORT = 0x21 INT = 0x22 LONG = 0x23 UBYTE = 0x24 USHORT = 0x25 UINT = 0x26 ULONG = 0x27 FLOAT = 0x42 DOUBLE = 0x43 STRING = 0x60 ARRAY_BITS = 0x18 VARIABLE_ARRAY = 0x08 BOUNDED_ARRAY = 0x10 FIXED_ARRAY = 0x18 BOUNDED_STRING = 0x86 STRUCT = 0x80 UNION = 0x81 VARIANT_UNION = 0x82 STRUCT_ARRAY = STRUCT | VARIABLE_ARRAY UNION_ARRAY = UNION | VARIABLE_ARRAY )
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(s *DecoderState, vs ...interface{}) error
func Encode ¶
func Encode(s *EncoderState, vs ...interface{}) error
Encode writes vs to s.Buf. All items in vs must implement PVField or be a pointer to something that can be converted to a PVField.
Types ¶
type Alarm ¶
type AlarmLimit ¶
type AlarmLimit struct { Active PVBoolean `pvaccess:"active"` LowAlarmLimit PVDouble `pvaccess:"lowAlarmLimit"` LowWarningLimit PVDouble `pvaccess:"lowWarningLimit"` HighWarningLimit PVDouble `pvaccess:"highWarningLimit"` HighAlarmLimit PVDouble `pvaccess:"highAlarmLimit"` LowAlarmSeverity PVInt `pvaccess:"lowAlarmSeverity"` LowWarningSeverity PVInt `pvaccess:"lowWarningSeverity"` HighWarningSeverity PVInt `pvaccess:"highWarningSeverity"` HighAlarmSeverity PVInt `pvaccess:"highAlarmSeverity"` Hysteresis PVDouble `pvaccess:"hysteresis"` }
func (AlarmLimit) TypeID ¶
func (AlarmLimit) TypeID() string
type Control ¶
type DecoderState ¶
type DecoderState struct { Buf Reader ByteOrder binary.ByteOrder // contains filtered or unexported fields }
func (*DecoderState) PushReader ¶
func (s *DecoderState) PushReader(r Reader) func()
func (*DecoderState) ReadUint16 ¶
func (s *DecoderState) ReadUint16() (uint16, error)
func (*DecoderState) ReadUint32 ¶
func (s *DecoderState) ReadUint32() (uint32, error)
func (*DecoderState) ReadUint64 ¶
func (s *DecoderState) ReadUint64() (uint64, error)
type Display ¶
type EncoderState ¶
type EncoderState struct { Buf Writer ByteOrder binary.ByteOrder // contains filtered or unexported fields }
func (*EncoderState) PushWriter ¶
func (s *EncoderState) PushWriter(w Writer) func()
func (*EncoderState) WriteUint16 ¶
func (s *EncoderState) WriteUint16(v uint16) error
func (*EncoderState) WriteUint32 ¶
func (s *EncoderState) WriteUint32(v uint32) error
func (*EncoderState) WriteUint64 ¶
func (s *EncoderState) WriteUint64(v uint64) error
type FieldDesc ¶
type FieldDesc struct { // TypeCode represents the real FieldDesc, or NULL_TYPE_CODE // The other special codes will be inferred from HasID, HasTag TypeCode byte HasID, HasTag bool ID PVUShort Tag PVInt // FIXME: Figure out size of tag Size PVSize StructType PVString Fields []StructFieldDesc }
func (*FieldDesc) PVDecode ¶
func (f *FieldDesc) PVDecode(s *DecoderState) error
func (*FieldDesc) PVEncode ¶
func (f *FieldDesc) PVEncode(s *EncoderState) error
type FieldDescer ¶
type PVAny ¶
type PVAny struct {
Data PVField
}
PVAny is a variant union, encoded as a field description, followed by data
func (*PVAny) PVDecode ¶
func (v *PVAny) PVDecode(s *DecoderState) error
func (*PVAny) PVEncode ¶
func (v *PVAny) PVEncode(s *EncoderState) error
PVEncode outputs a field description followed by the serialized field. As a special case, encoding a nil PVAny pointer will output zero bytes.
type PVArray ¶
type PVArray struct {
// contains filtered or unexported fields
}
func NewPVFixedArray ¶
func NewPVFixedArray(slicePtr interface{}) PVArray
func (PVArray) PVDecode ¶
func (a PVArray) PVDecode(s *DecoderState) error
func (PVArray) PVEncode ¶
func (a PVArray) PVEncode(s *EncoderState) error
type PVBitSet ¶
type PVBitSet struct {
Present []bool
}
BitSet type
func NewBitSetWithBits ¶
func (*PVBitSet) PVDecode ¶
func (bs *PVBitSet) PVDecode(s *DecoderState) error
func (PVBitSet) PVEncode ¶
func (bs PVBitSet) PVEncode(s *EncoderState) error
type PVBoolean ¶
type PVBoolean bool
func (*PVBoolean) PVDecode ¶
func (v *PVBoolean) PVDecode(s *DecoderState) error
func (PVBoolean) PVEncode ¶
func (v PVBoolean) PVEncode(s *EncoderState) error
type PVBoundedString ¶
func (PVBoundedString) FieldDesc ¶
func (v PVBoundedString) FieldDesc() (FieldDesc, error)
func (PVBoundedString) PVEncode ¶
func (v PVBoundedString) PVEncode(s *EncoderState) error
type PVByte ¶
type PVByte int8
func (*PVByte) PVDecode ¶
func (v *PVByte) PVDecode(s *DecoderState) error
func (PVByte) PVEncode ¶
func (v PVByte) PVEncode(s *EncoderState) error
type PVDouble ¶
type PVDouble float64
func (*PVDouble) PVDecode ¶
func (v *PVDouble) PVDecode(s *DecoderState) error
func (PVDouble) PVEncode ¶
func (v PVDouble) PVEncode(s *EncoderState) error
type PVField ¶
type PVField interface { PVEncode(s *EncoderState) error PVDecode(s *DecoderState) error }
type PVFloat ¶
type PVFloat float32
func (*PVFloat) PVDecode ¶
func (v *PVFloat) PVDecode(s *DecoderState) error
func (PVFloat) PVEncode ¶
func (v PVFloat) PVEncode(s *EncoderState) error
type PVInt ¶
type PVInt int32
func (*PVInt) PVDecode ¶
func (v *PVInt) PVDecode(s *DecoderState) error
func (PVInt) PVEncode ¶
func (v PVInt) PVEncode(s *EncoderState) error
type PVLong ¶
type PVLong int64
func (*PVLong) PVDecode ¶
func (v *PVLong) PVDecode(s *DecoderState) error
func (PVLong) PVEncode ¶
func (v PVLong) PVEncode(s *EncoderState) error
type PVShort ¶
type PVShort int16
func (*PVShort) PVDecode ¶
func (v *PVShort) PVDecode(s *DecoderState) error
func (PVShort) PVEncode ¶
func (v PVShort) PVEncode(s *EncoderState) error
type PVSize ¶
type PVSize int64
func (*PVSize) PVDecode ¶
func (v *PVSize) PVDecode(s *DecoderState) error
func (PVSize) PVEncode ¶
func (v PVSize) PVEncode(s *EncoderState) error
type PVStatus ¶
func (*PVStatus) PVDecode ¶
func (v *PVStatus) PVDecode(s *DecoderState) error
func (*PVStatus) PVEncode ¶
func (v *PVStatus) PVEncode(s *EncoderState) error
type PVString ¶
type PVString string
String types
func (*PVString) PVDecode ¶
func (v *PVString) PVDecode(s *DecoderState) error
func (PVString) PVEncode ¶
func (v PVString) PVEncode(s *EncoderState) error
type PVStructure ¶
type PVStructure struct { ID string // contains filtered or unexported fields }
func NewPVStructure ¶
func NewPVStructure(data interface{}) (PVStructure, error)
NewPVStructure creates a PVStructure from a pointer to a struct type or a PVStructure.
func (PVStructure) Field ¶
func (v PVStructure) Field(name string) PVField
func (PVStructure) FieldDesc ¶
func (v PVStructure) FieldDesc() (FieldDesc, error)
func (PVStructure) PVDecode ¶
func (v PVStructure) PVDecode(s *DecoderState) error
func (PVStructure) PVEncode ¶
func (v PVStructure) PVEncode(s *EncoderState) error
TODO: Support bitfields for partial pack/unpack
func (PVStructure) String ¶
func (v PVStructure) String() string
func (PVStructure) SubField ¶
func (v PVStructure) SubField(name ...string) PVField
type PVStructureDiff ¶
type PVStructureDiff struct { ChangedBitSet PVBitSet Value interface{} }
func (*PVStructureDiff) PVDecode ¶
func (v *PVStructureDiff) PVDecode(s *DecoderState) error
func (PVStructureDiff) PVEncode ¶
func (v PVStructureDiff) PVEncode(s *EncoderState) error
type PVStructureDiffPut ¶
type PVStructureDiffPut struct { ChangedBitSet PVBitSet Value interface{} }
func (*PVStructureDiffPut) PVDecode ¶
func (v *PVStructureDiffPut) PVDecode(s *DecoderState) error
func (PVStructureDiffPut) PVEncode ¶
func (v PVStructureDiffPut) PVEncode(s *EncoderState) error
type PVUByte ¶
type PVUByte uint8
func (*PVUByte) PVDecode ¶
func (v *PVUByte) PVDecode(s *DecoderState) error
func (PVUByte) PVEncode ¶
func (v PVUByte) PVEncode(s *EncoderState) error
type PVUInt ¶
type PVUInt uint32
func (*PVUInt) PVDecode ¶
func (v *PVUInt) PVDecode(s *DecoderState) error
func (PVUInt) PVEncode ¶
func (v PVUInt) PVEncode(s *EncoderState) error
type PVULong ¶
type PVULong uint64
func (*PVULong) PVDecode ¶
func (v *PVULong) PVDecode(s *DecoderState) error
func (PVULong) PVEncode ¶
func (v PVULong) PVEncode(s *EncoderState) error
type PVUShort ¶
type PVUShort uint16
func (*PVUShort) PVDecode ¶
func (v *PVUShort) PVDecode(s *DecoderState) error
func (PVUShort) PVEncode ¶
func (v PVUShort) PVEncode(s *EncoderState) error
type StructFieldDesc ¶
type Time ¶
func (*Time) PVDecode ¶
func (t *Time) PVDecode(s *DecoderState) error
func (Time) PVEncode ¶
func (t Time) PVEncode(s *EncoderState) error
type ValueAlarm ¶
type ValueAlarm AlarmLimit
valueAlarm_t is used by older PVAccess servers. TODO: The limit fields of ValueAlarm can be any integer or floating point type, not just doubles.
func (ValueAlarm) TypeID ¶
func (ValueAlarm) TypeID() string
type Writer ¶
type Writer interface { io.Writer io.ByteWriter io.StringWriter }
Click to show internal directories.
Click to hide internal directories.