Skip to main content

pamoja_lorawan_join_request_parse

Function pamoja_lorawan_join_request_parse 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_join_request_parse( bytes: *const u8, bytes_len: usize, app_key: *const u8, app_key_len: usize, out_request: *mut *mut PamojaLorawanJoinRequest, ) -> PamojaStatus
Expand description

Verifies a join-request and reads the identifiers out of it.

§Arguments

  • bytes - the raw join-request as it came off the radio.
  • bytes_len - its length.
  • app_key - the 16-byte application root key the device shares.
  • app_key_len - its length, which must be PAMOJA_LORAWAN_KEY_LEN.
  • out_request - receives the verified request.

§Returns

PamojaStatus::Ok on success, with *out_request set to a handle the caller must release with pamoja_lorawan_join_request_free, PamojaStatus::Auth if the MIC does not verify, or PamojaStatus::Codec if the frame is not a well-formed join-request.

§Safety

bytes and app_key must each point to at least their stated lengths in readable bytes, and out_request must point to a writable *mut PamojaLorawanJoinRequest.