#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include "libmodbus/modbus-private.h"
#include "libmodbus/modbus-rtu.h"
#include "libmodbus/modbus-rtu-private.h"
Go to the source code of this file.
Functions | |
static int | _modbus_rtu_build_request_basis (modbus_t *ctx, int function, int addr, int nb, uint8_t *req) |
static int | _modbus_rtu_build_response_basis (sft_t *sft, uint8_t *rsp) |
int | _modbus_rtu_check_integrity (modbus_t *ctx, uint8_t *msg, const int msg_length) |
void | _modbus_rtu_close (modbus_t *ctx) |
static int | _modbus_rtu_connect (modbus_t *ctx) |
int | _modbus_rtu_filter_request (modbus_t *ctx, int slave) |
int | _modbus_rtu_flush (modbus_t *) |
int | _modbus_rtu_prepare_response_tid (const uint8_t *req, int *req_length) |
ssize_t | _modbus_rtu_recv (modbus_t *ctx, uint8_t *rsp, int rsp_length) |
int | _modbus_rtu_select (modbus_t *ctx, fd_set *rfds, struct timeval *tv, int length_to_read) |
ssize_t | _modbus_rtu_send (modbus_t *ctx, const uint8_t *req, int req_length) |
int | _modbus_rtu_send_msg_pre (uint8_t *req, int req_length) |
static int | _modbus_set_slave (modbus_t *ctx, int slave) |
static uint16_t | crc16 (uint8_t *buffer, uint16_t buffer_length) |
modbus_t * | modbus_new_rtu (const char *device, int baud, char parity, int data_bit, int stop_bit) |
int | modbus_rtu_get_serial_mode (modbus_t *ctx) |
int | modbus_rtu_set_serial_mode (modbus_t *ctx, int mode) |
Variables | |
const modbus_backend_t | _modbus_rtu_backend |
static const uint8_t | table_crc_hi [] |
static const uint8_t | table_crc_lo [] |
|
static |
Definition at line 115 of file modbus-rtu.c.
|
static |
Definition at line 131 of file modbus-rtu.c.
int _modbus_rtu_check_integrity | ( | modbus_t * | ctx, |
uint8_t * | msg, | ||
const int | msg_length | ||
) |
Definition at line 284 of file modbus-rtu.c.
void _modbus_rtu_close | ( | modbus_t * | ctx | ) |
Definition at line 811 of file modbus-rtu.c.
|
static |
Definition at line 310 of file modbus-rtu.c.
int _modbus_rtu_filter_request | ( | modbus_t * | ctx, |
int | slave | ||
) |
Definition at line 881 of file modbus-rtu.c.
int _modbus_rtu_flush | ( | modbus_t * | ctx | ) |
Definition at line 831 of file modbus-rtu.c.
int _modbus_rtu_prepare_response_tid | ( | const uint8_t * | req, |
int * | req_length | ||
) |
Definition at line 157 of file modbus-rtu.c.
ssize_t _modbus_rtu_recv | ( | modbus_t * | ctx, |
uint8_t * | rsp, | ||
int | rsp_length | ||
) |
Definition at line 271 of file modbus-rtu.c.
int _modbus_rtu_select | ( | modbus_t * | ctx, |
fd_set * | rfds, | ||
struct timeval * | tv, | ||
int | length_to_read | ||
) |
Definition at line 842 of file modbus-rtu.c.
ssize_t _modbus_rtu_send | ( | modbus_t * | ctx, |
const uint8_t * | req, | ||
int | req_length | ||
) |
Definition at line 260 of file modbus-rtu.c.
int _modbus_rtu_send_msg_pre | ( | uint8_t * | req, |
int | req_length | ||
) |
Definition at line 164 of file modbus-rtu.c.
|
static |
Definition at line 101 of file modbus-rtu.c.
|
static |
Definition at line 141 of file modbus-rtu.c.
modbus_t* modbus_new_rtu | ( | const char * | device, |
int | baud, | ||
char | parity, | ||
int | data_bit, | ||
int | stop_bit | ||
) |
Definition at line 917 of file modbus-rtu.c.
int modbus_rtu_get_serial_mode | ( | modbus_t * | ctx | ) |
Definition at line 793 of file modbus-rtu.c.
int modbus_rtu_set_serial_mode | ( | modbus_t * | ctx, |
int | mode | ||
) |
Definition at line 745 of file modbus-rtu.c.
const modbus_backend_t _modbus_rtu_backend |
Definition at line 896 of file modbus-rtu.c.
|
static |
Definition at line 40 of file modbus-rtu.c.
|
static |
Definition at line 70 of file modbus-rtu.c.