Skip to content

Commit

Permalink
Cleanup the access control slightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Jul 16, 2017
1 parent a2522f8 commit 517d6a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DMRAccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ void CDMRAccessControl::init(const std::vector<unsigned int>& blacklist, const s
bool CDMRAccessControl::validateSrcId(unsigned int id)
{
if (m_selfOnly) {
if (m_id > 9999999U) // Check that the Config DMR-ID is bigger than 7 digits
return (id == m_id / 10U) || (id == m_id / 100U); // Does RF ID match Config ID / 10 or Config ID / 100
if (m_id > 99999999U) // Check that the Config DMR-ID is bigger than 8 digits
return id == m_id / 100U; // Does RF ID match Config ID / 100
else if (m_id > 9999999U) // Check that the Config DMR-ID is bigger than 7 digits
return id == m_id / 10U; // Does RF ID match Config ID / 10
else
return id == m_id;
}
Expand Down

0 comments on commit 517d6a8

Please sign in to comment.