Agile Modbus  1.1.4
Lightweight modbus protocol stack.
agile_modbus_tcp.h
Go to the documentation of this file.
1 
14 #ifndef __PKG_AGILE_MODBUS_TCP_H
15 #define __PKG_AGILE_MODBUS_TCP_H
16 
17 #if AGILE_MODBUS_USING_TCP
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include <stdint.h>
24 
32 #define AGILE_MODBUS_TCP_HEADER_LENGTH 7
33 #define AGILE_MODBUS_TCP_PRESET_REQ_LENGTH 12
34 #define AGILE_MODBUS_TCP_PRESET_RSP_LENGTH 8
35 
36 #define AGILE_MODBUS_TCP_CHECKSUM_LENGTH 0
37 
45 #define AGILE_MODBUS_TCP_MAX_ADU_LENGTH 260
57 typedef struct agile_modbus_tcp {
59  uint16_t t_id;
64 
72 int agile_modbus_tcp_init(agile_modbus_tcp_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz);
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* AGILE_MODBUS_USING_TCP */
86 
87 #endif /* __PKG_AGILE_MODBUS_TCP_H */
int agile_modbus_tcp_init(agile_modbus_tcp_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz)
TCP initialization.
struct agile_modbus_tcp agile_modbus_tcp_t
TCP structure.
TCP structure.
agile_modbus_t _ctx
modbus handle
uint16_t t_id
Extract from MODBUS Messaging on TCP/IP Implementation Guide V1.0b (page 23/46): The transaction iden...
Agile Modbus structure.
Definition: agile_modbus.h:217