diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 9f6c0cc..6e86092 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -244,6 +244,24 @@ def GetHostLicenseExpiryDate(): return expiry_date.value else: raise LexFloatClientException(status) + + @staticmethod + def GetFloatingClientLeaseExpiryDate(): + """Gets the lease expiry date timestamp of the floating client. + + Raises: + LexFloatClientException + + Returns: + int: the timestamp + """ + leaseExpiryDate = ctypes.c_uint() + status = LexFloatClientNative.GetFloatingClientLeaseExpiryDate( + ctypes.byref(leaseExpiryDate)) + if status == LexFloatStatusCodes.LF_OK: + return leaseExpiryDate.value + else: + raise LexFloatClientException(status) @staticmethod def GetFloatingClientMeterAttributeUses(name): diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..6813cf6 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -155,6 +155,10 @@ def byte_to_string(input): GetHostLicenseExpiryDate.argtypes = [POINTER(c_uint32)] GetHostLicenseExpiryDate.restype = c_int +GetFloatingClientLeaseExpiryDate = library.GetFloatingClientLeaseExpiryDate +GetFloatingClientLeaseExpiryDate.argtypes = [POINTER(c_uint32)] +GetFloatingClientLeaseExpiryDate.restype = c_int + GetFloatingClientMeterAttributeUses = library.GetFloatingClientMeterAttributeUses GetFloatingClientMeterAttributeUses.argtypes = [CSTRTYPE, POINTER(c_uint32)] GetFloatingClientMeterAttributeUses.restype = c_int