From ad843e72835e05f2a2b6b60ad42c7ec21770cd6b Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Wed, 20 May 2020 18:07:57 +0200 Subject: [PATCH] do not write EOT when network is not set --- FMControl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FMControl.cpp b/FMControl.cpp index 18d90c5..0867914 100644 --- a/FMControl.cpp +++ b/FMControl.cpp @@ -41,6 +41,9 @@ bool CFMControl::writeModem(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); + if (m_network == NULL) + return true; + if (data[0U] == TAG_HEADER) return true; @@ -50,8 +53,6 @@ bool CFMControl::writeModem(const unsigned char* data, unsigned int length) if (data[0U] != TAG_DATA) return false; - if (m_network == NULL) - return true; m_incomingRFAudio.addData(data + 1U, length - 1U); unsigned int bufferLength = m_incomingRFAudio.dataSize();