Skip to content

Commit 38924a9

Browse files
authored
Merge pull request #11 from cryptlex/muneeb/get-floating-license-mode
get floating license mode
2 parents cc88fae + 3d28f10 commit 38924a9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

cryptlex/lexfloatclient/lexfloatclient.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,23 @@ def GetFloatingClientMeterAttributeUses(name):
340340
return uses.value
341341
else:
342342
raise LexFloatClientException(status)
343+
344+
@staticmethod
345+
def GetFloatingLicenseMode():
346+
"""Gets the mode of the floating license (online or offline).
347+
348+
Raises:
349+
LexActivatorException
350+
351+
Returns:
352+
ActivationMode: mode of floating license.
353+
"""
354+
buffer_size = 256
355+
buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size)
356+
status = LexFloatClientNative.GetFloatingLicenseMode(buffer,buffer_size)
357+
if status != LexFloatStatusCodes.LF_OK:
358+
raise LexFloatClientException(status)
359+
return LexFloatClientNative.byte_to_string(buffer.value)
343360

344361
@staticmethod
345362
def GetFloatingClientMetadata(key):

cryptlex/lexfloatclient/lexfloatclient_native.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ def byte_to_string(input):
143143
GetHostProductVersionDisplayName.argtypes = [STRTYPE, c_uint32]
144144
GetHostProductVersionDisplayName.restype = c_int
145145

146+
GetFloatingLicenseMode = library.GetFloatingLicenseMode
147+
GetFloatingLicenseMode.argtypes = [STRTYPE, c_uint32]
148+
GetFloatingLicenseMode.restype = c_int
149+
146150
GetHostProductVersionFeatureFlag = library.GetHostProductVersionFeatureFlag
147151
GetHostProductVersionFeatureFlag.argtypes = [CSTRTYPE, POINTER(c_uint32), STRTYPE, c_uint32]
148152
GetHostProductVersionFeatureFlag.restype = c_int

0 commit comments

Comments
 (0)