track relative address offests
This commit is contained in:
parent
c6386b0272
commit
25227ff083
|
@ -88,6 +88,23 @@ void Device::dmpSet(PDU::Message<DMP::Pdu> dmp)
|
|||
{
|
||||
auto type = std::static_pointer_cast<address_type>(dmp->header());
|
||||
auto set_data = std::static_pointer_cast<address_pair_list>(dmp->data());
|
||||
|
||||
for(const auto& [range, data] : set_data->properties)
|
||||
{
|
||||
/// \cite DMP 5.1.2 Relative Addresses
|
||||
/// Relative addresses are used to specify an address as an offset
|
||||
/// from the most recently used address within the same PDU Block.
|
||||
uint32_t address = range.address;
|
||||
if (type->relative)
|
||||
address += last_address_used;
|
||||
|
||||
/// \todo do something with DMP properties
|
||||
|
||||
/// \cite DMP 5.1.2 Relative Addresses
|
||||
/// If a command addresses a range of properties then a subsequent
|
||||
/// relative address shall be relative to the last property in that range.
|
||||
last_address_used = address;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue