Agile Modbus  1.1.4
Lightweight modbus protocol stack.
agile_modbus_rtu.h
Go to the documentation of this file.
1 
14 #ifndef __PKG_AGILE_MODBUS_RTU_H
15 #define __PKG_AGILE_MODBUS_RTU_H
16 
17 #if AGILE_MODBUS_USING_RTU
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include <stdint.h>
24 
32 #define AGILE_MODBUS_RTU_HEADER_LENGTH 1
33 #define AGILE_MODBUS_RTU_PRESET_REQ_LENGTH 6
34 #define AGILE_MODBUS_RTU_PRESET_RSP_LENGTH 2
35 
36 #define AGILE_MODBUS_RTU_CHECKSUM_LENGTH 2
37 
45 #define AGILE_MODBUS_RTU_MAX_ADU_LENGTH 256
57 typedef struct agile_modbus_rtu {
60 
68 int agile_modbus_rtu_init(agile_modbus_rtu_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz);
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* AGILE_MODBUS_USING_RTU */
82 
83 #endif /* __PKG_AGILE_MODBUS_RTU_H */
int agile_modbus_rtu_init(agile_modbus_rtu_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz)
RTU initialization.
struct agile_modbus_rtu agile_modbus_rtu_t
RTU structure.
RTU structure.
agile_modbus_t _ctx
modbus handle
Agile Modbus structure.
Definition: agile_modbus.h:217