Cleanup the access control slightly.

This commit is contained in:
Jonathan Naylor 2017-07-16 19:31:27 +01:00
parent a2522f8f32
commit 517d6a84f5
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}