kopia lustrzana https://github.com/F5OEO/rpitx
Add an easy menu for testing
rodzic
550eaab290
commit
a8b7756681
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
status="0"
|
||||
while [ "$status" -eq 0 ]
|
||||
do
|
||||
|
||||
menuchoice=$(whiptail --title "Rpitx on 434Mhz" --menu "Choose your test, ctrl^c to end a test" 16 82 8 \
|
||||
"0 Tune" "Carrier" \
|
||||
"1 Chirp" "Moving carrier" \
|
||||
"2 Spectrum" "Spectrum painting" \
|
||||
"3 FmRds" "Broadcast modulation with RDS" \
|
||||
"4 SSB" "USB modulation" \
|
||||
"5 SSTV" "Patern picture" \
|
||||
"6 Opera" "Like morse but need Opera decoder" \
|
||||
"7 Pocsag" "Pager message" \
|
||||
"8 FreeDV" "Digital voice mode 800XA" \
|
||||
3>&2 2>&1 1>&3)
|
||||
|
||||
case "$menuchoice" in
|
||||
0\ *) "./testvfo.sh" >/dev/null 2>/dev/null ;;
|
||||
1\ *) "./testchirp.sh" >/dev/null 2>/dev/null ;;
|
||||
2\ *) "./testspectrum.sh" >/dev/null 2>/dev/null ;;
|
||||
3\ *) "./testfmrds.sh" >/dev/null 2>/dev/null ;;
|
||||
4\ *) "./testssb.sh" >/dev/null 2>/dev/null ;;
|
||||
5\ *) "./testsstv.sh" >/dev/null 2>/dev/null ;;
|
||||
6\ *) "./testopera.sh" >/dev/null 2>/dev/null ;;
|
||||
7\ *) "./testpocsag.sh" >/dev/null 2>/dev/null ;;
|
||||
8\ *) "./testfreedv.sh" >/dev/null 2>/dev/null ;;
|
||||
*) status=1;;
|
||||
esac
|
||||
|
||||
done
|
||||
exit
|
|
@ -28,16 +28,17 @@
|
|||
//#include <locale.h>
|
||||
//#include <tchar.h>
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "cstring"
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "stdint.h"
|
||||
#include "math.h"
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include "../librpitx/src/librpitx.h"
|
||||
|
||||
bool running=true;
|
||||
//#define __VCpp__ TRUE
|
||||
|
||||
// Grobal Variables
|
||||
|
@ -137,6 +138,14 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||
return 0;
|
||||
} // end of _tmain
|
||||
|
||||
static void
|
||||
terminate(int num)
|
||||
{
|
||||
running=false;
|
||||
fprintf(stderr,"Caught signal - Terminating %x\n",num);
|
||||
|
||||
}
|
||||
|
||||
//*******************
|
||||
void genn_opera(float mode)
|
||||
//*******************
|
||||
|
@ -165,7 +174,15 @@ void genn_opera(float mode)
|
|||
print_short_int("symbol_interleaving =", symbol_interleaving, 119);
|
||||
|
||||
ManchesterEncode(symbol_interleaving, symbol);
|
||||
//print_short_int("symbol =", symbol, 239);
|
||||
|
||||
for (int i = 0; i < 64; i++) {
|
||||
struct sigaction sa;
|
||||
|
||||
std::memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = terminate;
|
||||
sigaction(i, &sa, NULL);
|
||||
}
|
||||
|
||||
encodepitx(symbol,239,mode);
|
||||
|
||||
} // genn_opera
|
||||
|
@ -451,7 +468,7 @@ with the Opera frequency recommendation: */
|
|||
int FifoSize=512;
|
||||
amdmasync amtest(Frequency,SR,14,FifoSize);
|
||||
int count=0;
|
||||
for (int i = 0; i < length-1; )
|
||||
for (int i = 0; (i < length-1)&&(running==true); )
|
||||
{
|
||||
int Available=amtest.GetBufferAvailable();
|
||||
if(Available>FifoSize/2)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
@ -22,7 +22,7 @@ int FileFreqTiming;
|
|||
iqdmasync *fmmod;
|
||||
static double GlobalTuningFrequency=00000.0;
|
||||
int FifoSize=35000;
|
||||
|
||||
bool running=true;
|
||||
|
||||
void ProcessPicture(float Excursion)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ void ProcessPicture(float Excursion)
|
|||
|
||||
//while(1)
|
||||
{
|
||||
while(EndOfPicture==0)
|
||||
while((EndOfPicture==0)&&(running==true))
|
||||
{
|
||||
NbRead=read(FilePicture,Line,320);
|
||||
if(NbRead!=320) EndOfPicture=1;
|
||||
|
@ -57,6 +57,14 @@ void ProcessPicture(float Excursion)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
terminate(int num)
|
||||
{
|
||||
running=false;
|
||||
fprintf(stderr,"Caught signal - Terminating %x\n",num);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
@ -78,7 +86,15 @@ int main(int argc, char **argv)
|
|||
printf("usage : spectrum picture.rgb frequency(Hz) Excursion(Hz)\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < 64; i++) {
|
||||
struct sigaction sa;
|
||||
|
||||
std::memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = terminate;
|
||||
sigaction(i, &sa, NULL);
|
||||
}
|
||||
|
||||
fmmod=new iqdmasync(frequency,10000,14,FifoSize,MODE_FREQ_A);
|
||||
ProcessPicture(Excursion);
|
||||
close(FilePicture);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
@ -14,6 +14,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
|
||||
#include "../librpitx/src/librpitx.h"
|
||||
|
||||
int FilePicture;
|
||||
|
@ -22,6 +23,7 @@ int FileFreqTiming;
|
|||
ngfmdmasync *fmmod;
|
||||
static double GlobalTuningFrequency=00000.0;
|
||||
int FifoSize=10000; //10ms
|
||||
bool running=true;
|
||||
|
||||
void playtone(double Frequency,uint32_t Timing)//Timing in 0.1us
|
||||
{
|
||||
|
@ -122,7 +124,7 @@ void ProcessMartin1()
|
|||
|
||||
addvisheader();
|
||||
addvistrailer();
|
||||
while(EndOfPicture==0)
|
||||
while((EndOfPicture==0)&&(running==true))
|
||||
{
|
||||
NbRead=read(FilePicture,Line,320*3);
|
||||
if(NbRead!=320*3) EndOfPicture=1;
|
||||
|
@ -157,6 +159,14 @@ void ProcessMartin1()
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
terminate(int num)
|
||||
{
|
||||
running=false;
|
||||
fprintf(stderr,"Caught signal - Terminating %x\n",num);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
float frequency=144.5e6;
|
||||
|
@ -174,6 +184,14 @@ int main(int argc, char **argv)
|
|||
exit(0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 64; i++) {
|
||||
struct sigaction sa;
|
||||
|
||||
std::memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = terminate;
|
||||
sigaction(i, &sa, NULL);
|
||||
}
|
||||
|
||||
fmmod=new ngfmdmasync(frequency,100000,14,FifoSize);
|
||||
ProcessMartin1();
|
||||
close(FilePicture);
|
||||
|
|
Ładowanie…
Reference in New Issue