Skip to content

Commit

Permalink
Merge pull request #11 from cryptlex/muneeb/get-floating-license-mode
Browse files Browse the repository at this point in the history
get floating license mode
  • Loading branch information
ahmad-kemsan authored Aug 6, 2024
2 parents cc88fae + 3d28f10 commit 38924a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cryptlex/lexfloatclient/lexfloatclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,23 @@ def GetFloatingClientMeterAttributeUses(name):
return uses.value
else:
raise LexFloatClientException(status)

@staticmethod
def GetFloatingLicenseMode():
"""Gets the mode of the floating license (online or offline).
Raises:
LexActivatorException
Returns:
ActivationMode: mode of floating license.
"""
buffer_size = 256
buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size)
status = LexFloatClientNative.GetFloatingLicenseMode(buffer,buffer_size)
if status != LexFloatStatusCodes.LF_OK:
raise LexFloatClientException(status)
return LexFloatClientNative.byte_to_string(buffer.value)

@staticmethod
def GetFloatingClientMetadata(key):
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 @@ -143,6 +143,10 @@ def byte_to_string(input):
GetHostProductVersionDisplayName.argtypes = [STRTYPE, c_uint32]
GetHostProductVersionDisplayName.restype = c_int

GetFloatingLicenseMode = library.GetFloatingLicenseMode
GetFloatingLicenseMode.argtypes = [STRTYPE, c_uint32]
GetFloatingLicenseMode.restype = c_int

GetHostProductVersionFeatureFlag = library.GetHostProductVersionFeatureFlag
GetHostProductVersionFeatureFlag.argtypes = [CSTRTYPE, POINTER(c_uint32), STRTYPE, c_uint32]
GetHostProductVersionFeatureFlag.restype = c_int
Expand Down

0 comments on commit 38924a9

Please sign in to comment.