Skip to content

Commit cd50f3d

Browse files
authored
Merge pull request #5 from cryptlex/feat/client-version
feat: added GetFloatingClientLibraryVersion()
2 parents 450c0af + 0f00b78 commit cd50f3d

2 files changed

Lines changed: 24 additions & 2 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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ 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
131-
GetHostProductVersionName.argtypes = [STRTYPE,c_uint32]
135+
GetHostProductVersionName.argtypes = [STRTYPE, c_uint32]
132136
GetHostProductVersionName.restype = c_int
133137

134138
GetHostProductVersionDisplayName = library.GetHostProductVersionDisplayName
135-
GetHostProductVersionDisplayName.argtypes = [STRTYPE,c_uint32]
139+
GetHostProductVersionDisplayName.argtypes = [STRTYPE, c_uint32]
136140
GetHostProductVersionDisplayName.restype = c_int
137141

138142
GetHostProductVersionFeatureFlag = library.GetHostProductVersionFeatureFlag

0 commit comments

Comments
 (0)