Agile Modbus
1.1.4
Lightweight modbus protocol stack.
|
Functions | |
void | agile_modbus_common_init (agile_modbus_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz) |
initialize modbus handle More... | |
int | agile_modbus_set_slave (agile_modbus_t *ctx, int slave) |
set address More... | |
void | agile_modbus_set_compute_meta_length_after_function_cb (agile_modbus_t *ctx, uint8_t(*cb)(agile_modbus_t *ctx, int function, agile_modbus_msg_type_t msg_type)) |
sets the data element length callback function to be received after calculating the function code of the modbus object More... | |
void | agile_modbus_set_compute_data_length_after_meta_cb (agile_modbus_t *ctx, int(*cb)(agile_modbus_t *ctx, uint8_t *msg, int msg_length, agile_modbus_msg_type_t msg_type)) |
sets the data length callback function to be received after calculating the data element of the modbus object More... | |
int | agile_modbus_receive_judge (agile_modbus_t *ctx, int msg_length, agile_modbus_msg_type_t msg_type) |
Verify the correctness of received data. More... | |
void agile_modbus_common_init | ( | agile_modbus_t * | ctx, |
uint8_t * | send_buf, | ||
int | send_bufsz, | ||
uint8_t * | read_buf, | ||
int | read_bufsz | ||
) |
initialize modbus handle
ctx | modbus handle |
send_buf | send buffer |
send_bufsz | send buffer size |
read_buf | receive buffer |
read_bufsz | receive buffer size |
Definition at line 257 of file agile_modbus.c.
int agile_modbus_set_slave | ( | agile_modbus_t * | ctx, |
int | slave | ||
) |
set address
ctx | modbus handle |
slave | address |
Definition at line 273 of file agile_modbus.c.
void agile_modbus_set_compute_meta_length_after_function_cb | ( | agile_modbus_t * | ctx, |
uint8_t(*)(agile_modbus_t *ctx, int function, agile_modbus_msg_type_t msg_type) | cb | ||
) |
sets the data element length callback function to be received after calculating the function code of the modbus object
ctx | modbus handle |
cb | callback function of the data element length to be received after calculating the function code |
Definition at line 284 of file agile_modbus.c.
void agile_modbus_set_compute_data_length_after_meta_cb | ( | agile_modbus_t * | ctx, |
int(*)(agile_modbus_t *ctx, uint8_t *msg, int msg_length, agile_modbus_msg_type_t msg_type) | cb | ||
) |
sets the data length callback function to be received after calculating the data element of the modbus object
ctx | modbus handle |
cb | The data length callback function to be received after calculating the data element |
Definition at line 297 of file agile_modbus.c.
int agile_modbus_receive_judge | ( | agile_modbus_t * | ctx, |
int | msg_length, | ||
agile_modbus_msg_type_t | msg_type | ||
) |
Verify the correctness of received data.
ctx | modbus handle |
msg_length | received data length |
msg_type | message type |
Definition at line 312 of file agile_modbus.c.