1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

Add extended ASCII support

This commit is contained in:
srcejon 2023-09-07 09:42:36 +01:00
parent ff87ebd247
commit 75c04ef9e7
2 changed files with 131 additions and 9 deletions

View File

@ -150,25 +150,149 @@ const QStringList PSK31Varicode::m_varicode = {
"1010110101",
"1011010111",
"1110110101",
"1110111101",
"1110111111",
"1111010101",
"1111010111",
"1111011011",
"1111011101",
"1111011111",
"1111101011",
"1111101101",
"1111101111",
"1111110101",
"1111110111",
"1111111011",
"1111111101",
"1111111111",
"10101010101",
"10101010111",
"10101011011",
"10101011101",
"10101011111",
"10101101011",
"10101101101",
"10101101111",
"10101110101",
"10101110111",
"10101111011",
"10101111101",
"10101111111",
"10110101011",
"10110101101",
"10110101111",
"10110110101",
"10110110111",
"10110111011",
"10110111101",
"10110111111",
"10111010101",
"10111010111",
"10111011011",
"10111011101",
"10111011111",
"10111101011",
"10111101101",
"10111101111",
"10111110101",
"10111110111",
"10111111011",
"10111111101",
"10111111111",
"11010101011",
"11010101101",
"11010101111",
"11010110101",
"11010110111",
"11010111011",
"11010111101",
"11010111111",
"11011010101",
"11011010111",
"11011011011",
"11011011101",
"11011011111",
"11011101011",
"11011101101",
"11011101111",
"11011110101",
"11011110111",
"11011111011",
"11011111101",
"11011111111",
"11101010101",
"11101010111",
"11101011011",
"11101011101",
"11101011111",
"11101101011",
"11101101101",
"11101101111",
"11101110101",
"11101110111",
"11101111011",
"11101111101",
"11101111111",
"11110101011",
"11110101101",
"11110101111",
"11110110101",
"11110110111",
"11110111011",
"11110111101",
"11110111111",
"11111010101",
"11111010111",
"11111011011",
"11111011101",
"11111011111",
"11111101011",
"11111101101",
"11111101111",
"11111110101",
"11111110111",
"11111111011",
"11111111101",
"11111111111",
"101010101011",
"101010101101",
"101010101111",
"101010110101",
"101010110111",
"101010111011",
"101010111101",
"101010111111",
"101011010101",
"101011010111",
"101011011011",
"101011011101",
"101011011111",
"101011101011",
"101011101101",
"101011101111",
"101011110101",
"101011110111",
"101011111011",
"101011111101",
"101011111111",
"101101010101",
"101101010111",
"101101011011"
};
PSK31Encoder::PSK31Encoder()
{
}
bool PSK31Encoder::encode(QChar c, unsigned &bits, unsigned int &bitCount)
{
bits = 0;
bitCount = 0;
char ch = c.toLatin1() & 0x7f;
unsigned char ch = (unsigned char) c.toLatin1();
QString code = PSK31Varicode::m_varicode[ch];
// FIXME: http://det.bi.ehu.es/~jtpjatae/pdf/p31g3plx.pdf > 128
addCode(bits, bitCount, code);
qDebug() << "Encoding " << c << "as" << code << bits << bitCount;
return true;
}
@ -194,7 +318,7 @@ void PSK31Encoder::addStartBits(unsigned& bits, unsigned int& bitCount) const
void PSK31Encoder::addStopBits(unsigned& bits, unsigned int& bitCount) const
{
// Stop bit is 1
// Stop bit is 0
addBits(bits, bitCount, 0, 1);
}

View File

@ -19,8 +19,6 @@
#define INCLUDE_UTIL_PSK31_H
#include <QString>
#include <QDateTime>
#include <QMap>
#include "export.h"
@ -28,7 +26,7 @@ class SDRBASE_API PSK31Varicode {
public:
static const QStringList m_varicode; // Index with 7-bit ASCII
static const QStringList m_varicode; // Index with 8-bit extended-ASCII
};