mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-23 08:45:48 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
56
Conf.cpp
56
Conf.cpp
@@ -78,13 +78,6 @@ m_modemTXDelay(100U),
|
|||||||
m_modemDMRDelay(0U),
|
m_modemDMRDelay(0U),
|
||||||
m_modemRXLevel(100U),
|
m_modemRXLevel(100U),
|
||||||
m_modemTXLevel(100U),
|
m_modemTXLevel(100U),
|
||||||
m_modemDStarLevel(0),
|
|
||||||
m_modemDMRLevel1(0),
|
|
||||||
m_modemDMRLevel3(0),
|
|
||||||
m_modemYSFLevel1(0),
|
|
||||||
m_modemYSFLevel3(0),
|
|
||||||
m_modemDMRThreshold(0),
|
|
||||||
m_modemYSFThreshold(0),
|
|
||||||
m_modemOscOffset(0),
|
m_modemOscOffset(0),
|
||||||
m_modemDebug(false),
|
m_modemDebug(false),
|
||||||
m_dstarEnabled(true),
|
m_dstarEnabled(true),
|
||||||
@@ -279,20 +272,6 @@ bool CConf::read()
|
|||||||
m_modemRXLevel = (unsigned int)::atoi(value);
|
m_modemRXLevel = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "TXLevel") == 0)
|
else if (::strcmp(key, "TXLevel") == 0)
|
||||||
m_modemTXLevel = (unsigned int)::atoi(value);
|
m_modemTXLevel = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "DStarLevel") == 0)
|
|
||||||
m_modemDStarLevel = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "DMRLevel1") == 0)
|
|
||||||
m_modemDMRLevel1 = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "DMRLevel3") == 0)
|
|
||||||
m_modemDMRLevel3 = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "YSFLevel1") == 0)
|
|
||||||
m_modemYSFLevel1 = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "YSFLevel3") == 0)
|
|
||||||
m_modemYSFLevel3 = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "DMRThreshold") == 0)
|
|
||||||
m_modemDMRThreshold = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "YSFThreshold") == 0)
|
|
||||||
m_modemYSFThreshold = ::atoi(value);
|
|
||||||
else if (::strcmp(key, "OscOffset") == 0)
|
else if (::strcmp(key, "OscOffset") == 0)
|
||||||
m_modemOscOffset = ::atoi(value);
|
m_modemOscOffset = ::atoi(value);
|
||||||
else if (::strcmp(key, "Debug") == 0)
|
else if (::strcmp(key, "Debug") == 0)
|
||||||
@@ -638,41 +617,6 @@ unsigned int CConf::getModemTXLevel() const
|
|||||||
return m_modemTXLevel;
|
return m_modemTXLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CConf::getModemDStarLevel() const
|
|
||||||
{
|
|
||||||
return m_modemDStarLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemDMRLevel1() const
|
|
||||||
{
|
|
||||||
return m_modemDMRLevel1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemDMRLevel3() const
|
|
||||||
{
|
|
||||||
return m_modemDMRLevel3;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemYSFLevel1() const
|
|
||||||
{
|
|
||||||
return m_modemYSFLevel1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemYSFLevel3() const
|
|
||||||
{
|
|
||||||
return m_modemYSFLevel3;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemDMRThreshold() const
|
|
||||||
{
|
|
||||||
return m_modemDMRThreshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemYSFThreshold() const
|
|
||||||
{
|
|
||||||
return m_modemYSFThreshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CConf::getModemOscOffset() const
|
int CConf::getModemOscOffset() const
|
||||||
{
|
{
|
||||||
return m_modemOscOffset;
|
return m_modemOscOffset;
|
||||||
|
|||||||
14
Conf.h
14
Conf.h
@@ -69,13 +69,6 @@ public:
|
|||||||
unsigned int getModemDMRDelay() const;
|
unsigned int getModemDMRDelay() const;
|
||||||
unsigned int getModemRXLevel() const;
|
unsigned int getModemRXLevel() const;
|
||||||
unsigned int getModemTXLevel() const;
|
unsigned int getModemTXLevel() const;
|
||||||
int getModemDStarLevel() const;
|
|
||||||
int getModemDMRLevel1() const;
|
|
||||||
int getModemDMRLevel3() const;
|
|
||||||
int getModemYSFLevel1() const;
|
|
||||||
int getModemYSFLevel3() const;
|
|
||||||
int getModemDMRThreshold() const;
|
|
||||||
int getModemYSFThreshold() const;
|
|
||||||
int getModemOscOffset() const;
|
int getModemOscOffset() const;
|
||||||
bool getModemDebug() const;
|
bool getModemDebug() const;
|
||||||
|
|
||||||
@@ -193,13 +186,6 @@ private:
|
|||||||
unsigned int m_modemDMRDelay;
|
unsigned int m_modemDMRDelay;
|
||||||
unsigned int m_modemRXLevel;
|
unsigned int m_modemRXLevel;
|
||||||
unsigned int m_modemTXLevel;
|
unsigned int m_modemTXLevel;
|
||||||
int m_modemDStarLevel;
|
|
||||||
int m_modemDMRLevel1;
|
|
||||||
int m_modemDMRLevel3;
|
|
||||||
int m_modemYSFLevel1;
|
|
||||||
int m_modemYSFLevel3;
|
|
||||||
int m_modemDMRThreshold;
|
|
||||||
int m_modemYSFThreshold;
|
|
||||||
int m_modemOscOffset;
|
int m_modemOscOffset;
|
||||||
bool m_modemDebug;
|
bool m_modemDebug;
|
||||||
|
|
||||||
|
|||||||
582
DMRIds.dat
582
DMRIds.dat
File diff suppressed because it is too large
Load Diff
13
DMRSlot.cpp
13
DMRSlot.cpp
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "DMRSlotType.h"
|
#include "DMRSlotType.h"
|
||||||
#include "DMRShortLC.h"
|
#include "DMRShortLC.h"
|
||||||
|
#include "DMRTrellis.h"
|
||||||
#include "DMRFullLC.h"
|
#include "DMRFullLC.h"
|
||||||
#include "BPTC19696.h"
|
#include "BPTC19696.h"
|
||||||
#include "DMRSlot.h"
|
#include "DMRSlot.h"
|
||||||
@@ -409,6 +410,12 @@ void CDMRSlot::writeModem(unsigned char *data)
|
|||||||
unsigned char payload[12U];
|
unsigned char payload[12U];
|
||||||
bptc.decode(data + 2U, payload);
|
bptc.decode(data + 2U, payload);
|
||||||
bptc.encode(payload, data + 2U);
|
bptc.encode(payload, data + 2U);
|
||||||
|
} else if (dataType == DT_RATE_34_DATA) {
|
||||||
|
LogDebug("DMR Slot %u, received RF rate 3/4 data", m_slotNo);
|
||||||
|
CDMRTrellis trellis;
|
||||||
|
unsigned char payload[18U];
|
||||||
|
trellis.decode(data + 2U, payload);
|
||||||
|
// trellis.encode(payload, data + 2U);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate the Slot Type
|
// Regenerate the Slot Type
|
||||||
@@ -1278,6 +1285,12 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
unsigned char payload[12U];
|
unsigned char payload[12U];
|
||||||
bptc.decode(data + 2U, payload);
|
bptc.decode(data + 2U, payload);
|
||||||
bptc.encode(payload, data + 2U);
|
bptc.encode(payload, data + 2U);
|
||||||
|
} else if (dataType == DT_RATE_34_DATA) {
|
||||||
|
LogDebug("DMR Slot %u, received network rate 3/4 data", m_slotNo);
|
||||||
|
CDMRTrellis trellis;
|
||||||
|
unsigned char payload[18U];
|
||||||
|
trellis.decode(data + 2U, payload);
|
||||||
|
// trellis.encode(payload, data + 2U);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate the Slot Type
|
// Regenerate the Slot Type
|
||||||
|
|||||||
156
DMRTrellis.cpp
Normal file
156
DMRTrellis.cpp
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 by Jonathan Naylor, G4KLX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; version 2 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "DMRTrellis.h"
|
||||||
|
#include "DMRDefines.h"
|
||||||
|
#include "Utils.h"
|
||||||
|
#include "Log.h"
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
const unsigned int INTERLEAVE_TABLE[] = {
|
||||||
|
0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U,
|
||||||
|
1U, 5U, 9U, 13U, 17U, 21U, 25U, 29U, 33U, 37U, 41U, 45U,
|
||||||
|
2U, 6U, 10U, 14U, 18U, 22U, 26U, 30U, 34U, 38U, 42U, 46U,
|
||||||
|
3U, 7U, 11U, 15U, 19U, 23U, 27U, 31U, 35U, 39U, 43U, 47U};
|
||||||
|
|
||||||
|
const unsigned char DIBITS_TO_POINT[] = { 11U, 12U, 0U, 7U, 14U, 9U, 5U, 2U, 10U, 13U, 1U, 6U, 15U, 8U, 4U, 3U};
|
||||||
|
const unsigned char POINT_TO_DIBITS[] = {0x2U, 0xAU, 0x7U, 0xFU, 0xEU, 0x6U, 0xBU, 0x3U, 0xDU, 0x5U, 0x8U, 0x0U, 0x1U, 0x9U, 0x4U, 0xCU};
|
||||||
|
|
||||||
|
const unsigned char ENCODE_TABLE[] = {
|
||||||
|
0U, 8U, 4U, 12U, 2U, 10U, 6U, 14U,
|
||||||
|
4U, 12U, 2U, 10U, 6U, 14U, 0U, 8U,
|
||||||
|
1U, 9U, 5U, 13U, 3U, 11U, 7U, 15U,
|
||||||
|
5U, 13U, 3U, 11U, 7U, 15U, 1U, 9U,
|
||||||
|
3U, 11U, 7U, 15U, 1U, 9U, 5U, 13U,
|
||||||
|
7U, 15U, 1U, 9U, 5U, 13U, 3U, 11U,
|
||||||
|
2U, 10U, 6U, 14U, 0U, 8U, 4U, 12U,
|
||||||
|
6U, 14U, 0U, 8U, 4U, 12U, 2U, 10U
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsigned char BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U};
|
||||||
|
|
||||||
|
#define WRITE_BIT(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7])
|
||||||
|
#define READ_BIT(p,i) (p[(i)>>3] & BIT_MASK_TABLE[(i)&7])
|
||||||
|
|
||||||
|
CDMRTrellis::CDMRTrellis()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CDMRTrellis::~CDMRTrellis()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDMRTrellis::decode(const unsigned char* data, unsigned char* payload)
|
||||||
|
{
|
||||||
|
assert(data != NULL);
|
||||||
|
assert(payload != NULL);
|
||||||
|
|
||||||
|
CUtils::dump(1U, "Payload", data, DMR_FRAME_LENGTH_BYTES);
|
||||||
|
|
||||||
|
// unsigned char points[49U];
|
||||||
|
// deinterleave(data, points);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDMRTrellis::encode(const unsigned char* payload, unsigned char* data)
|
||||||
|
{
|
||||||
|
assert(payload != NULL);
|
||||||
|
assert(data != NULL);
|
||||||
|
|
||||||
|
unsigned char tribits[49U];
|
||||||
|
totribits(payload, tribits);
|
||||||
|
|
||||||
|
unsigned char points[49U];
|
||||||
|
unsigned char state = 0U;
|
||||||
|
|
||||||
|
for (unsigned int i = 0U; i < 49U; i++) {
|
||||||
|
unsigned char tribit = tribits[i];
|
||||||
|
|
||||||
|
points[i] = ENCODE_TABLE[state * 8U + tribit];
|
||||||
|
|
||||||
|
state = tribit;
|
||||||
|
}
|
||||||
|
|
||||||
|
interleave(points, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDMRTrellis::deinterleave(const unsigned char* data, unsigned char* points) const
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0U; i < 49U; i++) {
|
||||||
|
unsigned int n = INTERLEAVE_TABLE[i] * 4U;
|
||||||
|
if (n > 108U) n += 48U;
|
||||||
|
|
||||||
|
bool b1 = READ_BIT(data, n) != 0x00U;
|
||||||
|
n++;
|
||||||
|
bool b2 = READ_BIT(data, n) != 0x00U;
|
||||||
|
n++;
|
||||||
|
bool b3 = READ_BIT(data, n) != 0x00U;
|
||||||
|
n++;
|
||||||
|
bool b4 = READ_BIT(data, n) != 0x00U;
|
||||||
|
|
||||||
|
unsigned int dibits = 0U;
|
||||||
|
dibits |= b1 ? 8U : 0U;
|
||||||
|
dibits |= b2 ? 4U : 0U;
|
||||||
|
dibits |= b3 ? 2U : 0U;
|
||||||
|
dibits |= b4 ? 1U : 0U;
|
||||||
|
|
||||||
|
points[i] = DIBITS_TO_POINT[dibits];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDMRTrellis::interleave(const unsigned char* points, unsigned char* data) const
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0U; i < 49U; i++) {
|
||||||
|
unsigned char point = points[i];
|
||||||
|
unsigned char dibits = POINT_TO_DIBITS[point];
|
||||||
|
|
||||||
|
bool b1 = (dibits & 0x08U) == 0x08U;
|
||||||
|
bool b2 = (dibits & 0x04U) == 0x04U;
|
||||||
|
bool b3 = (dibits & 0x02U) == 0x02U;
|
||||||
|
bool b4 = (dibits & 0x01U) == 0x01U;
|
||||||
|
|
||||||
|
unsigned int n = INTERLEAVE_TABLE[i] * 4U;
|
||||||
|
if (n > 108U) n += 48U;
|
||||||
|
|
||||||
|
WRITE_BIT(data, n, b1);
|
||||||
|
n++;
|
||||||
|
WRITE_BIT(data, n, b2);
|
||||||
|
n++;
|
||||||
|
WRITE_BIT(data, n, b3);
|
||||||
|
n++;
|
||||||
|
WRITE_BIT(data, n, b4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDMRTrellis::totribits(const unsigned char* payload, unsigned char* tribits) const
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0U; i < 48U; i++) {
|
||||||
|
unsigned int n = 143U - i * 3U;
|
||||||
|
|
||||||
|
bool b1 = READ_BIT(payload, n) != 0x00U;
|
||||||
|
n--;
|
||||||
|
bool b2 = READ_BIT(payload, n) != 0x00U;
|
||||||
|
n--;
|
||||||
|
bool b3 = READ_BIT(payload, n) != 0x00U;
|
||||||
|
|
||||||
|
unsigned char tribit = 0U;
|
||||||
|
tribit |= b1 ? 4U : 0U;
|
||||||
|
tribit |= b2 ? 2U : 0U;
|
||||||
|
tribit |= b3 ? 1U : 0U;
|
||||||
|
|
||||||
|
tribits[i] = tribit;
|
||||||
|
}
|
||||||
|
|
||||||
|
tribits[48U] = 0U;
|
||||||
|
}
|
||||||
31
DMRTrellis.h
Normal file
31
DMRTrellis.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 by Jonathan Naylor, G4KLX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; version 2 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DMRTrellis_H
|
||||||
|
#define DMRTrellis_H
|
||||||
|
|
||||||
|
class CDMRTrellis {
|
||||||
|
public:
|
||||||
|
CDMRTrellis();
|
||||||
|
~CDMRTrellis();
|
||||||
|
|
||||||
|
void decode(const unsigned char* data, unsigned char* payload);
|
||||||
|
void encode(const unsigned char* payload, unsigned char* data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void deinterleave(const unsigned char* in, unsigned char* points) const;
|
||||||
|
void interleave(const unsigned char* points, unsigned char* out) const;
|
||||||
|
void totribits(const unsigned char* payload, unsigned char* tribits) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -54,7 +54,6 @@ m_slowData(),
|
|||||||
m_rfN(0U),
|
m_rfN(0U),
|
||||||
m_netN(0U),
|
m_netN(0U),
|
||||||
m_networkWatchdog(1000U, 0U, 1500U),
|
m_networkWatchdog(1000U, 0U, 1500U),
|
||||||
m_holdoffTimer(1000U, 0U, 500U),
|
|
||||||
m_rfTimeoutTimer(1000U, timeout),
|
m_rfTimeoutTimer(1000U, timeout),
|
||||||
m_netTimeoutTimer(1000U, timeout),
|
m_netTimeoutTimer(1000U, timeout),
|
||||||
m_packetTimer(1000U, 0U, 200U),
|
m_packetTimer(1000U, 0U, 200U),
|
||||||
@@ -171,7 +170,6 @@ bool CDStarControl::writeModem(unsigned char *data)
|
|||||||
|
|
||||||
m_rfHeader = header;
|
m_rfHeader = header;
|
||||||
|
|
||||||
m_holdoffTimer.stop();
|
|
||||||
m_ackTimer.stop();
|
m_ackTimer.stop();
|
||||||
|
|
||||||
m_rfBits = 1U;
|
m_rfBits = 1U;
|
||||||
@@ -388,10 +386,6 @@ unsigned int CDStarControl::readModem(unsigned char* data)
|
|||||||
if (m_queue.isEmpty())
|
if (m_queue.isEmpty())
|
||||||
return 0U;
|
return 0U;
|
||||||
|
|
||||||
// Don't relay data until the timer has stopped.
|
|
||||||
if (m_holdoffTimer.isRunning())
|
|
||||||
return 0U;
|
|
||||||
|
|
||||||
unsigned char len = 0U;
|
unsigned char len = 0U;
|
||||||
m_queue.getData(&len, 1U);
|
m_queue.getData(&len, 1U);
|
||||||
|
|
||||||
@@ -564,10 +558,6 @@ void CDStarControl::clock()
|
|||||||
m_ackTimer.stop();
|
m_ackTimer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_holdoffTimer.clock(ms);
|
|
||||||
if (m_holdoffTimer.isRunning() && m_holdoffTimer.hasExpired())
|
|
||||||
m_holdoffTimer.stop();
|
|
||||||
|
|
||||||
m_rfTimeoutTimer.clock(ms);
|
m_rfTimeoutTimer.clock(ms);
|
||||||
m_netTimeoutTimer.clock(ms);
|
m_netTimeoutTimer.clock(ms);
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ private:
|
|||||||
unsigned char m_rfN;
|
unsigned char m_rfN;
|
||||||
unsigned char m_netN;
|
unsigned char m_netN;
|
||||||
CTimer m_networkWatchdog;
|
CTimer m_networkWatchdog;
|
||||||
CTimer m_holdoffTimer;
|
|
||||||
CTimer m_rfTimeoutTimer;
|
CTimer m_rfTimeoutTimer;
|
||||||
CTimer m_netTimeoutTimer;
|
CTimer m_netTimeoutTimer;
|
||||||
CTimer m_packetTimer;
|
CTimer m_packetTimer;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ enum RPT_RF_STATE {
|
|||||||
RS_RF_LISTENING,
|
RS_RF_LISTENING,
|
||||||
RS_RF_LATE_ENTRY,
|
RS_RF_LATE_ENTRY,
|
||||||
RS_RF_AUDIO,
|
RS_RF_AUDIO,
|
||||||
RS_RF_DATA,
|
RS_RF_DATA
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RPT_NET_STATE {
|
enum RPT_NET_STATE {
|
||||||
|
|||||||
@@ -763,12 +763,10 @@ void CHD44780::clockInt(unsigned int ms)
|
|||||||
} else {
|
} else {
|
||||||
::lcdPosition(m_fd, (m_cols - (strlen(m_buffer1) == 8 ? 8 : 10)) / 2, m_rows == 2 ? 1 : 2);
|
::lcdPosition(m_fd, (m_cols - (strlen(m_buffer1) == 8 ? 8 : 10)) / 2, m_rows == 2 ? 1 : 2);
|
||||||
::lcdPrintf(m_fd, "%.*s", strlen(m_buffer1) == 8 ? 8 : 10, m_buffer1);
|
::lcdPrintf(m_fd, "%.*s", strlen(m_buffer1) == 8 ? 8 : 10, m_buffer1);
|
||||||
}
|
|
||||||
|
|
||||||
if (m_cols != 16U && m_rows != 2U) {
|
|
||||||
::lcdPosition(m_fd, (m_cols - strlen(m_buffer2)) / 2, m_rows == 2 ? 0 : 1);
|
::lcdPosition(m_fd, (m_cols - strlen(m_buffer2)) / 2, m_rows == 2 ? 0 : 1);
|
||||||
::lcdPrintf(m_fd, "%s", m_buffer2);
|
::lcdPrintf(m_fd, "%s", m_buffer2);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_clockDisplayTimer.start();
|
m_clockDisplayTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
MMDVM.ini
10
MMDVM.ini
@@ -40,13 +40,6 @@ TXDelay=100
|
|||||||
DMRDelay=0
|
DMRDelay=0
|
||||||
RXLevel=50
|
RXLevel=50
|
||||||
TXLevel=50
|
TXLevel=50
|
||||||
DStarLevel=0
|
|
||||||
DMRLevel1=0
|
|
||||||
DMRLevel3=0
|
|
||||||
YSFLevel1=0
|
|
||||||
YSFLevel3=0
|
|
||||||
DMRThreshold=0
|
|
||||||
YSFThreshold=0
|
|
||||||
OscOffset=0
|
OscOffset=0
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
@@ -71,7 +64,6 @@ TXHang=4
|
|||||||
#DstIdWhiteListSlot1=
|
#DstIdWhiteListSlot1=
|
||||||
#DstIdWhiteListSlot2=
|
#DstIdWhiteListSlot2=
|
||||||
|
|
||||||
|
|
||||||
[System Fusion]
|
[System Fusion]
|
||||||
Enable=1
|
Enable=1
|
||||||
|
|
||||||
@@ -96,7 +88,7 @@ Debug=0
|
|||||||
Enable=1
|
Enable=1
|
||||||
LocalAddress=127.0.0.1
|
LocalAddress=127.0.0.1
|
||||||
LocalPort=3200
|
LocalPort=3200
|
||||||
GwyAddress=c4fm.duckdns.org
|
GwyAddress=127.0.0.1
|
||||||
GwyPort=4200
|
GwyPort=4200
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
|
|||||||
@@ -648,13 +648,6 @@ bool CMMDVMHost::createModem()
|
|||||||
unsigned int colorCode = m_conf.getDMRColorCode();
|
unsigned int colorCode = m_conf.getDMRColorCode();
|
||||||
unsigned int rxFrequency = m_conf.getRxFrequency();
|
unsigned int rxFrequency = m_conf.getRxFrequency();
|
||||||
unsigned int txFrequency = m_conf.getTxFrequency();
|
unsigned int txFrequency = m_conf.getTxFrequency();
|
||||||
int dstarLevel = m_conf.getModemDStarLevel();
|
|
||||||
int dmrLevel1 = m_conf.getModemDMRLevel1();
|
|
||||||
int dmrLevel3 = m_conf.getModemDMRLevel3();
|
|
||||||
int ysfLevel1 = m_conf.getModemYSFLevel1();
|
|
||||||
int ysfLevel3 = m_conf.getModemYSFLevel3();
|
|
||||||
int dmrThreshold = m_conf.getModemDMRThreshold();
|
|
||||||
int ysfThreshold = m_conf.getModemYSFThreshold();
|
|
||||||
int oscOffset = m_conf.getModemOscOffset();
|
int oscOffset = m_conf.getModemOscOffset();
|
||||||
|
|
||||||
LogInfo("Modem Parameters");
|
LogInfo("Modem Parameters");
|
||||||
@@ -669,26 +662,10 @@ bool CMMDVMHost::createModem()
|
|||||||
LogInfo(" RX Frequency: %uHz", rxFrequency);
|
LogInfo(" RX Frequency: %uHz", rxFrequency);
|
||||||
LogInfo(" TX Frequency: %uHz", txFrequency);
|
LogInfo(" TX Frequency: %uHz", txFrequency);
|
||||||
|
|
||||||
if (dstarLevel != 0)
|
|
||||||
LogInfo(" D-Star Level: %.1f%%", float(dstarLevel) / 10.0F);
|
|
||||||
if (dmrLevel1 != 0)
|
|
||||||
LogInfo(" DMR Level 1: %.1f%%", float(dmrLevel1) / 10.0F);
|
|
||||||
if (dmrLevel3 != 0)
|
|
||||||
LogInfo(" DMR Level 3: %.1f%%", float(dmrLevel3) / 10.0F);
|
|
||||||
if (ysfLevel1 != 0)
|
|
||||||
LogInfo(" YSF Level 1: %.1f%%", float(ysfLevel1) / 10.0F);
|
|
||||||
if (ysfLevel3 != 0)
|
|
||||||
LogInfo(" YSF Level 3: %.1f%%", float(ysfLevel3) / 10.0F);
|
|
||||||
if (dmrThreshold != 0)
|
|
||||||
LogInfo(" DMR Threshold: %.1f%%", float(dmrThreshold) / 10.0F);
|
|
||||||
if (ysfThreshold != 0)
|
|
||||||
LogInfo(" YSF Threshold: %.1f%%", float(ysfThreshold) / 10.0F);
|
|
||||||
|
|
||||||
LogInfo(" Osc. Offset: %dppm", oscOffset);
|
LogInfo(" Osc. Offset: %dppm", oscOffset);
|
||||||
|
|
||||||
m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, rxLevel, txLevel, dmrDelay, oscOffset, debug);
|
m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, rxLevel, txLevel, dmrDelay, oscOffset, debug);
|
||||||
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled);
|
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled);
|
||||||
m_modem->setModeLevels(dstarLevel, dmrLevel1, dmrLevel3, ysfLevel1, ysfLevel3, dmrThreshold, ysfThreshold);
|
|
||||||
m_modem->setRFParams(rxFrequency, txFrequency);
|
m_modem->setRFParams(rxFrequency, txFrequency);
|
||||||
m_modem->setDMRParams(colorCode);
|
m_modem->setDMRParams(colorCode);
|
||||||
|
|
||||||
|
|||||||
@@ -165,6 +165,7 @@
|
|||||||
<ClInclude Include="DMRShortLC.h" />
|
<ClInclude Include="DMRShortLC.h" />
|
||||||
<ClInclude Include="DMRSlot.h" />
|
<ClInclude Include="DMRSlot.h" />
|
||||||
<ClInclude Include="DMRSlotType.h" />
|
<ClInclude Include="DMRSlotType.h" />
|
||||||
|
<ClInclude Include="DMRTrellis.h" />
|
||||||
<ClInclude Include="DStarControl.h" />
|
<ClInclude Include="DStarControl.h" />
|
||||||
<ClInclude Include="DStarDefines.h" />
|
<ClInclude Include="DStarDefines.h" />
|
||||||
<ClInclude Include="DStarHeader.h" />
|
<ClInclude Include="DStarHeader.h" />
|
||||||
@@ -218,6 +219,7 @@
|
|||||||
<ClCompile Include="DMRShortLC.cpp" />
|
<ClCompile Include="DMRShortLC.cpp" />
|
||||||
<ClCompile Include="DMRSlot.cpp" />
|
<ClCompile Include="DMRSlot.cpp" />
|
||||||
<ClCompile Include="DMRSlotType.cpp" />
|
<ClCompile Include="DMRSlotType.cpp" />
|
||||||
|
<ClCompile Include="DMRTrellis.cpp" />
|
||||||
<ClCompile Include="DStarControl.cpp" />
|
<ClCompile Include="DStarControl.cpp" />
|
||||||
<ClCompile Include="DStarHeader.cpp" />
|
<ClCompile Include="DStarHeader.cpp" />
|
||||||
<ClCompile Include="DStarNetwork.cpp" />
|
<ClCompile Include="DStarNetwork.cpp" />
|
||||||
|
|||||||
@@ -167,6 +167,9 @@
|
|||||||
<ClInclude Include="Thread.h">
|
<ClInclude Include="Thread.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="DMRTrellis.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="BPTC19696.cpp">
|
<ClCompile Include="BPTC19696.cpp">
|
||||||
@@ -307,5 +310,8 @@
|
|||||||
<ClCompile Include="Thread.cpp">
|
<ClCompile Include="Thread.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="DMRTrellis.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
4
Makefile
4
Makefile
@@ -8,8 +8,8 @@ LDFLAGS = -g
|
|||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
||||||
DMRShortLC.o DMRSlot.o DMRSlotType.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o Log.o MMDVMHost.o Modem.o \
|
DMRShortLC.o DMRSlot.o DMRSlotType.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o Log.o MMDVMHost.o \
|
||||||
Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o YSFControl.o \
|
Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o YSFControl.o \
|
||||||
YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
||||||
|
|
||||||
all: MMDVMHost
|
all: MMDVMHost
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ LDFLAGS = -g -L/usr/local/lib
|
|||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
||||||
DMRShortLC.o DMRSlot.o DMRSlotType.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o MMDVMHost.o \
|
DMRShortLC.o DMRSlot.o DMRSlotType.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o \
|
||||||
Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o YSFControl.o \
|
MMDVMHost.o Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o \
|
||||||
YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
||||||
|
|
||||||
all: MMDVMHost
|
all: MMDVMHost
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ LDFLAGS = -g -L/usr/local/lib
|
|||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
||||||
DMRShortLC.o DMRSlot.o DMRSlotType.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o MMDVMHost.o \
|
DMRShortLC.o DMRSlot.o DMRSlotType.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o \
|
||||||
Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o YSFControl.o \
|
MMDVMHost.o Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o \
|
||||||
YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
||||||
|
|
||||||
all: MMDVMHost
|
all: MMDVMHost
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ LDFLAGS = -g -L/usr/local/lib
|
|||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
||||||
DMRShortLC.o DMRSlot.o DMRSlotType.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o OLED.o Log.o MMDVMHost.o \
|
DMRShortLC.o DMRSlot.o DMRSlotType.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o OLED.o Log.o \
|
||||||
Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o YSFControl.o \
|
MMDVMHost.o Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o \
|
||||||
YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
||||||
|
|
||||||
all: MMDVMHost
|
all: MMDVMHost
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ LDFLAGS = -g -L/usr/local/lib
|
|||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \
|
||||||
DMRShortLC.o DMRSlot.o DMRSlotType.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o MMDVMHost.o \
|
DMRShortLC.o DMRSlot.o DMRSlotType.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o \
|
||||||
Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o YSFControl.o \
|
MMDVMHost.o Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o Utils.o \
|
||||||
YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
||||||
|
|
||||||
all: MMDVMHost
|
all: MMDVMHost
|
||||||
|
|
||||||
|
|||||||
36
Modem.cpp
36
Modem.cpp
@@ -87,13 +87,6 @@ m_txDelay(txDelay),
|
|||||||
m_dmrDelay(dmrDelay),
|
m_dmrDelay(dmrDelay),
|
||||||
m_rxLevel(rxLevel),
|
m_rxLevel(rxLevel),
|
||||||
m_txLevel(txLevel),
|
m_txLevel(txLevel),
|
||||||
m_dstarLevel(0),
|
|
||||||
m_dmrLevel1(0),
|
|
||||||
m_dmrLevel3(0),
|
|
||||||
m_ysfLevel1(0),
|
|
||||||
m_ysfLevel3(0),
|
|
||||||
m_dmrThreshold(0),
|
|
||||||
m_ysfThreshold(0),
|
|
||||||
m_oscOffset(oscOffset),
|
m_oscOffset(oscOffset),
|
||||||
m_debug(debug),
|
m_debug(debug),
|
||||||
m_rxFrequency(0U),
|
m_rxFrequency(0U),
|
||||||
@@ -140,17 +133,6 @@ void CModem::setRFParams(unsigned int rxFrequency, unsigned int txFrequency)
|
|||||||
m_txFrequency = txFrequency;
|
m_txFrequency = txFrequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModem::setModeLevels(int dstarLevel, int dmrLevel1, int dmrLevel3, int ysfLevel1, int ysfLevel3, int dmrThreshold, int ysfThreshold)
|
|
||||||
{
|
|
||||||
m_dstarLevel = dstarLevel;
|
|
||||||
m_dmrLevel1 = dmrLevel1;
|
|
||||||
m_dmrLevel3 = dmrLevel3;
|
|
||||||
m_ysfLevel1 = ysfLevel1;
|
|
||||||
m_ysfLevel3 = ysfLevel3;
|
|
||||||
m_dmrThreshold = dmrThreshold;
|
|
||||||
m_ysfThreshold = ysfThreshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled)
|
void CModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled)
|
||||||
{
|
{
|
||||||
m_dstarEnabled = dstarEnabled;
|
m_dstarEnabled = dstarEnabled;
|
||||||
@@ -761,13 +743,11 @@ bool CModem::readStatus()
|
|||||||
|
|
||||||
bool CModem::setConfig()
|
bool CModem::setConfig()
|
||||||
{
|
{
|
||||||
unsigned int length = m_duplex ? 19U : 12U;
|
|
||||||
|
|
||||||
unsigned char buffer[20U];
|
unsigned char buffer[20U];
|
||||||
|
|
||||||
buffer[0U] = MMDVM_FRAME_START;
|
buffer[0U] = MMDVM_FRAME_START;
|
||||||
|
|
||||||
buffer[1U] = length;
|
buffer[1U] = 12U;
|
||||||
|
|
||||||
buffer[2U] = MMDVM_SET_CONFIG;
|
buffer[2U] = MMDVM_SET_CONFIG;
|
||||||
|
|
||||||
@@ -800,18 +780,10 @@ bool CModem::setConfig()
|
|||||||
|
|
||||||
buffer[11U] = (unsigned char)(m_oscOffset + 128);
|
buffer[11U] = (unsigned char)(m_oscOffset + 128);
|
||||||
|
|
||||||
buffer[12U] = (unsigned char)(m_dstarLevel + 128);
|
// CUtils::dump(1U, "Written", buffer, 12U);
|
||||||
buffer[13U] = (unsigned char)(m_dmrLevel1 + 128);
|
|
||||||
buffer[14U] = (unsigned char)(m_dmrLevel3 + 128);
|
|
||||||
buffer[15U] = (unsigned char)(m_ysfLevel1 + 128);
|
|
||||||
buffer[16U] = (unsigned char)(m_ysfLevel3 + 128);
|
|
||||||
buffer[17U] = (unsigned char)(m_dmrThreshold + 128);
|
|
||||||
buffer[18U] = (unsigned char)(m_ysfThreshold + 128);
|
|
||||||
|
|
||||||
// CUtils::dump(1U, "Written", buffer, length);
|
int ret = m_serial.write(buffer, 12U);
|
||||||
|
if (ret != 12)
|
||||||
int ret = m_serial.write(buffer, length);
|
|
||||||
if (ret != int(length))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned int count = 0U;
|
unsigned int count = 0U;
|
||||||
|
|||||||
8
Modem.h
8
Modem.h
@@ -37,7 +37,6 @@ public:
|
|||||||
~CModem();
|
~CModem();
|
||||||
|
|
||||||
void setRFParams(unsigned int rxFrequency, unsigned int txFrequency);
|
void setRFParams(unsigned int rxFrequency, unsigned int txFrequency);
|
||||||
void setModeLevels(int dstarLevel, int dmrLevel1, int dmrLevel3, int ysfLevel1, int ysfLevel3, int dmrThreshold, int ysfThreshold);
|
|
||||||
void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled);
|
void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled);
|
||||||
void setDMRParams(unsigned int colorCode);
|
void setDMRParams(unsigned int colorCode);
|
||||||
|
|
||||||
@@ -86,13 +85,6 @@ private:
|
|||||||
unsigned int m_dmrDelay;
|
unsigned int m_dmrDelay;
|
||||||
unsigned int m_rxLevel;
|
unsigned int m_rxLevel;
|
||||||
unsigned int m_txLevel;
|
unsigned int m_txLevel;
|
||||||
int m_dstarLevel;
|
|
||||||
int m_dmrLevel1;
|
|
||||||
int m_dmrLevel3;
|
|
||||||
int m_ysfLevel1;
|
|
||||||
int m_ysfLevel3;
|
|
||||||
int m_dmrThreshold;
|
|
||||||
int m_ysfThreshold;
|
|
||||||
int m_oscOffset;
|
int m_oscOffset;
|
||||||
bool m_debug;
|
bool m_debug;
|
||||||
unsigned int m_rxFrequency;
|
unsigned int m_rxFrequency;
|
||||||
|
|||||||
12
RingBuffer.h
12
RingBuffer.h
@@ -109,13 +109,17 @@ public:
|
|||||||
|
|
||||||
unsigned int freeSpace() const
|
unsigned int freeSpace() const
|
||||||
{
|
{
|
||||||
if (m_oPtr == m_iPtr)
|
unsigned int len = m_length;
|
||||||
return m_length;
|
|
||||||
|
|
||||||
if (m_oPtr > m_iPtr)
|
if (m_oPtr > m_iPtr)
|
||||||
return m_oPtr - m_iPtr;
|
len = m_oPtr - m_iPtr;
|
||||||
|
else if (m_iPtr > m_oPtr)
|
||||||
|
len = m_length - (m_iPtr - m_oPtr);
|
||||||
|
|
||||||
return (m_length + m_oPtr) - m_iPtr;
|
if (len > m_length)
|
||||||
|
len = 0U;
|
||||||
|
|
||||||
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int dataSize() const
|
unsigned int dataSize() const
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ m_netState(RS_NET_IDLE),
|
|||||||
m_rfTimeoutTimer(1000U, timeout),
|
m_rfTimeoutTimer(1000U, timeout),
|
||||||
m_netTimeoutTimer(1000U, timeout),
|
m_netTimeoutTimer(1000U, timeout),
|
||||||
m_networkWatchdog(1000U, 0U, 1500U),
|
m_networkWatchdog(1000U, 0U, 1500U),
|
||||||
m_holdoffTimer(1000U, 0U, 500U),
|
|
||||||
m_rfFrames(0U),
|
m_rfFrames(0U),
|
||||||
m_netFrames(0U),
|
m_netFrames(0U),
|
||||||
m_rfErrs(0U),
|
m_rfErrs(0U),
|
||||||
@@ -90,8 +89,6 @@ bool CYSFControl::writeModem(unsigned char *data)
|
|||||||
if (fi == YSF_FI_TERMINATOR)
|
if (fi == YSF_FI_TERMINATOR)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_holdoffTimer.stop();
|
|
||||||
|
|
||||||
m_rfFrames = 0U;
|
m_rfFrames = 0U;
|
||||||
m_rfErrs = 0U;
|
m_rfErrs = 0U;
|
||||||
m_rfBits = 1U;
|
m_rfBits = 1U;
|
||||||
@@ -186,6 +183,8 @@ bool CYSFControl::writeModem(unsigned char *data)
|
|||||||
} else if (valid) {
|
} else if (valid) {
|
||||||
CSync::addYSFSync(data + 2U);
|
CSync::addYSFSync(data + 2U);
|
||||||
|
|
||||||
|
unsigned char bn = fich.getBN();
|
||||||
|
unsigned char bt = fich.getBT();
|
||||||
unsigned char fn = fich.getFN();
|
unsigned char fn = fich.getFN();
|
||||||
unsigned char ft = fich.getFT();
|
unsigned char ft = fich.getFT();
|
||||||
unsigned char dt = fich.getDT();
|
unsigned char dt = fich.getDT();
|
||||||
@@ -212,6 +211,7 @@ bool CYSFControl::writeModem(unsigned char *data)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case YSF_DT_DATA_FR_MODE:
|
case YSF_DT_DATA_FR_MODE:
|
||||||
|
LogDebug("YSF, RF data FICH B=%u/%u F=%u/%u", bn, bt, fn, ft);
|
||||||
valid = m_rfPayload.processDataFRModeData(data + 2U, fn);
|
valid = m_rfPayload.processDataFRModeData(data + 2U, fn);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -308,10 +308,6 @@ unsigned int CYSFControl::readModem(unsigned char* data)
|
|||||||
if (m_queue.isEmpty())
|
if (m_queue.isEmpty())
|
||||||
return 0U;
|
return 0U;
|
||||||
|
|
||||||
// Don't relay data until the timer has stopped.
|
|
||||||
if (m_holdoffTimer.isRunning())
|
|
||||||
return 0U;
|
|
||||||
|
|
||||||
unsigned char len = 0U;
|
unsigned char len = 0U;
|
||||||
m_queue.getData(&len, 1U);
|
m_queue.getData(&len, 1U);
|
||||||
|
|
||||||
@@ -430,10 +426,12 @@ void CYSFControl::writeNetwork()
|
|||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
bool valid = fich.decode(data + 35U);
|
bool valid = fich.decode(data + 35U);
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
unsigned char bn = fich.getBN();
|
||||||
|
unsigned char bt = fich.getBT();
|
||||||
unsigned char dt = fich.getDT();
|
unsigned char dt = fich.getDT();
|
||||||
unsigned char fn = fich.getFN();
|
unsigned char fn = fich.getFN();
|
||||||
unsigned char fi = fich.getFI();
|
|
||||||
unsigned char ft = fich.getFT();
|
unsigned char ft = fich.getFT();
|
||||||
|
unsigned char fi = fich.getFI();
|
||||||
|
|
||||||
// Set the downlink callsign
|
// Set the downlink callsign
|
||||||
switch (fi) {
|
switch (fi) {
|
||||||
@@ -463,6 +461,7 @@ void CYSFControl::writeNetwork()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case YSF_DT_DATA_FR_MODE:
|
case YSF_DT_DATA_FR_MODE:
|
||||||
|
LogDebug("YSF, Network data FICH B=%u/%u F=%u/%u", bn, bt, fn, ft);
|
||||||
m_netPayload.processDataFRModeData(data + 35U, fn, gateway);
|
m_netPayload.processDataFRModeData(data + 35U, fn, gateway);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -503,10 +502,6 @@ void CYSFControl::clock(unsigned int ms)
|
|||||||
if (m_network != NULL)
|
if (m_network != NULL)
|
||||||
writeNetwork();
|
writeNetwork();
|
||||||
|
|
||||||
m_holdoffTimer.clock(ms);
|
|
||||||
if (m_holdoffTimer.isRunning() && m_holdoffTimer.hasExpired())
|
|
||||||
m_holdoffTimer.stop();
|
|
||||||
|
|
||||||
m_rfTimeoutTimer.clock(ms);
|
m_rfTimeoutTimer.clock(ms);
|
||||||
m_netTimeoutTimer.clock(ms);
|
m_netTimeoutTimer.clock(ms);
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ private:
|
|||||||
CTimer m_rfTimeoutTimer;
|
CTimer m_rfTimeoutTimer;
|
||||||
CTimer m_netTimeoutTimer;
|
CTimer m_netTimeoutTimer;
|
||||||
CTimer m_networkWatchdog;
|
CTimer m_networkWatchdog;
|
||||||
CTimer m_holdoffTimer;
|
|
||||||
unsigned int m_rfFrames;
|
unsigned int m_rfFrames;
|
||||||
unsigned int m_netFrames;
|
unsigned int m_netFrames;
|
||||||
unsigned int m_rfErrs;
|
unsigned int m_rfErrs;
|
||||||
|
|||||||
10
YSFFICH.cpp
10
YSFFICH.cpp
@@ -169,6 +169,16 @@ unsigned char CYSFFICH::getCM() const
|
|||||||
return (m_fich[0U] >> 2) & 0x03U;
|
return (m_fich[0U] >> 2) & 0x03U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char CYSFFICH::getBN() const
|
||||||
|
{
|
||||||
|
return m_fich[0U] & 0x03U;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CYSFFICH::getBT() const
|
||||||
|
{
|
||||||
|
return (m_fich[1U] >> 6) & 0x03U;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned char CYSFFICH::getFN() const
|
unsigned char CYSFFICH::getFN() const
|
||||||
{
|
{
|
||||||
return (m_fich[1U] >> 3) & 0x07U;
|
return (m_fich[1U] >> 3) & 0x07U;
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ public:
|
|||||||
|
|
||||||
unsigned char getFI() const;
|
unsigned char getFI() const;
|
||||||
unsigned char getCM() const;
|
unsigned char getCM() const;
|
||||||
|
unsigned char getBN() const;
|
||||||
|
unsigned char getBT() const;
|
||||||
unsigned char getFN() const;
|
unsigned char getFN() const;
|
||||||
unsigned char getFT() const;
|
unsigned char getFT() const;
|
||||||
unsigned char getDT() const;
|
unsigned char getDT() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user