Documentation ¶
Index ¶
- type AppDataTypeMismatch
- type Decoder
- func (d *Decoder) AppData(v interface{})
- func (d *Decoder) ContextAbstractType(expectedTagNumber byte, v interface{})
- func (d *Decoder) ContextObjectID(expectedTagID byte, objectID *bacnet.ObjectID)
- func (d *Decoder) ContextValue(expectedTagID byte, val *uint32)
- func (d *Decoder) Error() error
- func (d *Decoder) ResetError()
- type Encoder
- func (e *Encoder) AppData(v interface{})
- func (e *Encoder) Bytes() []byte
- func (e *Encoder) ContextAsbtractType(tabNumber byte, v bacnet.PropertyValue)
- func (e *Encoder) ContextObjectID(tabNumber byte, objectID bacnet.ObjectID)
- func (e *Encoder) ContextUnsigned(tabNumber byte, value uint32)
- func (e *Encoder) Error() error
- type ErrorIncorrectTagID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppDataTypeMismatch ¶
type AppDataTypeMismatch struct {
// contains filtered or unexported fields
}
func (AppDataTypeMismatch) Error ¶
func (e AppDataTypeMismatch) Error() string
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is the struct used to turn byte arrays to bacnet types. All public methods of decoder can set the internal error value. If such error is set, all decoding methods will be no-ops. This allows to defer error checking after several decoding operations
func NewDecoder ¶
func (*Decoder) AppData ¶
func (d *Decoder) AppData(v interface{})
AppData read the next tag and value. The value type advertised in tag must be a standard bacnet application data type and must match the type passed in the v parameter. If no error is returned, v will contain the data read
func (*Decoder) ContextAbstractType ¶
func (*Decoder) ContextObjectID ¶
ContextObjectID read a (context)tag / value pair where the value type is an unsigned int If ErrorIncorrectTag is set, the internal buffer cursor is ready to read again the same tag.
func (*Decoder) ContextValue ¶
ContextValue reads the next context tag/value couple and set val accordingly. Sets the decoder error if the tagID isn't the expected or if the tag isn't contextual. If ErrorIncorrectTag is set, the internal buffer cursor is ready to read again the same tag.
func (*Decoder) ResetError ¶
func (d *Decoder) ResetError()
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is the struct used to turn bacnet types to byte arrays. All public methods of encoder can set the internal error value. If such error is set, all encoding methods will be no-ops. This allows to defer error checking after several encoding operations
func NewEncoder ¶
func NewEncoder() Encoder
func (*Encoder) AppData ¶
func (e *Encoder) AppData(v interface{})
AppData writes a tag and value of any standard bacnet application data type. Returns an error if v if of a invalid type
func (*Encoder) ContextAsbtractType ¶
func (e *Encoder) ContextAsbtractType(tabNumber byte, v bacnet.PropertyValue)
func (*Encoder) ContextObjectID ¶
ContextObjectID write a (context)tag / value pair where the value type is an unsigned int
func (*Encoder) ContextUnsigned ¶
ContextUnsigned write a (context)tag / value pair where the value type is an unsigned int
type ErrorIncorrectTagID ¶
ErrorIncorrectTagID is the error return when the decoded tag doesn't have the expected ID
func (ErrorIncorrectTagID) Error ¶
func (e ErrorIncorrectTagID) Error() string