yaacov / ArduinoModbusSlave

Modbus slave library for Arduino
ISC License
205 stars 75 forks source link

Issue #74 Enable / disable communication #77

Closed cvanbrederode closed 3 years ago

cvanbrederode commented 3 years ago

Created a new private variable: bool _enabled and two methods to change (enable() and disable()), as well as one to check the status (readEnabled()).

poll() checks the status of _enable, just before validating the request. If enable is not true, the function returns without processing the request.

Tested as working.

yaacov commented 3 years ago

Thanks :green_heart:

yaacov commented 3 years ago

fixes #74