fieldbus

package
v0.0.0-...-475e089 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt16

func BytesToInt16(b []byte) int16

BytesToInt16 converts the passed byte slice to a signed 16bit integer

func BytesToUint16

func BytesToUint16(b []byte) uint16

BytesToUint16 converts the passed byte slice to an unsigned 16bit integer

func Int16ToBytes

func Int16ToBytes(u int16) []byte

Int16ToBytes converts a unsigned 16bit integer to a byte slice

func Uint16ToBytes

func Uint16ToBytes(u uint16) []byte

Uint16ToBytes converts a unsigned 16bit integer to a byte slice

Types

type GenericModbusService

type GenericModbusService struct {
	// contains filtered or unexported fields
}

GenericModbusService implements core modbus services that are utilized by both TCP and RTU implementations

type ModbusTCPService

type ModbusTCPService struct {
	common.Service
	GenericModbusService

	StartDelay time.Duration // Duration to delay prior to starting the service
	LogFunc    func(string)  // Destination for logging
	// contains filtered or unexported fields
}

ModbusTCPService provides access to configured modbus tcp interfaces.

func (*ModbusTCPService) Serve

func (svc *ModbusTCPService) Serve()

Serve is called by this service's supervisor—it should not be called directly. Exiting or panicing from this function will force the supervisor to attempt to restart.

func (*ModbusTCPService) State

func (svc *ModbusTCPService) State() int

State returns the state of service

func (*ModbusTCPService) Stop

func (svc *ModbusTCPService) Stop()

Stop is called by a supervisor to signal that the service should be stopped. Every effort should be made to clean up resources and put the service in a state in which it could be restarted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL