In TCP server implementation, how to find whether the function code was 6 or 16 (0x10)? And how to respond to it specifically?
type HoldingRegistersRequest struct {
ClientAddr string // the source (client) IP address
ClientRole string // the client role as encoded in the client certificate (tcp+tls only)
UnitId uint8 // the requested unit id (slave id)
Addr uint16 // the base register address requested
Quantity uint16 // the number of consecutive registers covered by this request
IsWrite bool // true if the request is a write, false if a read
Args []uint16 // a slice of register values to be set, ordered from
// Addr to Addr + Quantity - 1 (for writes only)
}
In TCP server implementation, how to find whether the function code was 6 or 16 (0x10)? And how to respond to it specifically?