Skip to content

Commit

Permalink
Add alert when plugins defines packets out of the accepted range
Browse files Browse the repository at this point in the history
this makes addPacket macro for HPM plugins to properly alert users when their
packets are ignored due to being out of the supported range,
this was previously silently ignored
  • Loading branch information
guilherme-gm committed Aug 3, 2024
1 parent ab55b11 commit 81ad971
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/HPM.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ static bool hplugins_addpacket(unsigned short cmd, unsigned short length, void (

if (cmd <= MAX_PACKET_DB && cmd >= MIN_PACKET_DB) {
packets->db[cmd] = length;
} else {
ShowError("HPM->addPacket:%s: packet 0x%04x is out of range! Packet ID must be between 0x%04x (MIN_PACKET_DB) and 0x%04x (MAX_PACKET_DB). Ignoring it...\n",
HPM->pid2name(pluginID), cmd, (unsigned int) MIN_PACKET_DB, (unsigned int) MAX_PACKET_DB);
}

return true;
Expand Down

0 comments on commit 81ad971

Please sign in to comment.