fix exception in MODBUS timeout callback
This commit is contained in:
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [unreleased]
|
## [unreleased]
|
||||||
|
|
||||||
|
- fix exception in MODBUS timeout callback
|
||||||
|
|
||||||
## [0.9.0-RC1] - 2024-06-29
|
## [0.9.0-RC1] - 2024-06-29
|
||||||
|
|
||||||
- add asyncio log and debug mode
|
- add asyncio log and debug mode
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ class Modbus():
|
|||||||
def close(self):
|
def close(self):
|
||||||
"""free the queue and erase the callback handlers"""
|
"""free the queue and erase the callback handlers"""
|
||||||
logging.debug('Modbus close:')
|
logging.debug('Modbus close:')
|
||||||
|
self.__stop_timer()
|
||||||
self.rsp_handler = None
|
self.rsp_handler = None
|
||||||
self.snd_handler = None
|
self.snd_handler = None
|
||||||
while not self.que.empty:
|
while not self.que.empty:
|
||||||
@@ -252,6 +253,7 @@ class Modbus():
|
|||||||
# logging.debug(f'Modbus stop timer {self}')
|
# logging.debug(f'Modbus stop timer {self}')
|
||||||
if self.tim:
|
if self.tim:
|
||||||
self.tim.cancel()
|
self.tim.cancel()
|
||||||
|
self.tim = None
|
||||||
|
|
||||||
def __timeout_cb(self) -> None:
|
def __timeout_cb(self) -> None:
|
||||||
'''Rsponse timeout handler retransmit pdu or send next pdu'''
|
'''Rsponse timeout handler retransmit pdu or send next pdu'''
|
||||||
|
|||||||
Reference in New Issue
Block a user