Skip to main content

pamoja_lorawan_device_accept_join

Function pamoja_lorawan_device_accept_join 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_device_accept_join( device: *const PamojaLorawanDevice, bytes: *const u8, bytes_len: usize, dev_nonce: u16, out_accept: *mut *mut PamojaLorawanJoinAccept, ) -> PamojaStatus
Expand description

Turns the join accept a network sent into the settings it grants.

§Arguments

  • device - the device that sent the join request.
  • bytes - the join accept exactly as it arrived.
  • bytes_len - its length.
  • dev_nonce - the nonce the matching join request carried.
  • out_accept - receives the accepted join.

§Returns

PamojaStatus::Ok on success, with *out_accept set to a handle the caller must release with pamoja_lorawan_join_accept_free, PamojaStatus::Auth if the MIC does not verify, or PamojaStatus::Codec if the frame is truncated or is not a join accept.

§Safety

device must be a live handle from pamoja_lorawan_device_new, or null, bytes must point to at least bytes_len readable bytes when that length is non-zero, and out_accept must point to a writable *mut PamojaLorawanJoinAccept.