Skip to content

Commit 77dad73

Browse files
committed
feat: add close function
1 parent b1bdccf commit 77dad73

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

absscpi/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,17 @@ def open_serial(self, port: str, device_id: int):
290290
self.__handle, port.encode(), c_uint(device_id))
291291
self.__check_err(res)
292292

293+
def close(self):
294+
"""Close client connection.
295+
296+
It is not an error if the client is not connected.
297+
298+
Raises:
299+
ScpiClientError: An error occurred while closing the connection.
300+
"""
301+
res = self.__dll.AbsScpiClient_Close(self.__handle)
302+
self.__check_err(res)
303+
293304
def open_udp_multicast(self, interface_ip: str):
294305
"""Open a UDP multicast socket for broadcasting to many ABSes.
295306

0 commit comments

Comments
 (0)