msousa@0: /* msousa@0: * Copyright (c) 2001-2003,2016 Mario de Sousa (msousa@fe.up.pt) msousa@0: * msousa@0: * This file is part of the Modbus library for Beremiz and matiec. msousa@0: * msousa@0: * This Modbus library is free software: you can redistribute it and/or modify msousa@0: * it under the terms of the GNU Lesser General Public License as published by msousa@0: * the Free Software Foundation, either version 3 of the License, or msousa@0: * (at your option) any later version. msousa@0: * msousa@0: * This program is distributed in the hope that it will be useful, but msousa@0: * WITHOUT ANY WARRANTY; without even the implied warranty of msousa@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser msousa@0: * General Public License for more details. msousa@0: * msousa@0: * You should have received a copy of the GNU Lesser General Public License msousa@0: * along with this Modbus library. If not, see . msousa@0: * msousa@0: * This code is made available on the understanding that it will not be msousa@0: * used in safety-critical situations without a full and competent review. msousa@0: */ msousa@0: msousa@0: msousa@0: msousa@0: Modbus Protocol Libraries msousa@0: ========================= msousa@0: msousa@0: This directory contains the libararies that implement the modbus protocol msousa@0: stack. msousa@0: msousa@0: This protocol has been implemented as a two layer stack. Layer two includes msousa@0: the mb_master and the mb_slave protocols. Layer one is composed of msousa@0: the mb_rtu, mb_ascii and mb_tcp protocols. msousa@0: msousa@0: Layer1 protocols all implement the same interface, defined in mb_layer1.h msousa@0: Layer2 protocols implement different interfaces, defined in mb_master.h msousa@0: and mb_slave.h msousa@0: msousa@0: Which layer1 protocol that will be used by the program will depend on which msousa@0: layer1 protocol implementation is linked to the final binary/executable. msousa@0: It is not possible to define during run-time which layer1 protocol is to msousa@0: be used. Each compiled program can only support a single layer1 protocol. msousa@0: msousa@0: Users of these libraries should only use functions defined in the layer2 msousa@0: protocol header files (i.e. mb_master.h and mb_slave.h) msousa@0: msousa@0: If writing a program that will simultaneously be a master and a slave, msousa@0: then only use the mb_slave_and_master.h header file! msousa@0: In this case, do not forget to link the final binary to both the msousa@0: master and slave protocol implementations (as well as the chosen msousa@0: layer1 protocol implementation). msousa@0: msousa@0: msousa@0: msousa@0: ------------------------------------------ msousa@0: | | | msousa@0: layer 2 | mb_master.h | mb_slave.h | msousa@0: | mb_master.c | mb_slave.c | msousa@0: | | | msousa@0: |----------------------------------------| msousa@0: | mb_layer1.h | msousa@0: Layer 1 | | | | msousa@0: | mb_rtu.c | mb_ascii.c | mb_tcp.c | msousa@0: | | | | msousa@0: ------------------------------------------