Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Svc/TlmPacketizer/TlmPacketizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ TlmPacketizer ::TlmPacketizer(const char* const compName)
this->m_tlmEntries.buckets[entry].bucketNo = entry;
this->m_tlmEntries.buckets[entry].next = nullptr;
this->m_tlmEntries.buckets[entry].id = 0;
this->m_tlmEntries.buckets[entry].ignored = true; // Default to ignoring channels until configured otherwise
}
// clear free index
this->m_tlmEntries.free = 0;
Expand Down Expand Up @@ -66,7 +67,11 @@ void TlmPacketizer::setPacketList(const TlmPacketizerPacketList& packetList,
const FwChanIdType startLevel,
const TlmPacketizer_GroupConfig& defaultGroupConfig) {
FW_ASSERT(packetList.list);
FW_ASSERT(ignoreList.list);
// Ignore list may be nullptr as long as numEntries is 0. Providing an ignore list with numEntries 0 disables
// functionality for two reasons:
// 1. There are no ignored channels as configured by FPP.
// 2. Ignore functionality is intentionally disabled by project where nullptr was intentionally supplied.
FW_ASSERT(ignoreList.list || ignoreList.numEntries == 0);
FW_ASSERT(packetList.numEntries <= MAX_PACKETIZER_PACKETS, static_cast<FwAssertArgType>(packetList.numEntries));
// validate packet sizes against maximum com buffer size and populate hash
// table
Expand Down Expand Up @@ -132,7 +137,11 @@ void TlmPacketizer::setPacketList(const TlmPacketizerPacketList& packetList,
}
}

// populate hash table with ignore list
// This section sets up buckets in the hashmap for channels that are intended to be ignored. When the user supplies
// a list with no length, this loop is skipped. To turn-off ignoring of channels, the user can provided a null
// list with 0 length.
//
// This removes the need for hash buckets for "ignored" telemetry.
for (FwChanIdType channelEntry = 0; channelEntry < ignoreList.numEntries; channelEntry++) {
// get hash value for id
FwChanIdType id = ignoreList.list[channelEntry].id;
Expand Down
3 changes: 3 additions & 0 deletions Svc/TlmPacketizer/TlmPacketizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

namespace Svc {

//! Constant allowing users to ignore the omit list allowing a reduction in required buckets and thus storage
constexpr Svc::TlmPacketizerPacket IGNORE_OMIT_LIST = {nullptr, 0, 0, 0};

class TlmPacketizer final : public TlmPacketizerComponentBase {
friend class TlmPacketizerTester;

Expand Down
Loading