mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-15 16:24:11 +02:00
Compare commits
2
Commits
AX25
...
pocsag_test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07e18ffcfb | ||
|
|
0092d6d9c3 |
+7
-3
@@ -57,9 +57,11 @@ void CPOCSAGTX::process()
|
|||||||
|
|
||||||
if (m_poLen == 0U) {
|
if (m_poLen == 0U) {
|
||||||
if (!m_tx) {
|
if (!m_tx) {
|
||||||
|
DEBUG1("MMDVM, sending preamble");
|
||||||
for (uint16_t i = 0U; i < m_txDelay; i++)
|
for (uint16_t i = 0U; i < m_txDelay; i++)
|
||||||
m_poBuffer[m_poLen++] = POCSAG_SYNC;
|
m_poBuffer[m_poLen++] = POCSAG_SYNC;
|
||||||
} else {
|
} else {
|
||||||
|
DEBUG2("MMDVM, sending", m_buffer.get());
|
||||||
for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) {
|
for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) {
|
||||||
uint8_t c = m_buffer.get();
|
uint8_t c = m_buffer.get();
|
||||||
m_poBuffer[m_poLen++] = c;
|
m_poBuffer[m_poLen++] = c;
|
||||||
@@ -89,14 +91,16 @@ void CPOCSAGTX::process()
|
|||||||
|
|
||||||
uint8_t CPOCSAGTX::writeData(const uint8_t* data, uint8_t length)
|
uint8_t CPOCSAGTX::writeData(const uint8_t* data, uint8_t length)
|
||||||
{
|
{
|
||||||
if (length != POCSAG_FRAME_LENGTH_BYTES)
|
if (length != (POCSAG_FRAME_LENGTH_BYTES + 1U))
|
||||||
return 4U;
|
return 4U;
|
||||||
|
|
||||||
uint16_t space = m_buffer.getSpace();
|
uint16_t space = m_buffer.getSpace();
|
||||||
if (space < POCSAG_FRAME_LENGTH_BYTES)
|
if (space < (POCSAG_FRAME_LENGTH_BYTES + 1U))
|
||||||
return 5U;
|
return 5U;
|
||||||
|
|
||||||
for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++)
|
DEBUG2("MMDVM, queueing", data[0U]);
|
||||||
|
|
||||||
|
for (uint8_t i = 0U; i < (POCSAG_FRAME_LENGTH_BYTES + 1U); i++)
|
||||||
m_buffer.put(data[i]);
|
m_buffer.put(data[i]);
|
||||||
|
|
||||||
return 0U;
|
return 0U;
|
||||||
|
|||||||
Reference in New Issue
Block a user