diff --git a/library.json b/library.json index 2a69f69..e0d0fdc 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SensorModbusMaster", - "version": "0.1.0", + "version": "0.1.2", "keywords": "sensor, modbus", "description": "Arduino library for communicating via modbus with the Arduino acting as master", "repository": diff --git a/library.properties b/library.properties index b043b30..54d05f1 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SensorModbusMaster -version=0.1.0 +version=0.1.2 author=Sara Damiano maintainer=Sara Damiano sentence=Arduino library for communicating via modbus with the Arduino acting as master diff --git a/src/SensorModbusMaster.h b/src/SensorModbusMaster.h index b3f2e99..1380409 100644 --- a/src/SensorModbusMaster.h +++ b/src/SensorModbusMaster.h @@ -141,6 +141,12 @@ class modbusMaster void stopDebugging(void){_debugStream = &nullstream;} + // This needs to be bigger than the largest response + // For 8 parameters with 8 registers each: + // 64 registers * 2 bytes per register + 5 frame bytes + static byte responseBuffer[RESPONSE_BUFFER_SIZE]; + + //---------------------------------------------------------------------------- // PRIVATE FUNCTIONS @@ -194,10 +200,6 @@ void printFrameHex(byte modbusFrame[], int frameLength); NullStream nullstream; Stream *_debugStream = &nullstream; // The stream instance (serial port) for debugging - // This needs to be bigger than the largest response - // For 8 parameters with 8 registers each: - // 64 registers * 2 bytes per register + 5 frame bytes - static byte responseBuffer[RESPONSE_BUFFER_SIZE]; static byte crcFrame[2]; // The modbus protocol defines that there can be no more than 1.5 characters