Skip to content

zleytus/rfe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

468 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rfe icon

rfe

crates.io 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 a USB virtual serial port.

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 API and generated rfe.h header for C and other languages that can load C libraries.

C examples are available in ffi/examples.

#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);
}

.NET wrapper library and example programs for C# consumers.

using Rfe.Net;

using var analyzer = SpectrumAnalyzer.Connect();
if (analyzer is not null)
{
    Console.WriteLine(analyzer.PortName);
    Console.WriteLine(analyzer.FirmwareVersion);
}

GUI for visualizing spectrum analyzer data.

rfe-gui screenshot

Requirements

To communicate with RF Explorer devices over USB, you need a driver for its CP210x USB-to-UART bridge.

Windows

Download and install the Silicon Labs CP210x driver.

macOS

macOS 10.15+ includes a built-in driver for CP210x devices. If it doesn't work, install the Silicon Labs CP210x driver.

Linux

The kernel includes the CP210x driver, but additional setup is required:

1. Install dependencies

rfe uses pkg-config and udev header files to provide serial port enumeration and 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

Communicate with 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

Watchers

Forks

Contributors