@@ -35,6 +35,7 @@ class AsyncModbusSerialClient(ModbusBaseClient, asyncio.Protocol):
3535 :param bytesize: Number of bits per byte 7-8.
3636 :param parity: 'E'ven, 'O'dd or 'N'one
3737 :param stopbits: Number of stop bits 1, 1.5, 2.
38+ :param exclusive: Set exclusive access mode (POSIX only).
3839 :param handle_local_echo: Discard local echo from dongle.
3940
4041 Common optional parameters:
@@ -72,6 +73,7 @@ def __init__(
7273 bytesize : int = 8 ,
7374 parity : str = "N" ,
7475 stopbits : int = 1 ,
76+ exclusive : bool | None = None ,
7577 ** kwargs : Any ,
7678 ) -> None :
7779 """Initialize Asyncio Modbus Serial Client."""
@@ -90,6 +92,7 @@ def __init__(
9092 bytesize = bytesize ,
9193 parity = parity ,
9294 stopbits = stopbits ,
95+ exclusive = exclusive ,
9396 ** kwargs ,
9497 )
9598
@@ -117,6 +120,7 @@ class ModbusSerialClient(ModbusBaseSyncClient):
117120 :param bytesize: Number of bits per byte 7-8.
118121 :param parity: 'E'ven, 'O'dd or 'N'one
119122 :param stopbits: Number of stop bits 0-2.
123+ :param exclusive: Set exclusive access mode (POSIX only).
120124 :param handle_local_echo: Discard local echo from dongle.
121125
122126 Common optional parameters:
@@ -162,6 +166,7 @@ def __init__(
162166 bytesize : int = 8 ,
163167 parity : str = "N" ,
164168 stopbits : int = 1 ,
169+ exclusive : bool | None = None ,
165170 ** kwargs : Any ,
166171 ) -> None :
167172 """Initialize Modbus Serial Client."""
@@ -173,6 +178,7 @@ def __init__(
173178 bytesize = bytesize ,
174179 parity = parity ,
175180 stopbits = stopbits ,
181+ exclusive = exclusive ,
176182 ** kwargs ,
177183 )
178184 self .socket = None
@@ -210,6 +216,7 @@ def connect(self):
210216 stopbits = self .comm_params .stopbits ,
211217 baudrate = self .comm_params .baudrate ,
212218 parity = self .comm_params .parity ,
219+ exclusive = self .comm_params .exclusive ,
213220 )
214221 if self .params .strict :
215222 self .socket .interCharTimeout = self .inter_char_timeout
0 commit comments