Add mandatory property description PID_OBJECT_TYPE and fix returned size for this property.

This commit is contained in:
nanosonde 2018-04-24 11:49:04 +02:00
parent 7e440ae816
commit 2a4473c5ff
7 changed files with 23 additions and 8 deletions

View File

@ -84,7 +84,9 @@ void AddressTableObject::beforeStateChange(LoadState& newState)
_groupAddresses = (uint16_t*)_data;
}
static PropertyDescription _propertyDescriptions[] = { };
static PropertyDescription _propertyDescriptions[] = {
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
};
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);
uint8_t AddressTableObject::propertyCount()

View File

@ -43,10 +43,11 @@ uint8_t ApplicationProgramObject::propertySize(PropertyID id)
{
switch (id)
{
case PID_OBJECT_TYPE:
case PID_PEI_TYPE:
return 1;
case PID_PROG_VERSION:
case PID_OBJECT_TYPE:
return 2;
case PID_PROG_VERSION:
return 5;
}
return TableObject::propertySize(id);
@ -86,7 +87,9 @@ uint8_t* ApplicationProgramObject::restore(uint8_t* buffer)
return TableObject::restore(buffer);
}
static PropertyDescription _propertyDescriptions[] = {};
static PropertyDescription _propertyDescriptions[] = {
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
};
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);
uint8_t ApplicationProgramObject::propertyCount()

View File

@ -70,6 +70,7 @@ void AssociationTableObject::beforeStateChange(LoadState& newState)
static PropertyDescription _propertyDescriptions[] =
{
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
{ PID_TABLE, false, PDT_GENERIC_02, 254, ReadLv3 | WriteLv0 },
};
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);

View File

@ -83,13 +83,13 @@ uint8_t DeviceObject::propertySize(PropertyID id)
{
switch (id)
{
case PID_OBJECT_TYPE:
case PID_DEVICE_CONTROL:
case PID_ROUTING_COUNT:
case PID_PROG_MODE:
case PID_SUBNET_ADDR:
case PID_DEVICE_ADDR:
return 1;
case PID_OBJECT_TYPE:
case PID_MANUFACTURER_ID:
case PID_VERSION:
case PID_DEVICE_DESCRIPTOR:
@ -254,7 +254,10 @@ void DeviceObject::version(uint16_t value)
_version = value;
}
static PropertyDescription _propertyDescriptions[] = {};
static PropertyDescription _propertyDescriptions[] = {
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
{ PID_SERIAL_NUMBER, false, PDT_GENERIC_06, 1, ReadLv3 | WriteLv0 },
};
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);
uint8_t DeviceObject::propertyCount()

View File

@ -120,7 +120,9 @@ bool GroupObjectTableObject::initGroupObjects()
return true;
}
static PropertyDescription _propertyDescriptions[] = { };
static PropertyDescription _propertyDescriptions[] = {
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
};
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);
uint8_t GroupObjectTableObject::propertyCount()

View File

@ -304,7 +304,9 @@ void IpParameterObject::additionalLoadControls(uint8_t* data)
return;
}
static PropertyDescription _propertyDescriptions[] = { };
static PropertyDescription _propertyDescriptions[] = {
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
};
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);
uint8_t IpParameterObject::propertyCount()

View File

@ -52,6 +52,8 @@ uint8_t TableObject::propertySize(PropertyID id)
return 4;
case PID_ERROR_CODE:
return 1;
case PID_OBJECT_TYPE:
return 2;
}
return 0;
}