timex_datalink/lib.rs
1//! Timex-datalink client library in rust
2//! This is a port of the ruby `timex_datalink_client` gem.
3
4/// A trait for packet generation that can be used across different protocols
5///
6/// This trait defines the core functionality for generating packet bytes
7/// that will be transmitted to Timex Datalink devices.
8pub trait PacketGenerator {
9 /// Generate packets as a vector of vectors of bytes
10 ///
11 /// # Returns
12 ///
13 /// A vector of vectors of bytes representing the packets to be transmitted
14 fn packets(&self) -> Vec<Vec<u8>>;
15}
16
17pub mod protocol_3;
18pub mod protocol_4;
19pub mod helpers;
20pub mod char_encoders;
21pub mod notebook_adapter;
22pub mod devices;
23
24#[cfg(target_arch = "wasm32")]
25mod lib_wasm;
26
27#[cfg(target_arch = "wasm32")]
28pub use lib_wasm::*;
29
30pub use protocol_3::Protocol3;
31pub use protocol_4::Protocol4;
32pub use notebook_adapter::NotebookAdapter;