Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/extern_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ extern "C" {
pub fn GetLicenseTotalDeactivations(totalDeactivations: *mut c_uint) -> c_int;
pub fn GetLicenseCreationDate(creationDate: *mut c_uint) -> c_int;
pub fn GetLicenseActivationDate(activationDate: *mut c_uint) -> c_int;
pub fn GetActivationLastSyncedDate(lastSyncedDate: *mut c_uint) -> c_int;
pub fn GetLicenseExpiryDate(expiryDate: *mut c_uint) -> c_int;
pub fn GetLicenseMaintenanceExpiryDate(maintenanceExpiryDate: *mut c_uint) -> c_int;
pub fn GetLicenseMaxAllowedReleaseVersion(maxAllowedReleaseVersion: strtype!(), length: c_uint) -> c_int;
Expand Down
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,24 @@ pub fn get_license_activation_date() -> Result<u32, LexActivatorError> {
}
}

/// Retrieves the activation last synced date timestamp.
///
/// Initially, this timestamp matches the activation creation date, and then updates with each successful server sync.
///
/// # Returns
///
/// Returns `Ok(u32)` with the activation last synced date timestamp if it is retrieved successfully, If an error occurs, an `Err` containing the `LexActivatorError`is returned.

pub fn get_activation_last_synced_date() -> Result<u32, LexActivatorError> {
let mut last_synced_date: c_uint = 0;
let status = unsafe { GetActivationLastSyncedDate(&mut last_synced_date) };
if status == 0 {
Ok(last_synced_date)
} else {
return Err(LexActivatorError::from(status));
}
}

/// Retrieves the expiry date of the license.
///
/// # Returns
Expand Down
Loading