MCPcopy Index your code
hub / github.com/FrameworkComputer/framework-system / print_ascii_buffer

Function print_ascii_buffer

framework_lib/src/util.rs:215–227  ·  view source on GitHub ↗

Example: Input: [0x00; 0x16] Output: ................ Input: [a000 0036 626e 0300 c511 8035 0000 0000] Output: ...6bn.....5....

(buffer: &[u8], newline: bool)

Source from the content-addressed store, hash-verified

213// Input: [a000 0036 626e 0300 c511 8035 0000 0000]
214// Output: ...6bn.....5....
215fn print_ascii_buffer(buffer: &[u8], newline: bool) {
216 for byte in buffer {
217 // If printable, print, else display a dot
218 if *byte >= 32 && *byte <= 127 {
219 print!("{}", *byte as char);
220 } else {
221 print!(".")
222 }
223 }
224 if newline {
225 println!();
226 }
227}
228
229/// Print a big byte buffer
230///

Callers 1

print_multiline_bufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected