mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-06 06:53:42 +00:00
use UserDBentry from findWithName() to writeDMR(), add writeDMREx()
This commit is contained in:
parent
abf17e19fc
commit
4ff77c50d6
5 changed files with 58 additions and 30 deletions
|
|
@ -80,28 +80,27 @@ void CDMRLookup::stop()
|
|||
wait();
|
||||
}
|
||||
|
||||
std::string CDMRLookup::findWithName(unsigned int id)
|
||||
void CDMRLookup::findWithName(unsigned int id, class CUserDBentry *entry)
|
||||
{
|
||||
std::string callsign;
|
||||
|
||||
if (id == 0xFFFFFFU)
|
||||
return std::string("ALL");
|
||||
|
||||
class CUserDBentry entry;
|
||||
if (m_table.lookup(id, &entry)) {
|
||||
// callsign is always available
|
||||
callsign = entry.get(keyCALLSIGN);
|
||||
if (!entry.get(keyFIRST_NAME).empty())
|
||||
callsign += " " + entry.get(keyFIRST_NAME);
|
||||
|
||||
LogDebug("FindWithName =%s",callsign.c_str());
|
||||
} else {
|
||||
char text[10U];
|
||||
::snprintf(text, sizeof(text), "%u", id);
|
||||
callsign = std::string(text);
|
||||
if (id == 0xFFFFFFU) {
|
||||
entry->clear();
|
||||
entry->set(keyCALLSIGN, "ALL");
|
||||
return;
|
||||
}
|
||||
|
||||
return callsign;
|
||||
if (m_table.lookup(id, entry)) {
|
||||
LogDebug("FindWithName =%s %s", entry->get(keyCALLSIGN).c_str(), entry->get(keyFIRST_NAME).c_str());
|
||||
} else {
|
||||
entry->clear();
|
||||
|
||||
char text[10U];
|
||||
::snprintf(text, sizeof(text), "%u", id);
|
||||
entry->set(keyCALLSIGN, text);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
std::string CDMRLookup::find(unsigned int id)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue