summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArturs Artamonovs <dos21h@gmail.com>2023-03-06 23:14:39 +0000
committerArturs Artamonovs <dos21h@gmail.com>2023-03-06 23:14:39 +0000
commit7d629e71afd4ef97c45ad2a0cbf93631aa4a9bc9 (patch)
tree3b3414922015b9419ef25963ae7ad311e03e9e17
parent669926aa70eb78ea8f0ada46355a617abae61832 (diff)
downloadpyairspyhf-7d629e71afd4ef97c45ad2a0cbf93631aa4a9bc9.tar.gz
pyairspyhf-7d629e71afd4ef97c45ad2a0cbf93631aa4a9bc9.zip
Add arguments to rx.
-rw-r--r--README.md14
-rw-r--r--airspyhf_rx.py11
-rw-r--r--airspyhf_shedule.py0
3 files changed, 20 insertions, 5 deletions
diff --git a/README.md b/README.md
index c2a58ff..50cd170 100644
--- a/README.md
+++ b/README.md
@@ -6,12 +6,22 @@ https://github.com/airspy/airspyhf.git
Project webpage main.lv
+http://git.main.lv/cgit.cgi/pyairspyhf.git
-
-## Sourcecode
+# Source code
git clone https://git.main.lv/cgit/pyairspyhf.git
+# API
+## libairspyhf
+
+## AirSpyHF
+
+# Examples
+
+## airspyhf_rx.py
+
+
## Install
## Links
diff --git a/airspyhf_rx.py b/airspyhf_rx.py
index 9770054..da0e32e 100644
--- a/airspyhf_rx.py
+++ b/airspyhf_rx.py
@@ -14,8 +14,6 @@ parser.add_argument("--outputfile")
parser.add_argument("--serial")
args = parser.parse_args()
-
-
print("Check airspyHF version")
p = airspyhf_lib_version_t()
@@ -25,6 +23,8 @@ print(f"libairspyhf version {p.major_version}.{p.minor_version}.{p.revision}")
print("Get list of devices if there is any")
ndev = libairspyhf.airspyhf_list_devices(None,0)
print("Found %d devices"%(ndev))
+if ndev < 1:
+ sys.exit(0)
for devi in range(0,ndev):
serial = c_uint64(0)
@@ -33,7 +33,12 @@ for devi in range(0,ndev):
print("try to open device")
dev_p = airspyhf_device_t_p(None)
-ret = libairspyhf.airspyhf_open_sn(dev_p,0x3b52ab5dada12535)
+if args.serial != None:
+ ret = libairspyhf.airspyhf_open_sn(dev_p, args.serial)
+else:
+ serial = c_uint64(0)
+ libairspyhf.airspyhf_list_devices(byref(serial), 1)
+ ret = libairspyhf.airspyhf_open_sn(dev_p, f"{hex(serial.value)}")
print("open_sn: Returned %d"%(ret))
if (ret != 0):
print("airspyhf_open_sn returned != 0, error")
diff --git a/airspyhf_shedule.py b/airspyhf_shedule.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/airspyhf_shedule.py