save work

This commit is contained in:
Nanosonde 2020-07-16 20:15:43 +02:00
parent 68b38feaea
commit 79354f2394
2 changed files with 6 additions and 4 deletions

View File

@ -41,15 +41,17 @@ void RouterObject::initialize(uint8_t objIndex, DptMedium mediumType, bool useHo
new DataProperty( PID_MEDIUM, false, PDT_ENUM8, 1, ReadLv3 | WriteLv0, (uint8_t) mediumType ),
};
uint8_t fixesPropertiesCount = sizeof(fixedProperties) / sizeof(Property*);
size_t allPropertiesCount = sizeof(fixedProperties) / sizeof(Property*);
size_t allPropertiesCount = fixesPropertiesCount;
allPropertiesCount += useHopCount ? 1 : 0;
allPropertiesCount += useTable ? 1 : 0;
allPropertiesCount += (mediumType == DptMedium::KNX_RF) ? 1 : 0;
Property* allProperties[allPropertiesCount];
memcpy(&allProperties[0], &fixedProperties[0], sizeof(fixedProperties));
uint8_t i = 0;
uint8_t i = fixesPropertiesCount;
if (useHopCount)
{

View File

@ -280,8 +280,8 @@ void TableObject::initializeProperties(size_t propertiesSize, Property** propert
uint8_t allPropertiesCount = propertyCount + ownPropertiesCount;
Property* allProperties[allPropertiesCount];
memcpy(allProperties, properties, propertiesSize);
memcpy(allProperties + propertiesSize, ownProperties, sizeof(ownProperties));
memcpy(&allProperties[0], properties, propertiesSize);
memcpy(&allProperties[propertyCount], ownProperties, sizeof(ownProperties));
InterfaceObject::initializeProperties(sizeof(allProperties), allProperties);
}