more refinements as per Jakob Ketterl suggestions

This commit is contained in:
Andrea Montefusco 2020-03-16 00:13:51 +01:00
parent 8e87aa0342
commit 68e8a77b1d
2 changed files with 27 additions and 19 deletions

View File

@ -158,9 +158,9 @@ class FeatureDetector(object):
```
sudo apt install libusb-1.0-0-dev
cd /tmp
wget https://github.com/Microtelecom/libperseus-sdr/releases/download/v0.7.5/libperseus_sdr-0.7.5.tar.gz
tar -zxvf libperseus_sdr-0.7.5.tar.gz
cd libperseus_sdr-0.7.5/
wget https://github.com/Microtelecom/libperseus-sdr/releases/download/v0.8.2/libperseus_sdr-0.8.2.tar.gz
tar -zxvf libperseus_sdr-0.8.2.tar.gz
cd libperseus_sdr-0.8.2/
./configure
make
sudo make install
@ -168,7 +168,7 @@ class FeatureDetector(object):
perseustest
```
"""
return self.command_is_runnable("perseustest -d -1 -a -t 1")
return self.command_is_runnable("perseustest -h")
def has_digiham(self):

View File

@ -3,29 +3,37 @@ from owrx.command import Flag, Option
#
# perseustest -s 768000 -u 0 -f 14150000 -r-|csdr convert_s8_f|nmux --bufsize 192512 --bufcnt 260 --port 35989 --address 127.0.0.1
# perseustest -a -t0 -o -
# perseustest -d 9 -a -t 100000 -o - -s 768000 -u 0 -f 14150000 -r-
# In order to interface Perseus hardware, we resolve to use the
# perseustest utility that comes with libperseus-sdr support package.
# Below the base options used are shown:
#
# -p output I/Q samples as 32 bits floating point
# -d -1 suppress debug messages
# -a don't test attenuators on startup
# -t 0 runs indefinitely
# -o - output samples on stdout
#
# As we are already returning I/Q samples as pairs of 32 bits
# floating points (option -p),no need for further conversions,
# so the method getFormatConversion(self) is not implemented at all.
class PerseussdrSource(DirectSource):
def getCommandMapper(self):
return super().getCommandMapper().setBase("perseustest -p -d -1 -a -t 100000 -o - ").setMappings(
return super().getCommandMapper().setBase("perseustest -p -d -1 -a -t 0 -o - ").setMappings(
{
"samp_rate": Option("-s"),
"tuner_freq": Option("-f"),
"rf_gain": Option("-u"),
"lna_gain": Option("-g"),
"rf_amp": Option("-x"),
"attenuator": Option("-u"),
"adc_preamp": Option("-m"),
"adc_dither": Option("-x"),
"wideband": Option("-w"),
}
).setStatic("-r-")
)
def getEventNames(self):
return super().getEventNames() + [
"lna_gain",
"rf_amp",
"attenuator",
"adc_preamp",
"adc_dither",
"wideband",
]
def getFormatConversion(self):
# return ["csdr convert_s24_f --bigendian"]
# return ["csdr convert_s24_f", "csdr gain_ff 20"]
return ["csdr gain_ff 20"]