Add new EOT indicator.

m17
Rob Riggs 2021-09-05 12:36:37 -05:00
rodzic 1e1105e8df
commit 9a28e16a61
2 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -28,6 +28,7 @@ constexpr std::array<uint8_t, 2> LSF_SYNC = { 0x55, 0xF7 };
constexpr std::array<uint8_t, 2> STREAM_SYNC = { 0xFF, 0x5D };
constexpr std::array<uint8_t, 2> PACKET_SYNC = { 0x75, 0xFF };
constexpr std::array<uint8_t, 2> BERT_SYNC = { 0xDF, 0x55 };
constexpr std::array<uint8_t, 2> EOT_SYNC = { 0x55, 0x5D };
inline constexpr uint16_t sync_word(std::array<uint8_t, 2> sw)
{

Wyświetl plik

@ -378,6 +378,10 @@ void M17Encoder::send_stream(tnc::hdlc::IoFrame* frame, FrameType)
frame->clear(); // Re-use existing frame.
for (auto c : m17::STREAM_SYNC) frame->push_back(c);
for (auto c : m17_frame) frame->push_back(c);
if (state == State::IDLE)
{
for (auto c : m17::EOT_SYNC) frame->push_back(c);
}
auto status = osMessagePut(
m17EncoderInputQueueHandle,
@ -570,7 +574,11 @@ void M17Encoder::encoderTask(void const*)
HAL_IWDG_Refresh(&hiwdg);
auto frame = static_cast<IoFrame*>(evt.value.p);
if (frame->size() != 48)
if (frame->size() == 50)
{
INFO("EOT");
}
else if (frame->size() != 48)
{
WARN("Bad frame size %u", frame->size());
}