clear entries from CID on first page of discovery
This commit is contained in:
parent
42368ea01f
commit
f3f6b0d35f
|
@ -326,6 +326,17 @@ void Receiver::discoveryListHanlder(ACN::PDU::Message<EXTENDED::DISCOVERY::Pdu>
|
|||
auto data = std::static_pointer_cast<EXTENDED::DISCOVERY::discovery_list_data>
|
||||
(pdu->data());
|
||||
|
||||
// on the first page:
|
||||
if (header->page == 0)
|
||||
// wipe all known discoveries from this CID
|
||||
for (auto disc = discovered.begin(); disc != discovered.end();)
|
||||
{
|
||||
if (disc->source == rlpHeader->cid)
|
||||
disc = discovered.erase(disc);
|
||||
else
|
||||
++disc;
|
||||
}
|
||||
|
||||
for (auto& found : data->found)
|
||||
{
|
||||
found.source = rlpHeader->cid;
|
||||
|
@ -333,8 +344,10 @@ void Receiver::discoveryListHanlder(ACN::PDU::Message<EXTENDED::DISCOVERY::Pdu>
|
|||
discovered.insert(found);
|
||||
}
|
||||
|
||||
// on the last page:
|
||||
if (header->page == header->last_page)
|
||||
for (const auto &cb : discoveryCallbacks_)
|
||||
// notify that changes are complete
|
||||
for (const auto& cb : discoveryCallbacks_)
|
||||
cb();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue