Skip to main content

pamoja_lorawan_relay_send

Function pamoja_lorawan_relay_send 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_relay_send( relay: *mut PamojaLorawanRelay, port: u8, payload: *const u8, payload_len: usize, confirmed: u8, now_us: u64, out_frame: *mut *mut PamojaBuffer, out_transmission: *mut PamojaLorawanTransmission, ) -> PamojaStatus
Expand description

Sends one of the relay’s own uplinks, which also carries what it owes its network.

§Arguments

  • relay - the relay.
  • port - the application port, or 0 for a frame with no payload.
  • payload - the payload, which may be null when port is 0.
  • payload_len - its length.
  • confirmed - 1 to ask the network to acknowledge it.
  • now_us - the time, in microseconds.
  • out_frame - receives the frame to transmit.
  • out_transmission - receives where and how to transmit it, and its windows.

§Returns

PamojaStatus::Ok on success, with *out_frame set to a buffer the caller must release with pamoja_buffer_free.

§Errors

Returns a failing status, with the reason on pamoja_lorawan_relay_error.

§Safety

relay must be a live handle, payload must point to payload_len readable bytes when that is non-zero, and the out pointers must be writable.