Crates.io | jvs-packets |
lib.rs | jvs-packets |
version | 1.1.0 |
source | src |
created_at | 2024-02-21 15:19:39.798683 |
updated_at | 2024-09-21 13:11:50.129199 |
description | A crate that provide structures for JVS protocols |
homepage | |
repository | https://github.com/robloxxa/jvs-packets-rs |
max_upload_size | |
id | 1148152 |
size | 42,129 |
A packet structures for JAMMA Video Standart protocols.
This crate provides a wrapper around [u8]
array with getter and setter methods for easily writing/reading jvs data.
This crate was initially created for my other project MaiFinaleToDX
use jvs_packets::{jvs::{RequestPacket}, ReadPacket, Packet};
fn main() -> std::io::Result<()> {
// This is only for example. You can use any structure, that implements std::io::Read.
let mut reader = std::io::Cursor::new([0xE0, 0xFF, 0x03, 0x01, 0x02, 0x05]);
let mut req_packet: RequestPacket = RequestPacket::new();
reader.read_packet(&mut req_packet)?;
assert_eq!(req_packet.size(), 0x03);
Ok(())
}