Improve the Modbus TCP server
The 'modbus_tcp.c' file has been extensively rewritten to handle parsing TCP Application Data Units (ADUs), handling incoming Modbus requests, and generating appropriate responses. The modbus tcp server now interacts better with the LWIP TCP functionality, due to better utilization of the callback functions. temp: modbus refactor
This commit is contained in:
@@ -1,27 +1,20 @@
|
||||
/**
|
||||
* @file modbus_tcp.h
|
||||
*
|
||||
* @brief TCP Modbus handler
|
||||
* @date Nov 6, 2023
|
||||
* @brief TCP Modbus server
|
||||
* @date Nov 29, 2023
|
||||
* @author Obe
|
||||
* @author Lorenz C.
|
||||
*/
|
||||
|
||||
#ifndef INC_MODBUS_H_
|
||||
#define INC_MODBUS_H_
|
||||
|
||||
#define MODBUSPORT 502 // 502 is the default
|
||||
#define MODBUS_TCP_PORT 502
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <tcp.h>
|
||||
#include "lcd_api.h"
|
||||
#include "llfs.h"
|
||||
|
||||
/**
|
||||
* @fn void modbus_init
|
||||
* @brief Initializes the modbus tcp
|
||||
* @brief Initializes the modbus tcp server
|
||||
*/
|
||||
void modbus_init(void);
|
||||
void modbus_tcp_init(void);
|
||||
|
||||
#endif /* INC_MODBUS_H_ */
|
||||
|
||||
Reference in New Issue
Block a user