#[unsafe(no_mangle)]pub unsafe extern "C" fn pamoja_lorawan_device_new(
dev_eui: *const u8,
dev_eui_len: usize,
app_eui: *const u8,
app_eui_len: usize,
app_key: *const u8,
app_key_len: usize,
out_device: *mut *mut PamojaLorawanDevice,
) -> PamojaStatusExpand description
Creates a device from the root credentials over-the-air activation uses.
§Arguments
dev_eui- the 8-byte device EUI.dev_eui_len- its length, which must bePAMOJA_LORAWAN_EUI_LEN.app_eui- the 8-byte application (join) EUI.app_eui_len- its length, which must bePAMOJA_LORAWAN_EUI_LEN.app_key- the 16-byte application key the join exchange is secured with.app_key_len- its length, which must bePAMOJA_LORAWAN_KEY_LEN.out_device- receives the new device.
§Returns
PamojaStatus::Ok on success, with *out_device set to a handle the caller
must release with pamoja_lorawan_device_free, or
PamojaStatus::InvalidArgument if any credential is the wrong length.
§Safety
Each pointer must point to at least its stated length in readable bytes, and
out_device must point to a writable *mut PamojaLorawanDevice.