mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-04 16:01:14 -05:00
Merge pull request #1621 from srcejon/android_fixes
Fix Navtex Android/clang compilation issues.
This commit is contained in:
commit
54288cf4c7
@ -340,7 +340,7 @@ void NavtexDemodSink::receiveBit(bool bit)
|
||||
{
|
||||
if (m_bitCount == 7)
|
||||
{
|
||||
char c = m_sitorBDecoder.decode(m_bits & 0x7f);
|
||||
signed char c = m_sitorBDecoder.decode(m_bits & 0x7f);
|
||||
if (c != -1)
|
||||
{
|
||||
//qDebug() << "Out: " << SitorBDecoder::printable(c);
|
||||
|
@ -7,6 +7,10 @@ These are broadcast worldwide on 518kHz (in English for international messages),
|
||||
Navtex messages are transmitted using FSK with 170Hz separation at 100 baud, using [SITOR-B](https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.625-4-201203-I!!PDF-E.pdf]) encoding.
|
||||
The [Map](../../feature/map/readme.md) feature can display the location of Navtex transmitters, along with their transmission times and frequencies.
|
||||
|
||||
The Navtex demodulator will only attempt to start demodulating data after it detects the phasing signal, that is broadcast before each message.
|
||||
Therefore, if you enable the demodulator part way through a message, it may take a while before you see any output, even if the signal appears strong,
|
||||
as the data rate is so low.
|
||||
|
||||
<h2>Interface</h2>
|
||||
|
||||
The top and bottom bars of the channel window are described [here](../../../sdrgui/channel/readme.md)
|
||||
|
@ -137,7 +137,7 @@ const QList<NavtexTransmitter> NavtexTransmitter::m_navtexTransmitters = {
|
||||
{6, "Ushuaia", -54.8, -68.3, {NavtexTransmitter::Schedule('M', 518000, {QTime(2, 0), QTime(6, 0), QTime(10, 0), QTime(14, 0), QTime(18, 0), QTime(22, 0)})}},
|
||||
{6, "Rio Gallegos", -51.616667, -69.216667, {NavtexTransmitter::Schedule('N', 518000, {QTime(2, 10), QTime(6, 10), QTime(10, 10), QTime(14, 10), QTime(18, 10), QTime(22, 10)})}},
|
||||
{6, "Comodoro Rivadavia", -45.85, -67.416667, {NavtexTransmitter::Schedule('O', 518000, {QTime(2, 20), QTime(6, 20), QTime(10, 20), QTime(14, 20), QTime(18, 20), QTime(22, 20)})}},
|
||||
{6, "Bahía Blanca", -38.716667, -62.1, {NavtexTransmitter::Schedule('P', 518000, {QTime(2, 30), QTime(6, 30), QTime(10, 30), QTime(14, 30), QTime(18, 30), QTime(22, 30)})}},
|
||||
{6, "Bahía Blanca", -38.716667, -62.1, {NavtexTransmitter::Schedule('P', 518000, {QTime(2, 30), QTime(6, 30), QTime(10, 30), QTime(14, 30), QTime(18, 30), QTime(22, 30)})}},
|
||||
{6, "Mar del Plata", -38.05, -57.533333, {NavtexTransmitter::Schedule('Q', 518000, {QTime(2, 40), QTime(6, 40), QTime(10, 40), QTime(14, 40), QTime(18, 40), QTime(22, 40)})}},
|
||||
{6, "Buenos Aires", -34.6, -58.366667, {NavtexTransmitter::Schedule('R', 518000, {QTime(2, 50), QTime(6, 50), QTime(10, 50), QTime(14, 50), QTime(18, 50), QTime(22, 50)})}},
|
||||
|
||||
@ -214,7 +214,7 @@ const QList<NavtexTransmitter> NavtexTransmitter::m_navtexTransmitters = {
|
||||
{13, "Astrakhan", 46.296694, 47.997778, {NavtexTransmitter::Schedule('W', 518000, {QTime(3, 40), QTime(7, 40), QTime(12, 40), QTime(15, 40), QTime(19, 40), QTime(23, 40)})}},
|
||||
|
||||
{15, "Antofagasta", -23.491333, -70.424778, {NavtexTransmitter::Schedule('A', 518000, {QTime(4, 0), QTime(12, 0), QTime(20, 0)})}},
|
||||
{15, "Valparaíso", -32.802222, -71.485, {NavtexTransmitter::Schedule('B', 518000, {QTime(4, 10), QTime(12, 10), QTime(20, 10)})}},
|
||||
{15, "Valparaíso", -32.802222, -71.485, {NavtexTransmitter::Schedule('B', 518000, {QTime(4, 10), QTime(12, 10), QTime(20, 10)})}},
|
||||
{15, "Talcahuano", -36.715056, -73.108, {NavtexTransmitter::Schedule('C', 518000, {QTime(4, 20), QTime(12, 20), QTime(20, 20)})}},
|
||||
{15, "Puerto Montt", -41.489983, -72.957744, {NavtexTransmitter::Schedule('D', 518000, {QTime(4, 30), QTime(12, 30), QTime(20, 30)})}},
|
||||
{15, "Punta Arenas", -52.948111, -71.056944, {NavtexTransmitter::Schedule('E', 518000, {QTime(4, 40), QTime(12, 40), QTime(20, 40)})}},
|
||||
@ -341,9 +341,9 @@ void SitorBDecoder::init()
|
||||
// ETX end of text
|
||||
// '*' both chars invalid
|
||||
// -1 no character available yet
|
||||
char SitorBDecoder::decode(char c)
|
||||
signed char SitorBDecoder::decode(signed char c)
|
||||
{
|
||||
char ret = -1;
|
||||
signed char ret = -1;
|
||||
|
||||
//qDebug() << "In: " << printable(ccir476Decode(c));
|
||||
|
||||
@ -380,13 +380,12 @@ char SitorBDecoder::decode(char c)
|
||||
m_state = FILL_DX;
|
||||
break;
|
||||
|
||||
|
||||
case RX:
|
||||
{
|
||||
// Try to decode a character
|
||||
char dx = ccir476Decode(m_buf[m_idx]);
|
||||
char rx = ccir476Decode(c);
|
||||
char a;
|
||||
signed char dx = ccir476Decode(m_buf[m_idx]);
|
||||
signed char rx = ccir476Decode(c);
|
||||
signed char a;
|
||||
|
||||
// Idle alpha (phasing 1) in both dx and rx means end of signal
|
||||
if ((dx == '<') && (rx == '<'))
|
||||
@ -432,7 +431,7 @@ char SitorBDecoder::decode(char c)
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString SitorBDecoder::printable(char c)
|
||||
QString SitorBDecoder::printable(signed char c)
|
||||
{
|
||||
if (c == -1) {
|
||||
return "Unknown";
|
||||
@ -447,7 +446,7 @@ QString SitorBDecoder::printable(char c)
|
||||
} else if (c == 0x7) {
|
||||
return "Bell";
|
||||
} else {
|
||||
return QString("%1").arg(c);
|
||||
return QString("%1").arg((char)c);
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,7 +454,7 @@ QString SitorBDecoder::printable(char c)
|
||||
|
||||
// https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.625-4-201203-I!!PDF-E.pdf
|
||||
|
||||
const char SitorBDecoder::m_ccir476LetterSetDecode[128] = {
|
||||
const signed char SitorBDecoder::m_ccir476LetterSetDecode[128] = {
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
@ -586,7 +585,7 @@ const char SitorBDecoder::m_ccir476LetterSetDecode[128] = {
|
||||
-1,
|
||||
};
|
||||
|
||||
const char SitorBDecoder::m_ccir476FigureSetDecode[128] = {
|
||||
const signed char SitorBDecoder::m_ccir476FigureSetDecode[128] = {
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
@ -717,7 +716,7 @@ const char SitorBDecoder::m_ccir476FigureSetDecode[128] = {
|
||||
-1,
|
||||
};
|
||||
|
||||
char SitorBDecoder::ccir476Decode(char c)
|
||||
signed char SitorBDecoder::ccir476Decode(signed char c)
|
||||
{
|
||||
if (m_figureSet) {
|
||||
return m_ccir476FigureSetDecode[(int)c];
|
||||
|
@ -80,15 +80,15 @@ class SDRBASE_API SitorBDecoder {
|
||||
public:
|
||||
|
||||
void init();
|
||||
char decode(char c);
|
||||
signed char decode(signed char c);
|
||||
int getErrors() const { return m_errors; }
|
||||
static QString printable(char c);
|
||||
static QString printable(signed char c);
|
||||
|
||||
private:
|
||||
static const char PHASING_1 = 0x78;
|
||||
static const char PHASING_2 = 0x33;
|
||||
static const signed char PHASING_1 = 0x78;
|
||||
static const signed char PHASING_2 = 0x33;
|
||||
static const int BUFFER_SIZE = 3;
|
||||
char m_buf[3];
|
||||
signed char m_buf[3];
|
||||
bool m_figureSet;
|
||||
enum State {
|
||||
PHASING,
|
||||
@ -100,10 +100,10 @@ private:
|
||||
int m_idx;
|
||||
int m_errors;
|
||||
|
||||
static const char m_ccir476LetterSetDecode[128];
|
||||
static const char m_ccir476FigureSetDecode[128];
|
||||
static const signed char m_ccir476LetterSetDecode[128];
|
||||
static const signed char m_ccir476FigureSetDecode[128];
|
||||
|
||||
char ccir476Decode(char c);
|
||||
signed char ccir476Decode(signed char c);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user