BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/src/main.cpp File Reference
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
main.cpp File Reference

This main is an example-implementation of a simple modbus-messenger to demonstrate the usage of a layer-7-service in the program. The String typed in by the user via serial-interface is sent to the device with PARTNER_DEVICE_ID. All received Messages and raised errors are displayed on serial-monitor. Switch PARTNER_DEVICE_ID and DEVICE_ID before uploading to the Partner-device. More...

Include dependency graph for main.cpp:

Macros

#define DEBUG
 
#define DEVICE_ID   'A'
 
#define PARTNER_DEVICE_ID   'B'
 
#define BAUDRATE   9600
 
#define RX   2
 
#define TX   3
 

Functions

int main ()
 

Variables

SoftwareSerial serialInterface (RX, TX)
 
MessageService msgService (DEVICE_ID)
 
ErrorService errService (DEVICE_ID)
 
ServiceBaseserviceList [2] = {&msgService, &errService}
 
ServiceCluster< 2 > services (serviceList)
 

Detailed Description

This main is an example-implementation of a simple modbus-messenger to demonstrate the usage of a layer-7-service in the program. The String typed in by the user via serial-interface is sent to the device with PARTNER_DEVICE_ID. All received Messages and raised errors are displayed on serial-monitor. Switch PARTNER_DEVICE_ID and DEVICE_ID before uploading to the Partner-device.

Author
Felix Schuelke (flxsc.nosp@m.ode@.nosp@m.gmail.nosp@m..com)
Version
0.1
Date
2024-08-18

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.