Skip to content

Commit

Permalink
Merge pull request #13 from cryptlex/muneeb/get-floating-client-lease…
Browse files Browse the repository at this point in the history
…-expiry-date

feat: add get floating client lease expiry
  • Loading branch information
ahmad-kemsan authored Aug 1, 2024
2 parents 1cd54fc + c6b4865 commit a7dc774
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cryptlex/lexfloatclient/lexfloatclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 4 additions & 0 deletions cryptlex/lexfloatclient/lexfloatclient_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7dc774

Please sign in to comment.