Skip to main content

pamoja_gateway_network_answer

Function pamoja_gateway_network_answer 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_gateway_network_answer( network: *mut PamojaGatewayNetwork, dev_addr: u32, slot: PamojaGatewayNetworkSlot, fport: u8, payload: *const u8, payload_len: usize, buffer: *mut u8, capacity: usize, out_txpk: *mut PamojaGatewayTxpk, out_len: *mut usize, ) -> PamojaStatus
Expand description

Builds a downlink for a device, encrypted with its session.

§Arguments

  • network - the network.
  • dev_addr - the device to answer.
  • slot - where and when to transmit, from the event that reported the uplink.
  • fport - the port to answer on.
  • payload - what to send.
  • payload_len - its length.
  • buffer - where to write the frame to transmit.
  • capacity - how many bytes the buffer holds.
  • out_txpk - receives the packet that carries it.
  • out_len - receives how many bytes were written.

§Returns

PamojaStatus::Ok, PamojaStatus::InvalidArgument for a null argument or a buffer too small, or PamojaStatus::Codec when no session is held for the address.

§Safety

network must be a live handle, payload must point at payload_len readable bytes or be null, buffer must point at capacity writable bytes or be null, and both outputs must be writable.