Fix dashboard conflict, add IP address to D-Star screen
Tag: Version "v20180328.3z"
This commit is contained in:
parent
d833d4b055
commit
9d6bcb7ec8
|
@ -81,7 +81,7 @@ void CDMRLookup::stop()
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CDMRLookup::find(unsigned int id)
|
std::string CDMRLookup::findwithname(unsigned int id)
|
||||||
{
|
{
|
||||||
std::string callsign;
|
std::string callsign;
|
||||||
|
|
||||||
|
@ -92,6 +92,40 @@ std::string CDMRLookup::find(unsigned int id)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
callsign = m_table.at(id);
|
callsign = m_table.at(id);
|
||||||
|
LogDebug("Findwithname Found =%s",callsign.c_str());
|
||||||
|
|
||||||
|
} catch (...) {
|
||||||
|
char text[10U];
|
||||||
|
::sprintf(text, "%u", id);
|
||||||
|
callsign = std::string(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_mutex.unlock();
|
||||||
|
|
||||||
|
return callsign;
|
||||||
|
}
|
||||||
|
std::string CDMRLookup::find(unsigned int id)
|
||||||
|
{
|
||||||
|
std::string callsign;
|
||||||
|
std::string b;
|
||||||
|
|
||||||
|
|
||||||
|
if (id == 0xFFFFFFU)
|
||||||
|
return std::string("ALL");
|
||||||
|
|
||||||
|
m_mutex.lock();
|
||||||
|
|
||||||
|
try {
|
||||||
|
b = m_table.at(id);
|
||||||
|
size_t n = b.find(" ");
|
||||||
|
if (n > 0) {
|
||||||
|
callsign = b.substr(0,n);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
LogDebug("b=%s",b.c_str());
|
||||||
|
callsign = b;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
char text[10U];
|
char text[10U];
|
||||||
::sprintf(text, "%u", id);
|
::sprintf(text, "%u", id);
|
||||||
|
@ -133,13 +167,19 @@ bool CDMRLookup::load()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char* p1 = ::strtok(buffer, " \t\r\n");
|
char* p1 = ::strtok(buffer, " \t\r\n");
|
||||||
char* p2 = ::strtok(NULL, " \t\r\n");
|
char* p2 = ::strtok(NULL, " \r\n"); // tokenize to eol to capture name as well
|
||||||
|
|
||||||
if (p1 != NULL && p2 != NULL) {
|
if (p1 != NULL && p2 != NULL) {
|
||||||
unsigned int id = (unsigned int)::atoi(p1);
|
unsigned int id = (unsigned int)::atoi(p1);
|
||||||
for (char* p = p2; *p != 0x00U; p++)
|
for (char* p = p2; *p != 0x00U; p++) {
|
||||||
*p = ::toupper(*p);
|
|
||||||
|
if(*p == 0x09U)
|
||||||
|
*p = 0x20U;
|
||||||
|
|
||||||
|
else
|
||||||
|
*p = ::toupper(*p);
|
||||||
|
|
||||||
|
}
|
||||||
m_table[id] = std::string(p2);
|
m_table[id] = std::string(p2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ public:
|
||||||
virtual void entry();
|
virtual void entry();
|
||||||
|
|
||||||
std::string find(unsigned int id);
|
std::string find(unsigned int id);
|
||||||
|
std::string findwithname(unsigned int id);
|
||||||
|
|
||||||
bool exists(unsigned int id);
|
bool exists(unsigned int id);
|
||||||
|
|
||||||
|
|
|
@ -1067,16 +1067,16 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
||||||
m_netState = RS_NET_AUDIO;
|
m_netState = RS_NET_AUDIO;
|
||||||
|
|
||||||
setShortLC(m_slotNo, dstId, flco, ACTIVITY_VOICE);
|
setShortLC(m_slotNo, dstId, flco, ACTIVITY_VOICE);
|
||||||
|
|
||||||
std::string src = m_lookup->find(srcId);
|
std::string src = m_lookup->find(srcId);
|
||||||
std::string dst = m_lookup->find(dstId);
|
std::string dst = m_lookup->find(dstId);
|
||||||
|
std::string cn = m_lookup->findwithname(srcId);
|
||||||
m_display->writeDMR(m_slotNo, src, flco == FLCO_GROUP, dst, "N");
|
m_display->writeDMR(m_slotNo, cn, flco == FLCO_GROUP, dst, "N");
|
||||||
|
|
||||||
#if defined(DUMP_DMR)
|
#if defined(DUMP_DMR)
|
||||||
openFile();
|
openFile();
|
||||||
writeFile(data);
|
writeFile(data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LogMessage("DMR Slot %u, received network voice header from %s to %s%s", m_slotNo, src.c_str(), flco == FLCO_GROUP ? "TG " : "", dst.c_str());
|
LogMessage("DMR Slot %u, received network voice header from %s to %s%s", m_slotNo, src.c_str(), flco == FLCO_GROUP ? "TG " : "", dst.c_str());
|
||||||
} else if (dataType == DT_VOICE_PI_HEADER) {
|
} else if (dataType == DT_VOICE_PI_HEADER) {
|
||||||
if (m_netState != RS_NET_AUDIO) {
|
if (m_netState != RS_NET_AUDIO) {
|
||||||
|
|
17
OLED.cpp
17
OLED.cpp
|
@ -180,7 +180,7 @@ void COLED::setIdleInt()
|
||||||
networkInfoInitialized = false;
|
networkInfoInitialized = false;
|
||||||
|
|
||||||
if (! networkInfoInitialized) {
|
if (! networkInfoInitialized) {
|
||||||
LogMessage("Initialize CNetworkInfo");
|
//LogMessage("Initialize CNetworkInfo");
|
||||||
info[0]=0;
|
info[0]=0;
|
||||||
m_network = new CNetworkInfo;
|
m_network = new CNetworkInfo;
|
||||||
m_network->getNetworkInterface(info);
|
m_network->getNetworkInterface(info);
|
||||||
|
@ -228,14 +228,17 @@ void COLED::writeDStarInt(const char* my1, const char* my2, const char* your, co
|
||||||
display.clearDisplay();
|
display.clearDisplay();
|
||||||
display.fillRect(0,OLED_LINE3,display.width(),display.height(),BLACK); //clear everything beneath logo
|
display.fillRect(0,OLED_LINE3,display.width(),display.height(),BLACK); //clear everything beneath logo
|
||||||
|
|
||||||
display.setCursor(0,OLED_LINE4);
|
display.setCursor(0,OLED_LINE3);
|
||||||
display.printf("%s %.8s/%4.4s",type,my1,my2);
|
display.printf("%s %.8s/%4.4s",type,my1,my2);
|
||||||
|
|
||||||
display.setCursor(0,OLED_LINE5);
|
display.setCursor(0,OLED_LINE4);
|
||||||
display.printf("-> %.8s",your);
|
display.printf("-> %.8s",your);
|
||||||
|
|
||||||
display.setCursor(0,OLED_LINE6);
|
display.setCursor(0,OLED_LINE5);
|
||||||
display.printf("via %.8s",reflector);
|
display.printf("via %.8s",reflector);
|
||||||
|
|
||||||
|
display.setCursor(0,OLED_LINE6);
|
||||||
|
display.printf("%s",m_ipaddress.c_str());
|
||||||
|
|
||||||
OLED_statusbar();
|
OLED_statusbar();
|
||||||
display.display();
|
display.display();
|
||||||
|
@ -271,7 +274,7 @@ void COLED::writeDMRInt(unsigned int slotNo,const std::string& src,bool group,co
|
||||||
display.setCursor(0,OLED_LINE2);
|
display.setCursor(0,OLED_LINE2);
|
||||||
display.printf("%s",src.c_str());
|
display.printf("%s",src.c_str());
|
||||||
display.setCursor(0,OLED_LINE3);
|
display.setCursor(0,OLED_LINE3);
|
||||||
display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG" : "",dst.c_str());
|
display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -279,7 +282,7 @@ void COLED::writeDMRInt(unsigned int slotNo,const std::string& src,bool group,co
|
||||||
display.setCursor(0,OLED_LINE4);
|
display.setCursor(0,OLED_LINE4);
|
||||||
display.printf("%s",src.c_str());
|
display.printf("%s",src.c_str());
|
||||||
display.setCursor(0,OLED_LINE5);
|
display.setCursor(0,OLED_LINE5);
|
||||||
display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG" : "",dst.c_str());
|
display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -289,7 +292,7 @@ void COLED::writeDMRInt(unsigned int slotNo,const std::string& src,bool group,co
|
||||||
display.setCursor(0,OLED_LINE3);
|
display.setCursor(0,OLED_LINE3);
|
||||||
display.printf("%s",src.c_str());
|
display.printf("%s",src.c_str());
|
||||||
display.setCursor(0,OLED_LINE4);
|
display.setCursor(0,OLED_LINE4);
|
||||||
display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG" : "",dst.c_str());
|
display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
display.fillRect(0,OLED_LINE6,display.width(),20,BLACK);
|
display.fillRect(0,OLED_LINE6,display.width(),20,BLACK);
|
||||||
|
|
Loading…
Reference in a new issue