liblightmodbus  2.0
A lightweight, cross-platform Modbus RTU library
sregs.h
Go to the documentation of this file.
1 /*
2  liblightmodbus - a lightweight, multiplatform Modbus library
3  Copyright (C) 2017 Jacek Wieczorek <mrjjot@gmail.com>
4 
5  This file is part of liblightmodbus.
6 
7  Liblightmodbus is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Liblightmodbus is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
26 #ifndef LIGHTMODBUS_SREGS_H
27 #define LIGHTMODBUS_SREGS_H
28 
29 #include <inttypes.h>
30 #include "../libconf.h"
31 #include "../lightmodbus.h"
32 #include "../slave.h"
33 
34 //Functions for parsing requests
35 #if defined(LIGHTMODBUS_F03S) || defined(LIGHTMODBUS_F04S)
36 #define modbusParseRequest03 modbusParseRequest0304
37 #define modbusParseRequest04 modbusParseRequest0304
38 
46 #endif
47 
48 #ifdef LIGHTMODBUS_F06S
49 
56 extern ModbusError modbusParseRequest06( ModbusSlave *status, ModbusParser *parser );
57 #endif
58 
59 #ifdef LIGHTMODBUS_F16S
60 
67 extern ModbusError modbusParseRequest16( ModbusSlave *status, ModbusParser *parser );
68 #endif
69 
70 #ifdef LIGHTMODBUS_F22S
71 
78 extern ModbusError modbusParseRequest22( ModbusSlave *status, ModbusParser *parser );
79 #endif
80 
81 #endif
ModbusError modbusParseRequest0304(ModbusSlave *status, ModbusParser *parser)
Processes request 03 (read multiple holding registers) and 04 (read multiple input registers) ...
Definition: sregs.c:28
Represents Modbus slave device&#39;s status and configuration.
Definition: slave.h:96
A big union of structures used for parsing standard Modbus requests and building responses.
Definition: parser.h:43
ModbusError modbusParseRequest06(ModbusSlave *status, ModbusParser *parser)
Processes request 06 (write multiple holding registers)
Definition: sregs.c:136
ModbusError modbusParseRequest22(ModbusSlave *status, ModbusParser *parser)
Processes request 22 (mask-write holding register)
Definition: sregs.c:321
ModbusError modbusParseRequest16(ModbusSlave *status, ModbusParser *parser)
Processes request 15 (write multiple holding registers)
Definition: sregs.c:217
enum modbusError ModbusError
Represents a library runtime error code.