openenergysolutions/modbus-cpp

Expose max coil/register constants, enforce in API

Closed this issue · 2 comments

Two options for enforcing...

A) throw exception in request constructors, i.e. fail fast
B) check after posting to strand and make error callback

thoughts?

I kind of lean towards A) b/c then you always know these are properly constructed.

Fail fast sound good, but not sure how this relates to automatically combining Modbus adjacent writes or reads with small gaps

We decided to have an error callback so as not to mix error handling paradigms. Nothing else in the library throws an exception in response to a method call.