mocopi_parser

Crates.iomocopi_parser
lib.rsmocopi_parser
version0.3.1
sourcesrc
created_at2023-04-24 09:54:26.440593
updated_at2023-05-17 05:45:20.047258
descriptionA parser of streamed data from mocopi
homepage
repository
max_upload_size
id847270
size11,241
Ryuya Hirayama (dorayaki4369)

documentation

README

mocopi-parser

mocopi-parser is a parser library of streamed data from mocopi.

Example

This example using local-ip-address crate.

use std::net::UdpSocket;
use local_ip_address::local_ip;

fn main() {
    let ip = local_ip().unwrap();
    let port = 12351;
    let addr = format!("{}:{}", ip, port);

    let socket = UdpSocket::bind(&addr).unwrap();

    let mut buff = [0u8; 2048];

    loop {
        socket.recv_from(buff).unwrap();

        let packet = mocopi_parser::parse(&buff).unwrap();
        
        println!("{:?}", packet);
    }
}

References

  1. mocopi receiver
  2. 技術仕様
Commit count: 0

cargo fmt