#devices #command #protocols #point #data #per #laser-cube

lasercube-core

A library providing high-level interfaces for discovering and controlling LaserCube devices

1 unstable release

new 0.1.0 Mar 5, 2025

#26 in #per

Download history 106/week @ 2025-03-01

106 downloads per month
Used in lasercube

MIT license

40KB
758 lines

lasercube-core

Core types and constants for the LaserCube network protocol.

Overview

lasercube-core provides the fundamental data structures and protocol definitions for communicating with LaserCube devices.

Features

  • Core protocol definitions
  • Type-safe command and data structures
  • Buffer management utilities
  • Ready for use with standard network libraries

Example

use lasercube_core::{
    Command, SampleData, Point,
    consts::MAX_POINTS_PER_MESSAGE,
};

// Create a point
let point = Point::from_normalized(0.0, 0.0, 1.0, 0.5, 0.0);

// Create a sample data packet
let sample_data = SampleData::new(0, 0, vec![point]);

// Create a command to send the sample data
let command = Command::SampleData(sample_data);

Safety Notes

This crate provides the basic building blocks for communicating with LaserCube devices, which are physical laser devices that can present safety risks if misused. When implementing network communication using this crate, please ensure appropriate safety measures are in place.

License

Licensed under either of:

at your option.

Dependencies

~230–690KB
~16K SLoC