kopia lustrzana https://github.com/OpenRTX/OpenRTX
Always send an M17 EOT frame as the last frame before terminating baseband output
rodzic
a89a7523cb
commit
4a3bc93fa4
|
@ -22,8 +22,7 @@ def += {'FONT_UBUNTU_REGULAR': ''}
|
|||
## Firmware configuration parameters
|
||||
##
|
||||
|
||||
# Send an M17 EOT frame at the end of transmission
|
||||
#def += {'M17_ENABLE_EOT' : ''}
|
||||
#def += {}
|
||||
|
||||
|
||||
##
|
||||
|
|
|
@ -84,6 +84,14 @@ public:
|
|||
*/
|
||||
uint16_t encodeStreamFrame(const payload_t& payload, frame_t& output,
|
||||
const bool isLast = false);
|
||||
|
||||
/**
|
||||
* Encode an End Of Transmission marker frame.
|
||||
*
|
||||
* @param output: destination buffer for the encoded data.
|
||||
*/
|
||||
void encodeEotFrame(frame_t& output);
|
||||
|
||||
private:
|
||||
|
||||
M17ConvolutionalEncoder encoder; ///< Convolutional encoder.
|
||||
|
|
|
@ -80,8 +80,6 @@ public:
|
|||
|
||||
/**
|
||||
* Terminate baseband transmission.
|
||||
* If the macro M17_ENABLE_EOT is defined an EOT frame is sent before
|
||||
* terminating the transmission.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
|
|
|
@ -116,3 +116,12 @@ uint16_t M17FrameEncoder::encodeStreamFrame(const payload_t& payload,
|
|||
|
||||
return streamFrame.getFrameNumber();
|
||||
}
|
||||
|
||||
void M17::M17FrameEncoder::encodeEotFrame(M17::frame_t& output)
|
||||
{
|
||||
for(size_t i = 0; i < output.size(); i += 2)
|
||||
{
|
||||
output[i] = 0x55;
|
||||
output[i + 1] = 0x5D;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,27 +130,6 @@ void M17Modulator::stop()
|
|||
if(txRunning == false)
|
||||
return;
|
||||
|
||||
#ifdef M17_ENABLE_EOT
|
||||
frame_t eotFrame;
|
||||
// Fill EOT frame with 0x55, 0x5D as per M17 spec.
|
||||
for(size_t i = 0; i < eotFrame.size(); i += 2)
|
||||
{
|
||||
eotFrame[i] = 0x55;
|
||||
eotFrame[i + 1] = 0x5D;
|
||||
}
|
||||
|
||||
// Convert to symbols
|
||||
auto it = symbols.begin();
|
||||
for(size_t i = 0; i < eotFrame.size(); i++)
|
||||
{
|
||||
auto sym = byteToSymbols(eotFrame[i]);
|
||||
it = std::copy(sym.begin(), sym.end(), it);
|
||||
}
|
||||
|
||||
symbolsToBaseband();
|
||||
sendBaseband();
|
||||
#endif
|
||||
|
||||
outputStream_stop(outStream);
|
||||
outputStream_sync(outStream, false);
|
||||
txRunning = false;
|
||||
|
|
|
@ -242,5 +242,9 @@ void OpMode_M17::txState(rtxStatus_t *const status)
|
|||
modulator.send(m17Frame);
|
||||
|
||||
if(lastFrame)
|
||||
{
|
||||
encoder.encodeEotFrame(m17Frame);
|
||||
modulator.send(m17Frame);
|
||||
modulator.stop();
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue