Add stricter P25 id checking.

This commit is contained in:
Jonathan Naylor
2017-08-19 12:37:32 +01:00
parent 23ce9c7b46
commit afe38bcb9d
5 changed files with 28 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -103,6 +103,17 @@ std::string CDMRLookup::find(unsigned int id)
return callsign;
}
bool CDMRLookup::exists(unsigned int id)
{
m_mutex.lock();
bool found = m_table.count(id) == 1U;
m_mutex.unlock();
return found;
}
bool CDMRLookup::load()
{
FILE* fp = ::fopen(m_filename.c_str(), "rt");