Skip to main content

pamoja_lorawan_firmware_heard

Function pamoja_lorawan_firmware_heard 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_firmware_heard( manager: *mut PamojaLorawanFirmware, payload: *const u8, payload_len: usize, now_s: u32, has_now: u8, out_answers: *mut u8, capacity: usize, out_len: *mut usize, ) -> PamojaStatus
Expand description

Reads a downlink on the firmware port and writes the answers it calls for.

§Arguments

  • manager - the package.
  • payload - what arrived on port PAMOJA_LORAWAN_FIRMWARE_PORT.
  • payload_len - its length.
  • now_s - what the device believes the time is, in seconds since the GPS epoch.
  • has_now - 1 when the device knows the time; a device that does not refuses a reboot set for a moment in time.
  • out_answers - receives the answers.
  • capacity - how many bytes that buffer holds.
  • out_len - receives how many were written.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::Codec for a message this package cannot read, and PamojaStatus::InvalidArgument for a null pointer or a buffer too small.

§Safety

manager must be a live handle, payload must point to payload_len readable bytes, out_answers to capacity writable ones, and out_len must be writable.