add some convienience methods to Property class

This commit is contained in:
Thomas Kunze
2019-12-12 23:40:03 +01:00
parent 398ba7408b
commit b9571112d6
4 changed files with 83 additions and 29 deletions

View File

@@ -100,12 +100,8 @@ uint32_t IpParameterObject::multicastAddress() const
{
const Property* prop = property(PID_ROUTING_MULTICAST_ADDRESS);
uint8_t data[4];
uint8_t count = prop->read(1, 1, data);
uint32_t value = DEFAULT_MULTICAST_ADDR;
if (count == 1)
popInt(value, data);
prop->read(value);
return value;
}
@@ -114,8 +110,8 @@ uint8_t IpParameterObject::ttl() const
{
const Property* prop = property(PID_TTL);
uint8_t data[1];
prop->read(1, 1, data);
return data[0];
uint8_t value = 0;
prop->read(value);
return value;
}
#endif