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
andMARK_BYTE
bytes. - SYNC_
BYTE - SYNC byte indicates the beginning of the packet.
Traits§
- Packet
- A trait for all packets structures
- Read
Byte Ext - Additional methods for
std::io::Read
trait to read a single (escaped) byte. - Read
Packet - A helper trait which implemented for
std::io::Read
. Contains methods for readingPacket
s from the Reader. - Report
Field - A trait that adds additional setters for Response Packets.
- Write
Byte Ext - Additional methods for
std::io::Write
trait to write a single byte. - Write
Packet - A helper trait which implemented for
std::io::Write
. Contains methods for writingPacket
s to the Writer.