Use the r3 pinned source for current read-only examples. From its repository root on the Linux PC, build as shown below, then run Python h102_api.py ... status, profiles or xml, and C++ h102_iio ... status or profiles. These queries were checked against Kuiper 1.2.1, ABI 1 and 58 profiles, without a password or IQ buffer. Expected default readback is 40msps-20mhz, 40000000 Hz sample rate and 20000000 Hz bandwidth per channel. A running device may have a different deliberately applied profile.
Repository and standalone package roots use the same layout:
Linux PC · Run in the tool or project directory named here; set paths to the actual installation and files.
EXAMPLE_ROOT="$PWD/examples/iio"
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r "$EXAMPLE_ROOT/requirements.txt"
cmake -S "$EXAMPLE_ROOT/cpp" -B cpp-build
cmake --build cpp-build -j 8
The Linux PC needs C++17, CMake and libiio 0.x (at least 0.23); Ubuntu packages are build-essential cmake libiio-dev. Python queries call libiio through standard-library ctypes.
Replace DEVICE_IP with the actual address:
Linux PC · Use the connected device’s actual IP or URI and your local installation paths.
python "$EXAMPLE_ROOT/python/h102_api.py" --uri ip:DEVICE_IP xml
python "$EXAMPLE_ROOT/python/h102_api.py" --uri ip:DEVICE_IP profiles
python "$EXAMPLE_ROOT/python/h102_api.py" --uri ip:DEVICE_IP status
python "$EXAMPLE_ROOT/python/h102_api.py" --uri ip:DEVICE_IP read adrv9002-phy frequency --channel altvoltage0 --output
python "$EXAMPLE_ROOT/python/h102_api.py" --uri ip:DEVICE_IP read adrv9002-phy hardwaregain --channel voltage0
./cpp-build/h102_iio ip:DEVICE_IP xml
./cpp-build/h102_iio ip:DEVICE_IP status
./cpp-build/h102_iio ip:DEVICE_IP read adrv9002-phy hardwaregain voltage0 in
Use xml to discover devices, channels and attributes dynamically; do not hardcode iio:device numbers. status checks state and sequence consistently without creating a sample buffer.
Stop other data clients first. Success requires completed application and actual readback.
Linux PC · Use the connected device’s actual IP or URI and your local installation paths.
python "$EXAMPLE_ROOT/python/h102_api.py" --uri ip:DEVICE_IP select 8msps-4mhz
./cpp-build/h102_iio ip:DEVICE_IP select 8msps-4mhz-common
The -common suffix selects shared LO at one frequency. Obtain exact IDs from profiles. Contention, rollback, disconnect or timeout returns an error. No automatic retry occurs and another request's result is not accepted as this request's success. Query actual state before deciding the next action.
Use the matching IIO GUI or GNU Radio for reception, recording and transmission. Select a rate and channel count within the link budget, read the actual configuration, and check files, sample counts and integrity after stopping. For custom data programs, follow IIO interfaces and example checks.