35 if (mb_mapping == NULL) {
36 fprintf(stderr,
"Failed to allocate the mapping: %s\n",
modbus_mapping_t * modbus_mapping_new(int nb_coil_status, int nb_input_status, int nb_holding_registers, int nb_input_registers)
int modbus_receive(modbus_t *ctx, uint8_t *req)
#define MODBUS_TCP_MAX_ADU_LENGTH
void modbus_free(modbus_t *ctx)
void modbus_close(modbus_t *ctx)
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping)
int modbus_tcp_accept(modbus_t *ctx, int *socket)
int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
const char * modbus_strerror(int errnum)
void modbus_mapping_free(modbus_mapping_t *mb_mapping)
modbus_mapping_t * mb_mapping
modbus_t * modbus_new_tcp(const char *ip_address, int port)