Crate jvs_packets

Source
Expand description

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 data.

§Example

use jvs_packets::{jvs::{RequestPacket}, ReadPacket, Packet};

    // 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(())

Modules§

jvs
A packet structures used for communication with JAMMA Video Standart.
jvs_modified
A packet structures for slightly modified JAMMA Video Standart protocol, that mostly used for NFS readers.

Enums§

Report
JVS response report codes.

Constants§

MARK_BYTE
MARK byte is used for escaping the SYNC_BYTE and MARK_BYTE bytes.
SYNC_BYTE
SYNC byte indicates the beginning of the packet.

Traits§

Packet
A trait for all packets structures
ReadByteExt
Additional methods for std::io::Read trait to read a single (escaped) byte.
ReadPacket
A helper trait which implemented for std::io::Read. Contains methods for reading Packets from the Reader.
ReportField
A trait that adds additional setters for Response Packets.
WriteByteExt
Additional methods for std::io::Write trait to write a single byte.
WritePacket
A helper trait which implemented for std::io::Write. Contains methods for writing Packets to the Writer.