MCPcopy Create free account
hub / github.com/RizeCrime/linuxblaster_control / read_packet

Function read_packet

src/features.rs:539–555  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

537const READ_TIMEOUT_MS: i32 = 500;
538
539fn read_packet() -> Option<[u8; 64]> {
540 let mut buffer = [0u8; 64];
541 match DEVICE_CONNECTION
542 .get()
543 .expect("Device connection must be initialized")
544 .lock()
545 .unwrap()
546 .read_timeout(&mut buffer, READ_TIMEOUT_MS)
547 {
548 Ok(0) => None,
549 Ok(_) => Some(buffer),
550 Err(error) => {
551 error!("Failed to read packet: {:?}", error);
552 None
553 }
554 }
555}
556
557fn read_ack() {
558 for attempt in 0..MAX_READ_ATTEMPTS {

Callers 4

read_ackFunction · 0.85
dsp_getFunction · 0.85
global_profile_getFunction · 0.85
output_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected