#[unsafe(no_mangle)]pub unsafe extern "C" fn pamoja_lorawan_end_device_save(
device: *mut PamojaLorawanEndDevice,
now_us: u64,
out_saved: *mut u8,
len: usize,
) -> PamojaStatusExpand description
Saves a joined device’s state, to keep across a loss of power.
The bytes hold the session keys, so keep them wherever the keys would be safe.
§Arguments
device- the device.now_us- the time, in microseconds, which the duty cycle waits are measured from.out_saved- receives the state.len- room atout_saved, which must bePAMOJA_LORAWAN_SAVED_LEN.
§Returns
PamojaStatus::Ok on success.
§Errors
Returns PamojaStatus::InvalidArgument if a pointer is null or len is wrong, and a
failing status with the reason on pamoja_lorawan_end_device_error for a device that
has not joined or is waiting on its windows.
§Safety
device must be a live handle and out_saved must point to len writable bytes.