Skip to main content

header

Function header 

Source
pub const fn header(chain: Chain, opcode: u8) -> [u8; 2]
Expand description

The two bytes every frame to a front end starts with.

A command is this header and then its payload. A read sends the same frame and takes the answer from where the payload would have been, which is why HEADER_LEN is what a reader skips.

§Arguments

  • chain - the chain the front end is on.
  • opcode - the command.

§Returns

The header.

§Examples

use pamoja_radios::sx1302::sx1250::{header, OP_SET_RF_FREQUENCY};
use pamoja_radios::sx1302::tx::Chain;

assert_eq!(header(Chain::A, OP_SET_RF_FREQUENCY), [0x01, 0x86]);