Commonly used modbus host operation functions.
More...
|
int | agile_modbus_serialize_read_bits (agile_modbus_t *ctx, int addr, int nb) |
|
int | agile_modbus_deserialize_read_bits (agile_modbus_t *ctx, int msg_length, uint8_t *dest) |
|
int | agile_modbus_serialize_read_input_bits (agile_modbus_t *ctx, int addr, int nb) |
|
int | agile_modbus_deserialize_read_input_bits (agile_modbus_t *ctx, int msg_length, uint8_t *dest) |
|
int | agile_modbus_serialize_read_registers (agile_modbus_t *ctx, int addr, int nb) |
|
int | agile_modbus_deserialize_read_registers (agile_modbus_t *ctx, int msg_length, uint16_t *dest) |
|
int | agile_modbus_serialize_read_input_registers (agile_modbus_t *ctx, int addr, int nb) |
|
int | agile_modbus_deserialize_read_input_registers (agile_modbus_t *ctx, int msg_length, uint16_t *dest) |
|
int | agile_modbus_serialize_write_bit (agile_modbus_t *ctx, int addr, int status) |
|
int | agile_modbus_deserialize_write_bit (agile_modbus_t *ctx, int msg_length) |
|
int | agile_modbus_serialize_write_register (agile_modbus_t *ctx, int addr, const uint16_t value) |
|
int | agile_modbus_deserialize_write_register (agile_modbus_t *ctx, int msg_length) |
|
int | agile_modbus_serialize_write_bits (agile_modbus_t *ctx, int addr, int nb, const uint8_t *src) |
|
int | agile_modbus_deserialize_write_bits (agile_modbus_t *ctx, int msg_length) |
|
int | agile_modbus_serialize_write_registers (agile_modbus_t *ctx, int addr, int nb, const uint16_t *src) |
|
int | agile_modbus_deserialize_write_registers (agile_modbus_t *ctx, int msg_length) |
|
int | agile_modbus_serialize_mask_write_register (agile_modbus_t *ctx, int addr, uint16_t and_mask, uint16_t or_mask) |
|
int | agile_modbus_deserialize_mask_write_register (agile_modbus_t *ctx, int msg_length) |
|
int | agile_modbus_serialize_write_and_read_registers (agile_modbus_t *ctx, int write_addr, int write_nb, const uint16_t *src, int read_addr, int read_nb) |
|
int | agile_modbus_deserialize_write_and_read_registers (agile_modbus_t *ctx, int msg_length, uint16_t *dest) |
|
int | agile_modbus_serialize_report_slave_id (agile_modbus_t *ctx) |
|
int | agile_modbus_deserialize_report_slave_id (agile_modbus_t *ctx, int msg_length, int max_dest, uint8_t *dest) |
|
Commonly used modbus host operation functions.
The API form is as follows:
- agile_modbus_serialize_xxx package request data
return value:
>0: Request data length
Others: Abnormal
- agile_modbus_deserialize_xxx parses response data
return value:
>=0: The length of the corresponding function code response object (such as 03 function code, the value represents the number of registers)
Others: exception (-1: message error; others: exception code can be obtained according to `-128 -$return value`)
◆ agile_modbus_serialize_read_bits()
int agile_modbus_serialize_read_bits |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
nb |
|
) |
| |
◆ agile_modbus_deserialize_read_bits()
int agile_modbus_deserialize_read_bits |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length, |
|
|
uint8_t * |
dest |
|
) |
| |
◆ agile_modbus_serialize_read_input_bits()
int agile_modbus_serialize_read_input_bits |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
nb |
|
) |
| |
◆ agile_modbus_deserialize_read_input_bits()
int agile_modbus_deserialize_read_input_bits |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length, |
|
|
uint8_t * |
dest |
|
) |
| |
◆ agile_modbus_serialize_read_registers()
int agile_modbus_serialize_read_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
nb |
|
) |
| |
◆ agile_modbus_deserialize_read_registers()
int agile_modbus_deserialize_read_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length, |
|
|
uint16_t * |
dest |
|
) |
| |
◆ agile_modbus_serialize_read_input_registers()
int agile_modbus_serialize_read_input_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
nb |
|
) |
| |
◆ agile_modbus_deserialize_read_input_registers()
int agile_modbus_deserialize_read_input_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length, |
|
|
uint16_t * |
dest |
|
) |
| |
◆ agile_modbus_serialize_write_bit()
int agile_modbus_serialize_write_bit |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
status |
|
) |
| |
◆ agile_modbus_deserialize_write_bit()
int agile_modbus_deserialize_write_bit |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length |
|
) |
| |
◆ agile_modbus_serialize_write_register()
int agile_modbus_serialize_write_register |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
const uint16_t |
value |
|
) |
| |
◆ agile_modbus_deserialize_write_register()
int agile_modbus_deserialize_write_register |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length |
|
) |
| |
◆ agile_modbus_serialize_write_bits()
int agile_modbus_serialize_write_bits |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
nb, |
|
|
const uint8_t * |
src |
|
) |
| |
◆ agile_modbus_deserialize_write_bits()
int agile_modbus_deserialize_write_bits |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length |
|
) |
| |
◆ agile_modbus_serialize_write_registers()
int agile_modbus_serialize_write_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
int |
nb, |
|
|
const uint16_t * |
src |
|
) |
| |
◆ agile_modbus_deserialize_write_registers()
int agile_modbus_deserialize_write_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length |
|
) |
| |
◆ agile_modbus_serialize_mask_write_register()
int agile_modbus_serialize_mask_write_register |
( |
agile_modbus_t * |
ctx, |
|
|
int |
addr, |
|
|
uint16_t |
and_mask, |
|
|
uint16_t |
or_mask |
|
) |
| |
◆ agile_modbus_deserialize_mask_write_register()
int agile_modbus_deserialize_mask_write_register |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length |
|
) |
| |
◆ agile_modbus_serialize_write_and_read_registers()
int agile_modbus_serialize_write_and_read_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
write_addr, |
|
|
int |
write_nb, |
|
|
const uint16_t * |
src, |
|
|
int |
read_addr, |
|
|
int |
read_nb |
|
) |
| |
◆ agile_modbus_deserialize_write_and_read_registers()
int agile_modbus_deserialize_write_and_read_registers |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length, |
|
|
uint16_t * |
dest |
|
) |
| |
◆ agile_modbus_serialize_report_slave_id()
◆ agile_modbus_deserialize_report_slave_id()
int agile_modbus_deserialize_report_slave_id |
( |
agile_modbus_t * |
ctx, |
|
|
int |
msg_length, |
|
|
int |
max_dest, |
|
|
uint8_t * |
dest |
|
) |
| |