Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToInt16 ¶
BytesToInt16 converts the passed byte slice to a signed 16bit integer
func BytesToUint16 ¶
BytesToUint16 converts the passed byte slice to an unsigned 16bit integer
func Int16ToBytes ¶
Int16ToBytes converts a unsigned 16bit integer to a byte slice
func Uint16ToBytes ¶
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.