diff options
Diffstat (limited to 'Radio/Utils/TestAirSpyHF')
-rw-r--r-- | Radio/Utils/TestAirSpyHF/main.swift | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Radio/Utils/TestAirSpyHF/main.swift b/Radio/Utils/TestAirSpyHF/main.swift index 24a74f8..8166f2b 100644 --- a/Radio/Utils/TestAirSpyHF/main.swift +++ b/Radio/Utils/TestAirSpyHF/main.swift @@ -8,8 +8,23 @@ import Foundation import libairspyhf -print("Hello, World!") +print("Version \(software_version)") var libersion:airspyhf_lib_version_t = airspyhf_lib_version_t() airspyhf_lib_version(&libersion) -print("\(libersion.major_version)") +print("libairspyhf \(libersion.major_version).\(libersion.minor_version).\(libersion.revision)") + +let ndev = airspyhf_list_devices(nil, 0) +print("Found \(ndev) AirSpyHF devices") +if ndev < 0 { + exit(0) +} + +for i in 0..<ndev { + let serialPtr: UnsafeMutablePointer<UInt64> = .allocate(capacity: 1) + airspyhf_list_devices(serialPtr, i+1) + + print("Device \(i): \(serialPtr.pointee)") +} + + |