Skip to main content

pamoja_lora_radio_receive

Function pamoja_lora_radio_receive 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lora_radio_receive( radio: *mut PamojaLoraRadio, buffer: *mut u8, capacity: usize, timeout_us: u64, out_reception: *mut PamojaLoraRadioReception, ) -> PamojaStatus
Expand description

Listens for one frame.

§Arguments

  • radio - the radio.
  • buffer - where the payload goes.
  • capacity - the buffer’s length; up to 255 bytes are accepted.
  • timeout_us - how long to listen for a frame to start, in microseconds.
  • out_reception - receives how the reception ended.

§Returns

PamojaStatus::Ok with the outcome in out_reception, a timeout and a corrupt frame included; PamojaStatus::InvalidArgument for a null argument, a payload longer than capacity, or a radio not yet configured; or PamojaStatus::Io when the chip does not answer.

§Safety

radio must be a live handle or null, buffer must point at capacity writable bytes or be null, and out_reception must be writable or null.