liblightmodbus  2.0
A lightweight, cross-platform Modbus RTU library
scoils.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_SCOILS_H
27 #define LIGHTMODBUS_SCOILS_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_F01S) || defined(LIGHTMODBUS_F02S)
36 #define modbusParseRequest01 modbusParseRequest0102
37 #define modbusParseRequest02 modbusParseRequest0102
38 
46 #endif
47 
48 #ifdef LIGHTMODBUS_F05S
49 
56 extern ModbusError modbusParseRequest05( ModbusSlave *status, ModbusParser *parser );
57 #endif
58 
59 #ifdef LIGHTMODBUS_F15S
60 
67 extern ModbusError modbusParseRequest15( ModbusSlave *status, ModbusParser *parser );
68 #endif
69 
70 #endif
Represents Modbus slave device&#39;s status and configuration.
Definition: slave.h:96
ModbusError modbusParseRequest15(ModbusSlave *status, ModbusParser *parser)
Processes request 15 (write multiple coils)
Definition: scoils.c:233
A big union of structures used for parsing standard Modbus requests and building responses.
Definition: parser.h:43
ModbusError modbusParseRequest0102(ModbusSlave *status, ModbusParser *parser)
Processes requests 01 (read multiple coils) and 02 (read multiple discrete inputs).
Definition: scoils.c:29
ModbusError modbusParseRequest05(ModbusSlave *status, ModbusParser *parser)
Processes request 05 (write a single coil)
Definition: scoils.c:141
enum modbusError ModbusError
Represents a library runtime error code.