mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 05:22:25 -04:00
Hexadecimal.
This commit is contained in:
parent
df7aef1379
commit
c513f5ca04
@ -22,7 +22,7 @@ short LoRaDemod::toGray(short num)
|
|||||||
return (num >> 1) ^ num;
|
return (num >> 1) ^ num;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore FEC, data in lsb
|
// ignore FEC, try data in lsb, bigendian
|
||||||
void LoRaDemod::hamming(char* inout, int size)
|
void LoRaDemod::hamming(char* inout, int size)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -35,11 +35,11 @@ void LoRaDemod::hamming(char* inout, int size)
|
|||||||
inout[i] = 0;
|
inout[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// data whitening
|
// example data whitening (4 bit only - needs 6 bit for FEC)
|
||||||
void LoRaDemod::prng(char* inout, int size)
|
void LoRaDemod::prng(char* inout, int size)
|
||||||
{
|
{
|
||||||
const char otp[] = {
|
const char otp[] = {
|
||||||
" "
|
"EHFGKHGMGKGMGHG@FKDN@EHBMGBOLFALO@GIBIICJNMDFIDHAHJHMHBBHLHCHLH@IINCAOJFMLF@EKBDIAJKMNBEMBGMBKLMAHOHFHDB@DH@H@HAIKKDKAOKGDBAMIGIBCMLGCFODFAFNLECBLIHKHNBALJA"
|
||||||
};
|
};
|
||||||
int i, maxchars;
|
int i, maxchars;
|
||||||
|
|
||||||
@ -47,6 +47,6 @@ void LoRaDemod::prng(char* inout, int size)
|
|||||||
if (size < maxchars)
|
if (size < maxchars)
|
||||||
maxchars = size;
|
maxchars = size;
|
||||||
for (i = 0; i < maxchars; i++)
|
for (i = 0; i < maxchars; i++)
|
||||||
inout[i] ^= otp[i] - 32;
|
inout[i] ^= otp[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ void LoRaDemod::configure(MessageQueue* messageQueue, Real Bandwidth)
|
|||||||
|
|
||||||
void LoRaDemod::dumpRaw()
|
void LoRaDemod::dumpRaw()
|
||||||
{
|
{
|
||||||
|
char hex[] = {"0123456789ABCDEFXXXX"};
|
||||||
short bin, j, max;
|
short bin, j, max;
|
||||||
max = m_time / 4 - 3;
|
max = m_time / 4 - 3;
|
||||||
if (max > 80)
|
if (max > 80)
|
||||||
@ -84,12 +85,17 @@ void LoRaDemod::dumpRaw()
|
|||||||
}
|
}
|
||||||
for ( j=0; j < max; j+=6)
|
for ( j=0; j < max; j+=6)
|
||||||
interleave(&text[j]);
|
interleave(&text[j]);
|
||||||
prng(text, max); // ??
|
prng(text, max);
|
||||||
hamming(text, max);
|
hamming(text, max);
|
||||||
for ( j=0; j < max; j++)
|
for ( j=0; j < max; j++) {
|
||||||
text[j] += 64; // 4 bits per symbol
|
text[j] = hex[ (0xf & text[j]) ];
|
||||||
|
}
|
||||||
|
// for ( j=0; j < max / 2; j++) {
|
||||||
|
// if ((text[j] < 32 )||( text[j] > 126))
|
||||||
|
// text[j] = 0x5f;
|
||||||
|
// }
|
||||||
text[j] = 0;
|
text[j] = 0;
|
||||||
printf(">%s<\n", text);
|
printf("%s\n", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
short LoRaDemod::synch(short bin)
|
short LoRaDemod::synch(short bin)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user