Skip to content

zleytus/rfe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

475 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rfe icon

rfe

crates.io nuget.org docs.rs CI License: MIT OR Apache-2.0

rfe is a cross-platform SDK for communicating with RF Explorer spectrum analyzers and signal generators over USB serial.

Components

Rust library for communicating with RF Explorer spectrum analyzers and signal generators.

use rfe::SpectrumAnalyzer;

let rfe = SpectrumAnalyzer::connect()?;
let sweep = rfe.wait_for_next_sweep()?;

C-compatible native library and generated rfe.h header for C and other languages.

#include "rfe.h"
#include <stdint.h>
#include <stdlib.h>

SpectrumAnalyzer *rfe = rfe_spectrum_analyzer_connect();
if (rfe) {
    uint16_t sweep_len = rfe_spectrum_analyzer_sweep_len(rfe);
    float *sweep = malloc(sizeof(float) * sweep_len);
    rfe_spectrum_analyzer_wait_for_next_sweep(rfe, sweep, sweep_len, NULL);

    // Use sweep

    free(sweep);
    rfe_spectrum_analyzer_free(rfe);
}

C examples are available in ffi/examples.

.NET library for C# applications.

using Rfe.Net;

using var rfe = SpectrumAnalyzer.Connect();
if (rfe is not null)
{
    float[] sweep = rfe.WaitForNextSweep();
}

.NET examples are available in dotnet/examples.

Desktop GUI for visualizing spectrum analyzer sweeps.

rfe-gui screenshot

Requirements

RF Explorer devices use a CP210x USB-to-UART bridge. To communicate with a device over USB, make sure the platform driver is available.

Windows

Download and install the Silicon Labs CP210x driver.

macOS

macOS 10.15+ includes a built-in CP210x driver. If the device is not detected, install the Silicon Labs CP210x driver.

Linux

Linux includes the CP210x kernel driver, but serial port access usually requires additional setup.

1. Install dependencies

rfe uses pkg-config and udev headers to enumerate serial ports and inspect USB device information.

Distro Command
Debian/Ubuntu/Mint apt install pkg-config libudev-dev
Fedora/CentOS/RHEL dnf install pkgconf-pkg-config systemd-devel
openSUSE zypper install pkgconf-pkg-config systemd-devel
Arch/Manjaro pacman -Syu pkgconf systemd

2. Grant serial port access

The current user must belong to the dialout or uucp group to access serial ports.

Distro Command
Debian/Ubuntu/Mint gpasswd -a <username> dialout
Fedora/CentOS/RHEL gpasswd -a <username> dialout
openSUSE gpasswd -a <username> dialout
Arch/Manjaro gpasswd -a <username> uucp

Note: Log out and back in (or reboot) for group changes to take effect.

License

This project is dual-licensed under the MIT License or Apache 2.0 License.

About

Control RF Explorer spectrum analyzers and signal generators over USB

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

0 stars

Watchers

1 watching

Forks

Contributors