37 #include <unordered_map> 41 #include "../../Systems/Packet.h" 44 #include "../../Encoding/RpcEncoder.h" 45 #include "../../Encoding/RpcDecoder.h" 53 namespace HmDeviceDescription
56 class HomeMaticParameter;
74 std::vector<DescriptionField>
fields;
86 enum Enum { none,
toggle, floatIntegerScale, integerIntegerScale, floatUint8StringScale, booleanInteger, booleanDecimal, booleanString, integerIntegerMap, floatConfigTime, optionInteger, integerTinyFloat, stringUnsignedInteger, blindTest, cfm, ccrtdnParty, optionString, stringJsonArrayFloat, rpcBinary, hexstringBytearray };
95 int32_t threshold = 1;
96 int32_t valueFalse = 0;
97 int32_t valueTrue = 0;
98 std::string stringValueFalse =
"false";
99 std::string stringValueTrue =
"true";
101 double valueSize = 0;
102 int32_t mantissaStart = 5;
103 int32_t mantissaSize = 11;
104 int32_t exponentStart = 0;
105 int32_t exponentSize = 5;
110 bool fromDevice =
true;
111 bool toDevice =
true;
116 virtual void fromPacket(std::shared_ptr<Variable>
value);
117 virtual void toPacket(std::shared_ptr<Variable> value);
135 enum Enum { none = 0, read = 1, write = 2,
event = 4, addonWrite = 16 };
139 enum Enum { none = 0, visible = 1,
internal = 2, transform = 4, service = 8, sticky = 0x10, invisible = 0x20 };
141 uint32_t _bitmask[8] = {0xFF, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F};
147 int32_t index2Offset = -1;
148 bool isSigned =
false;
154 int32_t constValue = -1;
162 std::vector<std::shared_ptr<ParameterConversion>>
conversion;
164 bool omitIfSet =
false;
166 bool loopback =
false;
167 bool hasDominoEvents =
false;
175 virtual bool checkCondition(int32_t
value);
184 virtual std::shared_ptr<Variable> convertFromPacket(std::vector<uint8_t>& data,
bool isEvent =
false);
192 virtual void convertToPacket(
const std::shared_ptr<Variable> value, std::vector<uint8_t>& convertedValue);
200 virtual void convertToPacket(std::string value, std::vector<uint8_t>& convertedValue);
208 virtual void reverseData(
const std::vector<uint8_t>& data, std::vector<uint8_t>& reversedData);
209 virtual void adjustBitPosition(std::vector<uint8_t>& data);
226 bool updatable =
false;
227 int32_t priority = 0;
228 int32_t firmware = -1;
237 virtual bool matches(int32_t family, std::string typeID);
238 virtual bool matches(uint32_t typeNumber, uint32_t firmwareVersion);
239 virtual bool checkFirmwareVersion(int32_t version);
253 enum Enum { none = 0, master = 1, values = 2, link = 3 };
261 int32_t addressStart = -1;
262 int32_t addressStep = -1;
266 int32_t channelOffset = -1;
267 int32_t peerAddressOffset = -1;
268 int32_t peerChannelOffset = -1;
273 virtual void init(
xml_node* parameterSetNode);
274 virtual std::vector<std::shared_ptr<HomeMaticParameter>> getIndices(uint32_t startIndex, uint32_t endIndex, int32_t list);
275 virtual std::vector<std::shared_ptr<HomeMaticParameter>> getList(int32_t list);
276 virtual std::shared_ptr<HomeMaticParameter> getIndex(
double index);
277 virtual std::shared_ptr<HomeMaticParameter> getParameter(std::string
id);
278 virtual std::string typeString();
314 enum Enum { none = 0, visible = 1,
internal = 2, dontdelete = 8 };
318 enum Enum { none = 0, sender = 1, receiver = 2 };
321 int32_t physicalIndexOffset = 0;
326 uint32_t startIndex = 0;
328 bool hasTeam =
false;
329 bool aesDefault =
false;
330 bool aesAlways =
false;
333 bool autoregister =
false;
335 double countFromSysinfo = -1;
336 double countFromSysinfoSize = 1;
338 std::string
function;
342 std::map<ParameterSet::Type::Enum, std::shared_ptr<ParameterSet>>
parameterSets;
367 enum Enum { none = 0, broadcast = 1, central = 2, other = 4 };
373 bool isEvent =
false;
374 bool doubleSend =
false;
376 int32_t subtype = -1;
377 int32_t subtypeIndex = -1;
378 double subtypeFieldSize = 1.0;
379 int32_t responseType = -1;
380 int32_t responseSubtype = -1;
381 int32_t channelField = -1;
382 double channelFieldSize = 1.0;
383 int32_t channelIndexOffset = 0;
384 int32_t fixedChannel = -1;
386 int32_t splitAfter = -1;
387 int32_t maxPackets = -1;
407 enum Enum { none, once, interval, permanent };
413 uint32_t interval = 0;
427 enum Enum { none = 0, visible = 1,
internal = 2, dontdelete = 8 };
431 enum Enum { none = 0, always = 1, burst = 2, config = 4, wakeUp = 8, lazyConfig = 16, wakeUp2 = 32 };
435 bool hasBattery =
false;
437 uint32_t version = 0;
438 uint32_t cyclicTimeout = 0;
439 int32_t eepSize = 1024;
441 std::map<uint32_t, std::shared_ptr<DeviceChannel>>
channels;
446 std::map<std::string, std::shared_ptr<DeviceFrame>>
framesByID;
451 int32_t countFromSysinfoIndex = -1;
452 double countFromSysinfoSize = 1;
454 bool supportsAES =
false;
455 bool peeringSysinfoExpectChannel =
true;
456 bool needsTime =
false;
462 virtual std::shared_ptr<DeviceType> getType(uint32_t typeNumber, int32_t firmwareVersion);
464 virtual void setCountFromSysinfo(int32_t countFromSysinfo);
467 bool _loaded =
false;
468 int32_t _countFromSysinfo = -1;
470 virtual void load(std::string xmlFilename);
471 virtual void parseXML(
xml_node* node, std::string& xmlFilename);
std::string id
Definition: HmDevice.h:156
std::shared_ptr< Rpc::RpcDecoder > _binaryDecoder
Definition: HmDevice.h:212
Enum
Definition: HmPhysicalParameter.h:99
virtual ~EnforceLink()
Definition: HmDevice.h:292
Definition: HmDevice.h:312
std::vector< std::string > sourceNames
Definition: HmDevice.h:301
virtual ~DeviceProgram()
Definition: HmDevice.h:417
std::string function1
Definition: HmDevice.h:390
std::string field
Definition: HmDevice.h:169
Enum
Definition: HmLogicalParameter.h:67
std::shared_ptr< HomeMaticParameter > specialParameter
Definition: HmDevice.h:345
std::string function2
Definition: HmDevice.h:391
Definition: HmDevice.h:81
std::shared_ptr< DeviceProgram > runProgram
Definition: HmDevice.h:448
std::shared_ptr< LogicalParameter > logicalParameter
Definition: HmDevice.h:160
Definition: HmDevice.h:84
This is the base library main class.
Definition: BaseLib.h:95
Definition: HmDevice.h:251
std::string value
Definition: HmDevice.h:64
std::map< uint32_t, std::shared_ptr< DeviceChannel > > channels
Definition: HmDevice.h:441
Definition: HmDevice.h:137
std::string path
Definition: HmDevice.h:411
std::string teamTag
Definition: HmDevice.h:341
Enum
Definition: HmDevice.h:407
std::string additionalParameter
Definition: HmDevice.h:158
std::list< HomeMaticParameter > parameters
Definition: HmDevice.h:388
ParameterDescription()
Definition: HmDevice.h:76
std::shared_ptr< Device > team
Definition: HmDevice.h:457
virtual ~LinkRole()
Definition: HmDevice.h:306
Definition: BaseLib.cpp:34
std::vector< std::shared_ptr< HomeMaticParameter > > associatedValues
Definition: HmDevice.h:389
std::vector< std::shared_ptr< EnforceLink > > enforceLinks
Definition: HmDevice.h:344
Enum
Definition: HmDevice.h:318
Definition: HmDevice.h:126
Enum
Definition: HmDevice.h:221
std::vector< std::shared_ptr< DeviceChannel > > subconfigs
Definition: HmDevice.h:346
std::vector< std::string > targetNames
Definition: HmDevice.h:302
std::shared_ptr< Rpc::RpcEncoder > _binaryEncoder
Definition: HmDevice.h:213
std::map< ParameterSet::Type::Enum, std::shared_ptr< ParameterSet > > parameterSets
Definition: HmDevice.h:342
std::string id
Definition: HmDevice.h:224
bool loaded()
Definition: HmDevice.h:434
std::vector< std::pair< std::string, std::string > > DefaultValue
Definition: HmDevice.h:247
virtual int32_t getCountFromSysinfo()
Definition: HmDevice.h:463
Definition: HmDevice.h:422
std::vector< std::shared_ptr< HomeMaticParameter > > parameters
Definition: HmDevice.h:257
std::unordered_map< int32_t, int32_t > integerValueMapDevice
Definition: HmDevice.h:89
Enum
Definition: HmDevice.h:314
std::map< std::string, DefaultValue > defaultValues
Definition: HmDevice.h:258
Definition: HmDevice.h:71
Definition: HmDevice.h:129
Enum
Definition: HmDevice.h:86
Enum
Definition: HmDevice.h:131
std::string deviceClass
Definition: HmDevice.h:453
std::shared_ptr< PhysicalParameter > physicalParameter
Definition: HmDevice.h:161
std::vector< DescriptionField > fields
Definition: HmDevice.h:74
std::string control
Definition: HmDevice.h:159
std::string subfield
Definition: HmDevice.h:170
Definition: HmDevice.h:405
std::string id
Definition: HmDevice.h:372
std::string stringValue
Definition: HmDevice.h:106
ParameterDescription description
Definition: HmDevice.h:163
std::string name
Definition: HmDevice.h:223
std::multimap< std::string, std::shared_ptr< DeviceFrame > > framesByFunction2
Definition: HmDevice.h:445
virtual ~ParameterSet()
Definition: HmDevice.h:272
std::string id
Definition: HmDevice.h:256
std::string id
Definition: HmDevice.h:287
Enum
Definition: HmDevice.h:135
Definition: HmDevice.h:425
std::map< uint32_t, uint32_t > lists
Definition: HmDevice.h:259
Definition: HmDevice.h:86
Definition: HmDevice.h:402
Definition: HmDevice.h:298
DescriptionField()
Definition: HmDevice.h:66
virtual ~HomeMaticParameter()
Definition: HmDevice.h:174
Definition: HmDevice.h:219
Definition: HmDevice.h:284
virtual ~ParameterConversion()
Definition: HmDevice.h:115
std::string peerParam
Definition: HmDevice.h:264
std::string value
Definition: HmDevice.h:288
std::string pairFunction2
Definition: HmDevice.h:340
Definition: HmDevice.h:216
Enum
Definition: HmDevice.h:431
Enum
Definition: HmDevice.h:427
std::string pairFunction1
Definition: HmDevice.h:339
virtual ~DeviceType()
Definition: HmDevice.h:235
std::multimap< uint32_t, std::shared_ptr< DeviceFrame > > framesByMessageType
Definition: HmDevice.h:443
virtual ~DeviceChannel()
Definition: HmDevice.h:350
Definition: HmDevice.h:309
Definition: HmDevice.h:358
std::string metaString1
Definition: HmDevice.h:392
std::string subsetReference
Definition: HmDevice.h:260
std::vector< std::shared_ptr< ParameterConversion > > conversion
Definition: HmDevice.h:162
std::shared_ptr< ParameterSet > parameterSet
Definition: HmDevice.h:440
Enum
Definition: HmDevice.h:253
std::vector< HomeMaticParameter > parameters
Definition: HmDevice.h:225
Definition: HmDevice.h:248
virtual ~ParameterDescription()
Definition: HmDevice.h:78
std::multimap< std::string, std::shared_ptr< DeviceFrame > > framesByFunction1
Definition: HmDevice.h:444
std::shared_ptr< LinkRole > linkRoles
Definition: HmDevice.h:343
std::string countFromVariable
Definition: HmDevice.h:337
std::string param
Definition: HmDevice.h:157
std::string metaString2
Definition: HmDevice.h:393
std::vector< std::string > arguments
Definition: HmDevice.h:412
Definition: HmDevice.h:133
LinkRole()
Definition: HmDevice.h:304
std::map< std::string, std::shared_ptr< DeviceFrame > > framesByID
Definition: HmDevice.h:446
virtual ~DeviceFrame()
Definition: HmDevice.h:397
std::string channelParam
Definition: HmDevice.h:265
std::string constValueString
Definition: HmDevice.h:155
std::vector< std::shared_ptr< DeviceType > > supportedTypes
Definition: HmDevice.h:442
Definition: HmDevice.h:60
Definition: HmDevice.h:429
virtual ~DescriptionField()
Definition: HmDevice.h:68
Class representing a node of XML document.
Definition: rapidxml.h:539
std::map< int32_t, std::map< std::string, std::shared_ptr< DeviceFrame > > > valueRequestFrames
Definition: HmDevice.h:447
Definition: HmDevice.h:316
std::unordered_map< int32_t, int32_t > integerValueMapParameter
Definition: HmDevice.h:90
Enum
Definition: HmDevice.h:363
Definition: HmDevice.h:361
std::string type
Definition: HmDevice.h:322
Enum
Definition: HmDevice.h:139
Definition: HmDevice.h:363
std::string id
Definition: HmDevice.h:63
std::string channelClass
Definition: HmDevice.h:325
std::vector< double > factors
Definition: HmDevice.h:92
Definition: HmDevice.h:365
Enum
Definition: HmDevice.h:367