debevv / nanoMODBUS

A compact MODBUS RTU/TCP C library for embedded/microcontrollers
MIT License
234 stars 47 forks source link

Add nmbs_read_single_register #42

Closed eNovware closed 6 months ago

eNovware commented 6 months ago

it should be nice to include a nmbs_read_single_register, exactly like nmbs_write_single_register. thanks.

debevv commented 6 months ago

Hi, nmbs_read_single_register does not exist because the API is meant to reflect 1:1 the function codes found in the official modbus spec. The spec effectively presents a bit of asymmetry between the read/write FCs, but I prefer the API to be coherent, at least for the "core" ones.

eNovware commented 6 months ago

OK, got it. Thanks for the answer. Thanks for this library.