Skip to content

Commit e962d91

Browse files
feat: added GetFloatingClientLibraryVersion()
1 parent 450c0af commit e962d91

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

cryptlex/lexfloatclient/lexfloatclient.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ def SetFloatingClientMetadata(key, value):
100100
cstring_key, cstring_value)
101101
if LexFloatStatusCodes.LF_OK != status:
102102
raise LexFloatClientException(status)
103+
104+
@staticmethod
105+
def GetFloatingClientLibraryVersion():
106+
"""Gets the floating client library version.
107+
108+
Raises:
109+
LexFloatClientException
110+
111+
Returns:
112+
str: library version.
113+
"""
114+
115+
buffer_size = 256
116+
buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size)
117+
status = LexFloatClientNative.GetFloatingClientLibraryVersion(buffer,buffer_size)
118+
if status != LexFloatStatusCodes.LF_OK:
119+
raise LexFloatClientException(status)
120+
return LexFloatClientNative.byte_to_string(buffer.value)
103121

104122
@staticmethod
105123
def GetHostProductVersionName():

cryptlex/lexfloatclient/lexfloatclient_native.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ def byte_to_string(input):
127127
SetFloatingClientMetadata.argtypes = [CSTRTYPE, CSTRTYPE]
128128
SetFloatingClientMetadata.restype = c_int
129129

130+
GetFloatingClientLibraryVersion = library.GetFloatingClientLibraryVersion
131+
GetFloatingClientLibraryVersion.argtypes = [STRTYPE,c_uint32]
132+
GetFloatingClientLibraryVersion.restype = c_int
133+
130134
GetHostProductVersionName = library.GetHostProductVersionName
131135
GetHostProductVersionName.argtypes = [STRTYPE,c_uint32]
132136
GetHostProductVersionName.restype = c_int

0 commit comments

Comments
 (0)