14 #ifndef __PKG_AGILE_MODBUS_SLAVE_UTIL_H
15 #define __PKG_AGILE_MODBUS_SLAVE_UTIL_H
41 int (*
get)(
void *buf,
int bufsz);
42 int (*
set)(
int index,
int len,
void *buf,
int bufsz);
int agile_modbus_slave_util_callback(agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info, const void *data)
Slave callback function.
struct agile_modbus_slave_util agile_modbus_slave_util_t
slave function structure
struct agile_modbus_slave_util_map agile_modbus_slave_util_map_t
slave register mapping structure
Agile Modbus slave information structure.
slave register mapping structure
int(* get)(void *buf, int bufsz)
Get register data interface.
int start_addr
Start address.
int(* set)(int index, int len, void *buf, int bufsz)
Set register data interface.
int(* addr_check)(agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info)
Address checking interface.
int nb_input_registers
Input register definition array number.
int nb_bits
The number of coil register definition arrays.
const agile_modbus_slave_util_map_t * tab_input_registers
Input register definition array.
int(* special_function)(agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info)
Special function code processing interface.
int nb_input_bits
The number of discrete input register definition arrays.
const agile_modbus_slave_util_map_t * tab_input_bits
Discrete input register definition array.
int(* done)(agile_modbus_t *ctx, struct agile_modbus_slave_info *slave_info, int ret)
Processing end interface.
int nb_registers
Number of holding register definition arrays.
const agile_modbus_slave_util_map_t * tab_bits
Coil register definition array.
const agile_modbus_slave_util_map_t * tab_registers
Holding register definition array.