Use the header my callsign for the APRS callsign on a TH-D74.

This commit is contained in:
Jonathan Naylor 2018-07-17 19:15:25 +01:00
parent ba7d848f78
commit 71f388197f
5 changed files with 58 additions and 35 deletions

View file

@ -158,6 +158,21 @@ bool CAPRSWriter::open()
return m_thread->start();
}
void CAPRSWriter::writeHeader(const wxString& callsign, const CHeaderData& header)
{
CAPRSEntry* entry = m_array[callsign];
if (entry == NULL) {
wxLogError(wxT("Cannot find the callsign \"%s\" in the APRS array"), callsign.c_str());
return;
}
entry->reset();
CAPRSCollector* collector = entry->getCollector();
collector->writeHeader(header.getMyCall1());
}
void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data)
{
if (data.isEnd())
@ -179,7 +194,7 @@ void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data)
unsigned char buffer[400U];
data.getData(buffer, DV_FRAME_MAX_LENGTH_BYTES);
bool complete = collector->writeData(callsign, buffer + VOICE_FRAME_LENGTH_BYTES);
bool complete = collector->writeData(buffer + VOICE_FRAME_LENGTH_BYTES);
if (!complete)
return;
@ -230,17 +245,6 @@ void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data)
collector->reset();
}
void CAPRSWriter::reset(const wxString& callsign)
{
CAPRSEntry* entry = m_array[callsign];
if (entry == NULL) {
wxLogError(wxT("Cannot find the callsign \"%s\" in the APRS array"), callsign.c_str());
return;
}
entry->reset();
}
void CAPRSWriter::clock(unsigned int ms)
{
m_idTimer.clock(ms);