modbus-arduino  1.0.0
Modbus library for Arduino
ModbusIP_ENC28J60.h
1 /*
2  ModbusIP_ENC28J60.h - Header for Modbus IP ENC28J60 Library
3  Copyright (C) 2015 AndrĂ© Sarmento Barbosa
4 */
5 #include <Arduino.h>
6 #include <Modbus.h>
7 #include <EtherCard.h>
8 
9 #ifndef MODBUSIP_ENC28J60_H
10 #define MODBUSIP_ENC28J60_H
11 
12 #define MODBUSIP_PORT 502
13 #define MODBUSIP_MAXFRAME 200
14 #define ENC28J60_CS 10
15 //#define TCP_KEEP_ALIVE
16 
21 class ModbusIP : public Modbus {
22 #ifndef __DOXYGEN__
23  private:
24  byte _MBAP[7];
25 #endif
26 
27  public:
31  ModbusIP();
39  void config(uint8_t *mac);
48  void config(uint8_t *mac, IPAddress ip);
59  void config(uint8_t *mac, IPAddress ip, IPAddress dns);
72  void config(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway);
86  void config(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway, IPAddress subnet);
92  void task();
93 };
94 
95 #endif //MODBUSIP_ENC28J60_H
96 
Modbus over TCP/IP network Class for Arduino Ethernet shield.
Definition: ModbusIP.h:22
ModbusIP()
Default constructor.
void config(uint8_t *mac)
Connect a ModbusIP object to a network.
void task()
Task that performs all operations on MODBUS.
Modbus base class.
Definition: Modbus.h:53