mirror of
https://github.com/thelsing/knx.git
synced 2025-08-26 13:51:28 +02:00
Callback properties must return valid data on startIndex 0. The return value must contain the actual element count within the property.
This commit is contained in:
parent
46fa13df04
commit
38872f11ba
@ -13,8 +13,12 @@ ApplicationProgramObject::ApplicationProgramObject(Memory& memory)
|
|||||||
new DataProperty(PID_PROG_VERSION, true, PDT_GENERIC_05, 1, ReadLv3 | WriteLv3),
|
new DataProperty(PID_PROG_VERSION, true, PDT_GENERIC_05, 1, ReadLv3 | WriteLv3),
|
||||||
new CallbackProperty<ApplicationProgramObject>(this, PID_PEI_TYPE, false, PDT_UNSIGNED_CHAR, 1, ReadLv3 | WriteLv0,
|
new CallbackProperty<ApplicationProgramObject>(this, PID_PEI_TYPE, false, PDT_UNSIGNED_CHAR, 1, ReadLv3 | WriteLv0,
|
||||||
[](ApplicationProgramObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t {
|
[](ApplicationProgramObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t {
|
||||||
if (start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
data[0] = 0;
|
data[0] = 0;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -20,7 +20,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
// TODO: get property of deviceobject and use it
|
// TODO: get property of deviceobject and use it
|
||||||
pushWord(io->_deviceObject.induvidualAddress(), data);
|
pushWord(io->_deviceObject.induvidualAddress(), data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -36,7 +40,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
pushInt(io->_platform.currentIpAddress(), data);
|
pushInt(io->_platform.currentIpAddress(), data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -45,7 +53,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
pushInt(io->_platform.currentSubnetMask(), data);
|
pushInt(io->_platform.currentSubnetMask(), data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -54,7 +66,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
pushInt(io->_platform.currentDefaultGateway(), data);
|
pushInt(io->_platform.currentDefaultGateway(), data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -66,7 +82,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
io->_platform.macAddress(data);
|
io->_platform.macAddress(data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -75,7 +95,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
pushInt(DEFAULT_MULTICAST_ADDR, data);
|
pushInt(DEFAULT_MULTICAST_ADDR, data);
|
||||||
return 1;
|
return 1;
|
||||||
@ -86,7 +110,11 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf
|
|||||||
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
[](IpParameterObject* io, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t
|
||||||
{
|
{
|
||||||
if(start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
pushWord(0x1, data);
|
pushWord(0x1, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -238,8 +238,12 @@ void TableObject::initializeProperties(size_t propertiesSize, Property** propert
|
|||||||
{
|
{
|
||||||
new CallbackProperty<TableObject>(this, PID_LOAD_STATE_CONTROL, true, PDT_CONTROL, 1, ReadLv3 | WriteLv3,
|
new CallbackProperty<TableObject>(this, PID_LOAD_STATE_CONTROL, true, PDT_CONTROL, 1, ReadLv3 | WriteLv3,
|
||||||
[](TableObject* obj, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t {
|
[](TableObject* obj, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t {
|
||||||
if (start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
data[0] = obj->_state;
|
data[0] = obj->_state;
|
||||||
return 1;
|
return 1;
|
||||||
@ -250,8 +254,12 @@ void TableObject::initializeProperties(size_t propertiesSize, Property** propert
|
|||||||
}),
|
}),
|
||||||
new CallbackProperty<TableObject>(this, PID_TABLE_REFERENCE, false, PDT_UNSIGNED_LONG, 1, ReadLv3 | WriteLv0,
|
new CallbackProperty<TableObject>(this, PID_TABLE_REFERENCE, false, PDT_UNSIGNED_LONG, 1, ReadLv3 | WriteLv0,
|
||||||
[](TableObject* obj, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t {
|
[](TableObject* obj, uint16_t start, uint8_t count, uint8_t* data) -> uint8_t {
|
||||||
if (start == 0)
|
if(start == 0)
|
||||||
|
{
|
||||||
|
uint16_t currentNoOfElements = 1;
|
||||||
|
pushWord(currentNoOfElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (obj->_state == LS_UNLOADED)
|
if (obj->_state == LS_UNLOADED)
|
||||||
pushInt(0, data);
|
pushInt(0, data);
|
||||||
|
Loading…
Reference in New Issue
Block a user