modbus-rtu.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2001-2011 Stéphane Raimbault <stephane.raimbault@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef _MODBUS_RTU_H_
20 #define _MODBUS_RTU_H_
21 
22 #include "modbus.h"
23 
25 
26 /* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5
27  * RS232 / RS485 ADU = 253 bytes + slave (1 byte) + CRC (2 bytes) = 256 bytes
28  */
29 #define MODBUS_RTU_MAX_ADU_LENGTH 256
30 
31 modbus_t* modbus_new_rtu(const char *device, int baud, char parity,
32  int data_bit, int stop_bit);
33 
34 #define MODBUS_RTU_RS232 0
35 #define MODBUS_RTU_RS485 1
36 
39 
41 
42 #endif /* _MODBUS_RTU_H_ */
int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode)
Definition: modbus-rtu.c:745
#define MODBUS_BEGIN_DECLS
Definition: modbus.h:41
modbus_t * ctx
int modbus_rtu_get_serial_mode(modbus_t *ctx)
Definition: modbus-rtu.c:793
modbus_t * modbus_new_rtu(const char *device, int baud, char parity, int data_bit, int stop_bit)
Definition: modbus-rtu.c:917
#define MODBUS_END_DECLS
Definition: modbus.h:42


libmodbus
Author(s):
autogenerated on Sat Nov 21 2020 03:17:32