|
|
|
|
@ -163,16 +163,8 @@ void CAPRSWriter::clock(unsigned int ms)
|
|
|
|
|
|
|
|
|
|
if(m_idFrameProvider != nullptr) {
|
|
|
|
|
m_idFrameProvider->clock(ms);
|
|
|
|
|
|
|
|
|
|
if(m_idFrameProvider->wantsToSend() && m_thread->isConnected()) {
|
|
|
|
|
for(auto entry : m_array) {
|
|
|
|
|
std::vector<std::string> frames;
|
|
|
|
|
if(m_idFrameProvider->buildAPRSFrames(m_gateway, entry.second, frames)) {
|
|
|
|
|
for(auto frame : frames) {
|
|
|
|
|
m_thread->write(frame.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(m_idFrameProvider->wantsToSend()) {
|
|
|
|
|
sendIdFrames();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -182,6 +174,21 @@ void CAPRSWriter::clock(unsigned int ms)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CAPRSWriter::sendIdFrames()
|
|
|
|
|
{
|
|
|
|
|
if(m_thread->isConnected())
|
|
|
|
|
{
|
|
|
|
|
for(auto entry : m_array) {
|
|
|
|
|
std::vector<std::string> frames;
|
|
|
|
|
if(m_idFrameProvider->buildAPRSFrames(m_gateway, entry.second, frames)) {
|
|
|
|
|
for(auto frame : frames) {
|
|
|
|
|
m_thread->write(frame.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CAPRSWriter::isConnected() const
|
|
|
|
|
{
|
|
|
|
|
return m_thread->isConnected();
|
|
|
|
|
|