Skip to main content

pamoja_lora_radio_take_frame

Function pamoja_lora_radio_take_frame 

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

Takes the frame a listening radio has received, if one has arrived.

§Arguments

  • radio - the radio.
  • buffer - where the payload goes.
  • capacity - the buffer’s length.
  • out_reception - receives the frame, a corrupt frame, or PAMOJA_LORA_RADIO_NOTHING.

§Returns

PamojaStatus::Ok with the outcome in out_reception; PamojaStatus::InvalidArgument for a null argument or a payload longer than capacity; 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.