Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct {
PayloadLength uint16
ControlCode uint16
SerialNumber uint16
DeviceSN uint32
Payload []byte
}
func (*Frame) MarshalBinary ¶
func (*Frame) UnmarshalBinary ¶
type RequestPayload ¶
type RequestPayload struct {
FrameType uint8
SensorType uint16
DeliveryTime uint32
PowerOnTime uint32
OffsetTime uint32
DeviceAddress uint8
FunctionCode uint8
StartReg uint16
RegCount uint16
}
func NewRequestPayload ¶
func NewRequestPayload(startReg, regCount uint16) *RequestPayload
func (*RequestPayload) MarshalBinary ¶
func (r *RequestPayload) MarshalBinary() ([]byte, error)
type ResponsePayload ¶
type ResponsePayload struct {
FrameType uint8
StatusCode uint8
DeliveryTime uint32
PowerOnTime uint32
OffsetTime uint32
DeviceAddress uint8
FunctionCode uint8
ValueLength uint8
Value []byte
}
func (*ResponsePayload) UnmarshalBinary ¶
func (r *ResponsePayload) UnmarshalBinary(data []byte) error
Click to show internal directories.
Click to hide internal directories.