File indexing completed on 2024-09-22 05:05:32

0001 #ifndef H_EXTENSIONS_CUTEHMI_MODBUS_4_INCLUDE_CUTEHMI_MODBUS_COILCONTROLLER_HPP
0002 #define H_EXTENSIONS_CUTEHMI_MODBUS_4_INCLUDE_CUTEHMI_MODBUS_COILCONTROLLER_HPP
0003 
0004 #include "internal/common.hpp"
0005 #include "Register1Controller.hpp"
0006 
0007 #include <QObject>
0008 #include <QQmlEngine>
0009 
0010 namespace cutehmi {
0011 namespace modbus {
0012 
0013 class CUTEHMI_MODBUS_API CoilController:
0014     public cutehmi::modbus::Register1Controller
0015 {
0016         Q_OBJECT
0017         QML_NAMED_ELEMENT(CoilController)
0018 
0019     public:
0020         CoilController(QObject * parent = nullptr);
0021 
0022     protected:
0023         Register1 * registerAt(quint16 address) const override;
0024 
0025         void requestReadRegisters(quint16 address, quint16 amount, QUuid * requestId) const override;
0026 
0027         void requestWriteRegister(quint16 address, bool value, QUuid * requestId) const override;
0028 
0029         AbstractDevice::Function readRegistersFunction() const override;
0030 
0031         AbstractDevice::Function writeRegisterFunction() const override;
0032 };
0033 
0034 }
0035 }
0036 
0037 #endif
0038 
0039 //(c)C: Copyright © 2022, Michał Policht <michal@policht.pl>. All rights reserved.
0040 //(c)C: SPDX-License-Identifier: LGPL-3.0-or-later OR MIT
0041 //(c)C: This file is a part of CuteHMI.
0042 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
0043 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
0044 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI.  If not, see <https://www.gnu.org/licenses/>.
0045 //(c)C: Additionally, this file is licensed under terms of MIT license as expressed below.
0046 //(c)C: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
0047 //(c)C: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
0048 //(c)C: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.