func (f FunctionCode) Valid() bool {
	return (f > 0 && f < 7) || (f > 14 && f < 17)  
}
Valid test if FunctionCode is a supported function, and not an error response.
package modbusone
import (
	"fmt"
	"io"
)
type Server interface {
	Serve(handler ProtocolHandler) error
}
type ServerCloser interface {
	Server
	io.Closer
}
type ProtocalHandler = ProtocolHandler
type ProtocolHandler interface {
	OnWrite(req PDU, data []byte) error
	OnRead(req PDU) (data []byte, err error)
	OnError(req PDU, errRep PDU)
}
type FunctionCode byte
const (
	FcReadCoils              FunctionCode = 1
	FcReadDiscreteInputs     FunctionCode = 2
	FcReadHoldingRegisters   FunctionCode = 3
	FcReadInputRegisters     FunctionCode = 4
	FcWriteSingleCoil        FunctionCode = 5
	FcWriteSingleRegister    FunctionCode = 6
	FcWriteMultipleCoils     FunctionCode = 15
	FcWriteMultipleRegisters FunctionCode = 16
)