When including this library in multiple files you get the the following error(s):
(.text+0x0): multiple definition of `Modbus::Modbus(unsigned char, Stream&, unsigned char)'
This is easily solved with the following modifications:
1) Placing a "ifndef" around the header code.
ifndef MODBUS_RTU_H
define MODBUS_RTU_H
....
endif
2) creating a ModbusRtu.cpp file to split definition from declaration.
All code down from the next line must be moved to the .cpp file.
/PUBLIC FUNCTIONS____/
3) and obviously include the header file at the top of the .cpp file. :)
When including this library in multiple files you get the the following error(s):
(.text+0x0): multiple definition of `Modbus::Modbus(unsigned char, Stream&, unsigned char)'
This is easily solved with the following modifications:
1) Placing a "ifndef" around the header code.
ifndef MODBUS_RTU_H
define MODBUS_RTU_H
....
endif
2) creating a ModbusRtu.cpp file to split definition from declaration. All code down from the next line must be moved to the .cpp file. / PUBLIC FUNCTIONS____ /
3) and obviously include the header file at the top of the .cpp file. :)
include