Documentation ¶
Index ¶
Constants ¶
View Source
const ( S7_PROTOCOL_ID = byte(0x32) S7_REQUEST_ID = uint16(0) S7_REQUEST = byte(0x01) S7_REQUEST_USER_DATA = byte(0x07) S7_ACKNOWLEDGEMENT = byte(0x02) S7_RESPONSE = byte(0x03) S7_SZL_REQUEST = byte(0x04) S7_SZL_FUNCTIONS = byte(0x04) S7_SZL_READ = byte(0x01) S7_SZL_MODULE_IDENTIFICATION = uint16(0x11) S7_SZL_COMPONENT_IDENTIFICATION = uint16(0x1c) S7_DATA_BYTE_OFFSET = 12 // offset for real data )
Variables ¶
View Source
var (
S7_ERROR_CODES = map[uint32]string{
0x05: "Address error",
0x0a: "Item not available",
0x8104: "Context not supported",
0x8500: "Wrong PDU size",
}
)
Functions ¶
Types ¶
type COTPConnectionPacket ¶
type COTPConnectionPacket struct { DestinationRef uint16 SourceRef uint16 DestinationTSAP uint16 SourceTSAP uint16 TPDUSize byte }
func (*COTPConnectionPacket) Marshal ¶
func (cotpConnPacket *COTPConnectionPacket) Marshal() ([]byte, error)
Encodes a COTPConnectionPacket to binary
func (*COTPConnectionPacket) Unmarshal ¶
func (cotpConnPacket *COTPConnectionPacket) Unmarshal(bytes []byte) error
Decodes a COTPConnectionPacket from binary that must be a connection confirmation
type COTPDataPacket ¶
type COTPDataPacket struct {
Data []byte
}
func (*COTPDataPacket) Marshal ¶
func (cotpDataPacket *COTPDataPacket) Marshal() ([]byte, error)
Encodes a COTPDataPacket to binary
func (*COTPDataPacket) Unmarshal ¶
func (cotpDataPacket *COTPDataPacket) Unmarshal(bytes []byte) error
Decodes a COTPDataPacket from binary
type S7Log ¶
type S7Log struct { IsS7 bool `json:"is_s7"` System string `json:"system,omitempty"` Module string `json:"module,omitempty"` PlantId string `json:"plant_id,omitempty"` Copyright string `json:"copyright,omitempty"` SerialNumber string `json:"serial_number,omitempty"` ReservedForOS string `json:"reserved_for_os,omitempty"` ModuleType string `json:"module_type,omitempty"` MemorySerialNumber string `json:"memory_serial_number,omitempty"` CpuProfile string `json:"cpu_profile,omitempty"` OEMId string `json:"oem_id,omitempty"` Location string `json:"location,omitempty"` ModuleId string `json:"module_id,omitempty"` Hardware string `json:"hardware,omitempty"` Firmware string `json:"firmware,omitempty"` }
type TPKTPacket ¶
type TPKTPacket struct {
Data []byte
}
func (*TPKTPacket) Marshal ¶
func (tpktPacket *TPKTPacket) Marshal() ([]byte, error)
Encodes a TPKTPacket to binary
func (*TPKTPacket) Unmarshal ¶
func (tpktPacket *TPKTPacket) Unmarshal(bytes []byte) error
Decodes a TPKTPacket from binary
Click to show internal directories.
Click to hide internal directories.