/* * ebusd - daemon for communication with eBUS heating systems. * Copyright (C) 2016-2017 John Baier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LIB_EBUS_CONTRIB_TEM_H_ #define LIB_EBUS_CONTRIB_TEM_H_ #include #include #include #include #include #include #include #include "lib/ebus/symbol.h" #include "lib/ebus/result.h" #include "lib/ebus/datatype.h" namespace ebusd { /** @file lib/ebus/contrib/tem.h * Contributed data types for TEM devices not necessarily part of regular releases. */ /** * A special variant of @a NumberDataType for TEM/Dungs ParamID in master/slave * data. */ class TemParamDataType : public NumberDataType { public: /** * Constructs a new instance. * @param id the type identifier. */ explicit TemParamDataType(const string id) : NumberDataType(id, 16, 0, 0xffff, 0, 0xffff, 0) {} // @copydoc virtual result_t derive(int divisor, size_t bitCount, NumberDataType* &derived) override; // @copydoc virtual result_t readSymbols(SymbolString& input, const size_t offset, const size_t length, ostringstream& output, OutputFormat outputFormat) override; // @copydoc virtual result_t writeSymbols(istringstream& input, const size_t offset, const size_t length, SymbolString& output, size_t* usedLength) override; }; /** * Registration function to be called once during initialization. */ void contrib_tem_register(); } // namespace ebusd #endif // LIB_EBUS_CONTRIB_TEM_H_