Cosmetic changes. Fix whitespace and "{".

This commit is contained in:
nanosonde 2018-04-25 23:20:00 +02:00
parent daf1cabedf
commit d315aee70e
9 changed files with 70 additions and 77 deletions

View File

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

View File

@ -87,8 +87,9 @@ uint8_t* ApplicationProgramObject::restore(uint8_t* buffer)
return TableObject::restore(buffer); return TableObject::restore(buffer);
} }
static PropertyDescription _propertyDescriptions[] = { static PropertyDescription _propertyDescriptions[] =
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 }, {
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 }
}; };
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription); static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);

View File

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

View File

@ -254,9 +254,10 @@ void DeviceObject::version(uint16_t value)
_version = value; _version = value;
} }
static PropertyDescription _propertyDescriptions[] = { static PropertyDescription _propertyDescriptions[] =
{
{ PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 }, { PID_OBJECT_TYPE, false, PDT_UNSIGNED_INT, 1, ReadLv3 | WriteLv0 },
{ PID_SERIAL_NUMBER, false, PDT_GENERIC_06, 1, ReadLv3 | WriteLv0 }, { PID_SERIAL_NUMBER, false, PDT_GENERIC_06, 1, ReadLv3 | WriteLv0 }
}; };
static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription); static uint8_t _propertyCount = sizeof(_propertyDescriptions) / sizeof(PropertyDescription);

View File

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

View File

@ -8,17 +8,7 @@ void InterfaceObject::readPropertyDescription(uint8_t& propertyId, uint8_t& prop
PropertyDescription* desc = nullptr; PropertyDescription* desc = nullptr;
// from KNX spec. 03.03.07 Application Layer (page 56) - 3.4.3.3 A_PropertyDescription_Read-service // from KNX spec. 03.03.07 Application Layer (page 56) - 3.4.3.3 A_PropertyDescription_Read-service
// [...] and the Property of the object shall be addressed with // Summary: either propertyId OR propertyIndex, but not both at the same time
// a property_id OR with a property_index.The property_index shall be used ONLY if the property_id is zero.
// [...]
// If the property_id in the A_PropertyDescription_Read - PDU is NOT zero, then the field property_index
// shall be IGNORED; the remote application process shall use the indicated property_id to access the Property
// description.The property_index in the A_PropertyDescription_Response - PDU shall in this case be :
// - the correct value of the Property index of the addressed Property, or
// - the value of the field property_index of the received A_PropertyDescription_Read - PDU.
// For new implementations the property_index shall contain the correct value of the addressed Property.
// If the remote application process has a problem, e.g.Interface Object or Property does not exist, then the
// max_nr_of_elem of the A_PropertyDescription_Response - PDU shall be zero.
if (propertyId != 0) if (propertyId != 0)
{ {
for (uint8_t i = 0; i < count; i++) for (uint8_t i = 0; i < count; i++)
@ -34,10 +24,8 @@ void InterfaceObject::readPropertyDescription(uint8_t& propertyId, uint8_t& prop
} }
else else
{ {
// If the property_id in the A_PropertyDescription_Read - PDU is zero, the remote application process shall // If propertyId is zero, propertyIndex shall be used.
// use the indicated property_index to access the Property description.The property_index in the // Response: propertyIndex of received A_PropertyDescription_Read
// A_PropertyDescription_Response - PDU shall be the value of the field property_index of the received
// A_PropertyDescription_Read - PDU
if (propertyIndex >= 0 && propertyIndex < count) if (propertyIndex >= 0 && propertyIndex < count)
{ {
desc = &descriptions[propertyIndex]; desc = &descriptions[propertyIndex];

View File

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