#9 fix unsupported frames trigerring tx

pull/32/head
Geoffrey Merck 4 years ago
parent 17268c243f
commit 58e2e74c5b

10
.vscode/tasks.json vendored

@ -12,7 +12,10 @@
"ENABLE_DEBUG=1", "ENABLE_DEBUG=1",
"USE_GPSD=1" "USE_GPSD=1"
], ],
"group": "build", "group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [] "problemMatcher": []
}, },
{ {
@ -25,10 +28,7 @@
"ENABLE_DEBUG=1", "ENABLE_DEBUG=1",
"USE_GPSD=1" "USE_GPSD=1"
], ],
"group": { "group": "build",
"kind": "build",
"isDefault": true
},
"problemMatcher": [] "problemMatcher": []
} }
] ]

@ -51,13 +51,17 @@ void CAPRSUnit::clock(unsigned int ms)
{ {
m_timer.clock(ms); m_timer.clock(ms);
if(m_status == APS_IDLE && !m_frameBuffer.empty() && m_timer.hasExpired()) { if(m_status == APS_IDLE && !m_frameBuffer.empty() && m_timer.hasExpired()) {
m_status = APS_TRANSMIT;
auto frame = m_frameBuffer.front(); auto frame = m_frameBuffer.front();
m_frameBuffer.pop_front(); m_frameBuffer.pop_front();
m_headerData = new CHeaderData(); m_headerData = new CHeaderData();
std::string dprs, text; std::string dprs, text;
CAPRSToDPRS::aprsToDPRS(dprs, text, *m_headerData, *frame); if(!CAPRSToDPRS::aprsToDPRS(dprs, text, *m_headerData, *frame)) {
delete m_headerData;
m_headerData = nullptr;
return;
}
m_slowData = new CSlowDataEncoder(); m_slowData = new CSlowDataEncoder();
@ -73,6 +77,7 @@ void CAPRSUnit::clock(unsigned int ms)
m_seq = 0U; m_seq = 0U;
m_start = std::chrono::high_resolution_clock::now(); m_start = std::chrono::high_resolution_clock::now();
m_status = APS_TRANSMIT;
return; return;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.