Skip to content

Commit

Permalink
Merge pull request #5 from cryptlex/feat/client-version
Browse files Browse the repository at this point in the history
feat: added GetFloatingClientLibraryVersion()
  • Loading branch information
ahmad-kemsan authored Oct 18, 2023
2 parents 450c0af + 0f00b78 commit cd50f3d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
18 changes: 18 additions & 0 deletions cryptlex/lexfloatclient/lexfloatclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ def SetFloatingClientMetadata(key, value):
cstring_key, cstring_value)
if LexFloatStatusCodes.LF_OK != status:
raise LexFloatClientException(status)

@staticmethod
def GetFloatingClientLibraryVersion():
"""Gets the floating client library version.
Raises:
LexFloatClientException
Returns:
str: library version.
"""

buffer_size = 256
buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size)
status = LexFloatClientNative.GetFloatingClientLibraryVersion(buffer,buffer_size)
if status != LexFloatStatusCodes.LF_OK:
raise LexFloatClientException(status)
return LexFloatClientNative.byte_to_string(buffer.value)

@staticmethod
def GetHostProductVersionName():
Expand Down
8 changes: 6 additions & 2 deletions cryptlex/lexfloatclient/lexfloatclient_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,16 @@ def byte_to_string(input):
SetFloatingClientMetadata.argtypes = [CSTRTYPE, CSTRTYPE]
SetFloatingClientMetadata.restype = c_int

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

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

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

GetHostProductVersionFeatureFlag = library.GetHostProductVersionFeatureFlag
Expand Down

0 comments on commit cd50f3d

Please sign in to comment.