Skip to main content

Crate libexail

Crate libexail 

Source
Expand description

§libexail

A Rust library for communicating with Exail (formerly iXblue) devices using their standard binary protocol (StdBin). Supports INS/AHRS products such as Marins M9, M7, and Atlans A7.

The protocol definition is based on the iXblue reference implementations:

§Supported Data Blocks

  • AttitudeHeading — Heading, roll, pitch in vessel frame
  • AttitudeHeadingStdDev — Attitude standard deviations
  • HeaveSurgeSway — Real-time heave, surge, and sway
  • SmartHeave — Delayed heave (100s from real time)
  • HeadingRollPitchRate — Heading, roll, and pitch rates
  • RotationRateVesselFrame — Compensated rotation rates
  • AccelerationVesselFrame — Compensated acceleration
  • Position — WGS84 position at selected lever arm
  • PositionStdDev — Position standard deviations
  • SpeedGeographic — Speed in geographic frame
  • SpeedStdDev — Speed standard deviations
  • CurrentGeographic — Current in geographic frame
  • CurrentStdDev — Current standard deviations
  • SystemDate — Internal or ZDA date
  • SensorStatus — INS/AHRS sensor status words
  • InsAlgorithmStatus — INS algorithm status (V5: 16 bytes, V6: 24 bytes)
  • InsSystemStatus — INS system status words
  • InsUserStatus — INS user status word
  • AhrsAlgorithmStatus — AHRS algorithm status word
  • AhrsSystemStatus — AHRS system status words
  • AhrsUserStatus — AHRS user status word
  • HeaveSurgeSwaySpeed — Heave, surge, sway speeds
  • SpeedVesselFrame — Speed in vessel frame
  • AccelerationGeographic — Acceleration in geographic frame
  • CourseSpeedOverGround — Course and speed over ground
  • Temperatures — FOG, accelerometer, and board temperatures
  • AttitudeQuaternion — Attitude as quaternion
  • AttitudeQuaternionStdDev — Quaternion error standard deviations
  • RawAccelerationVesselFrame — Raw acceleration (not gravity-compensated)
  • AccelerationStdDev — Acceleration standard deviations
  • RotationRateStdDev — Rotation rate standard deviations

§Extended Navigation Blocks (bits 0-7)

  • RotationAccelerationVesselFrame — Rotation acceleration
  • RotationAccelerationStdDev — Rotation acceleration standard deviations
  • RawRotationRateVesselFrame — Raw rotation rate (not Earth-compensated)
  • VehicleAttitudeHeading — Vehicle attitude (turret feature)
  • VehicleAttitudeHeadingStdDev — Vehicle attitude standard deviations
  • VehiclePosition — Vehicle position (turret feature)
  • VehiclePositionStdDev — Vehicle position standard deviations
  • SetAndDrift — Water current set and drift

§External Sensor Blocks (bits 0-28)

  • UTC — UTC time data
  • GNSS1/GNSS2/ManualGNSS — GNSS position data
  • EMLOG1/EMLOG2 — Electromagnetic log speed
  • USBL1/USBL2/USBL3 — Ultra-short baseline position
  • Depth — Depth sensor data
  • DVL1/DVL2 Ground/Water Speed — Doppler velocity log
  • SoundVelocity — External sound velocity
  • DMI — Distance measurement instrument
  • LBL1-LBL4 — Long baseline beacon ranges
  • EventMarkerA/B/C — Event markers
  • TurretAngles — Turret heading, roll, pitch
  • VTG1/VTG2 — Track made good and ground speed
  • LogBook — Log book entries
  • Date — Date data

§Protocol Details

§Frame Structure

[Sync1][Sync2][Version][Bitmask][Data Blocks][Checksum]
  • Sync bytes: IX (navigation/input data), CM (command), AN (answer)
  • Big-endian: All multi-byte values
  • Checksum: XOR-based 32-bit checksum
  • Protocol versions: 2-6

§Examples

§File Reader

Parse Exail frames from a binary file:

cargo run --example read_file -- recording.bin
cargo run --example read_file -- -v recording.bin  # verbose

§TCP Stream Reader

Read Exail frames from a TCP connection:

cargo run --example stream_reader 192.168.1.100 8080
cargo run --example stream_reader localhost 4001

§UDP Reader

Listen for Exail datagrams on a UDP port:

cargo run --example udp_reader 8080
cargo run --example udp_reader -- -v 8080  # verbose

§Testing

cargo test

Re-exports§

pub use blocks::InputDataFrame;
pub use blocks::Message;
pub use blocks::NavigationDataFrame;
pub use blocks::extended::ExtendedNavigationBlock;
pub use blocks::external::ExternalBlock;
pub use blocks::navigation::NavigationBlock;
pub use error::Error;
pub use error::Result;
pub use framing::calculate_checksum;
pub use framing::is_sync;
pub use framing::validate_checksum;
pub use header::AnswerHeader;
pub use header::CommandHeader;
pub use header::InputHeader;
pub use header::OutputHeader;
pub use header::SyncType;
pub use parser::DatagramError;
pub use parser::ExailParser;
pub use parser::parse_datagram;

Modules§

blocks
Data block types for the Exail binary protocol.
error
Error types for the Exail binary protocol parser.
framing
Sync byte detection and checksum calculation for Exail frames.
header
Header types for the four Exail frame kinds: output navigation data, input sensor data, commands, and answers.
parser
Stateful and one-shot parsers for Exail binary protocol frames.
reader
Iterator-based reader for Exail frames over byte streams.