MCPcopy Create free account
hub / github.com/bjoernQ/bleps / from_bytes

Method from_bytes

bleps/src/command.rs:31–36  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

29
30impl CommandHeader {
31 pub fn from_bytes(bytes: &[u8]) -> CommandHeader {
32 CommandHeader {
33 opcode: ((bytes[1] as u16) << 8) + bytes[0] as u16,
34 len: bytes[2],
35 }
36 }
37
38 pub fn from_ogf_ocf(ogf: u8, ocf: u16, len: u8) -> CommandHeader {
39 let opcode = opcode(ogf, ocf);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected