icsneoc2 0.1002002.0-rc.4

High-level Rust interface for Intrepid Control Systems vehicle network adapters
Documentation
//! High-level Rust interface for [Intrepid Control Systems](https://intrepidcs.com)
//! vehicle network adapters.
//!
//! This crate wraps the [`libicsneoc2`](https://github.com/intrepidcs/libicsneo) C library, providing safe, idiomatic
//! Rust access to CAN, CAN FD, LIN, Ethernet, and other automotive networks.
//!
//! # Quick start
//!
//! ```no_run
//! use icsneoc2::{Device, OpenOptions};
//!
//! fn main() -> anyhow::Result<()> {
//!     let device = Device::open_first(0, OpenOptions::DEFAULT)?;
//!     println!("{}", device.description()?);
//!     Ok(())
//! }
//! ```
//!
//! # Examples
//!
//! ## Simple
//!
#![doc = "```no_run"]
#![doc = include_str!("../examples/simple.rs")]
#![doc = "```"]
//!
//! ## Transmit CAN
//!
#![doc = "```no_run"]
#![doc = include_str!("../examples/transmit_can.rs")]
#![doc = "```"]
//!
//! ## Disk Format
//!
#![doc = "```no_run"]
#![doc = include_str!("../examples/disk_format.rs")]
#![doc = "```"]

pub(crate) use libicsneoc2_sys as sys;

pub mod device;
pub mod disk;
pub mod enums;
pub mod error;
pub mod event;
pub(crate) mod functions;
pub mod message;
pub mod script;
pub mod settings;
pub mod util;

pub use device::{Device, DeviceInfo, DeviceInfoList};
pub use disk::{DiskDetails, DiskSize};
pub use enums::{DiskFormatFlags, MessageCanFlags, OpenOptions};
pub use error::{Error, Result};
pub use event::{Event, events};
pub use message::{CanProps, Message, MessageType};
pub use script::ScriptStatus;
pub use settings::Settings;
pub use sys::{
    AeLinkMode, Devicetype, DiskFormatDirective, DiskLayout, EthPhyLinkMode, IoType, LinMode,
    MemoryType, MiscIoAnalogVoltage, Netid, NetworkType,
};
pub use util::{serial_num_to_string, serial_string_to_num, version};

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_device_enumerate() {
        let devices = Device::enumerate(0).unwrap();
        assert!(devices.is_empty());
    }
}