brainvision 0.0.1

Rust library and TUI for Brain Products BrainVision RDA EEG streams over TCP/IP
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Example: connect to BrainVision RDA and print stream header.
use brainvision::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
    env_logger::init();
    let host = std::env::var("BRAINVISION_HOST").unwrap_or_else(|_| "127.0.0.1".into());
    let mut dev = BrainVisionDevice::connect_default(&host)?;
    let h = dev.wait_for_start()?;
    println!("Connected to RDA on {}", host);
    println!("Channels: {}", h.channel_count);
    println!("Rate: {:.2} Hz", h.sampling_rate_hz());
    println!("Names: {:?}", h.channel_names);
    Ok(())
}