(bytes: &[u8])
| 29 | |
| 30 | impl 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); |
nothing calls this directly
no outgoing calls
no test coverage detected