Skip to content

Commit

Permalink
Misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoomakethu committed Mar 27, 2022
1 parent 1564f00 commit 018d618
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version 3.0.0dev2
----------------------------------------------------------
* Fix mask_write_register call. (#685)
* Add support for byte strings in the device information fields (#693)
* Catch socket going away. (#722)
* Misc typo errors (#718)

version 3.0.0dev1
----------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions pymodbus/repl/server/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
| | \___ | Y Y ( <_> ) /_/ | | \_\ \ | /\___ \ / \ ___/| | \/\ /\ ___/| | \/
|____| / ____|__|_| /\____/\____ | |___ /____//____ > /_______ /\___ >__| \_/ \___ >__|
\/ \/ \/ \/ \/ \/ \/ \/
1.0.0
"""

SMALL_TITLE = "Pymodbus server..."
Expand Down
22 changes: 14 additions & 8 deletions pymodbus/server/async_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,20 @@ def connection_made(self, transport):
corresponds to the socket being opened
"""
try:
if hasattr(transport, 'get_extra_info') and transport.get_extra_info('sockname') is not None:
_logger.debug("Socket [%s:%s] opened" % transport.get_extra_info('sockname'))
else:
if hasattr(transport, 'serial'):
if hasattr(transport,
'get_extra_info') and transport.get_extra_info(
'sockname') is not None:
_logger.debug(
"Socket [%s:%s] opened" % transport.get_extra_info(
'sockname')[:2])
elif hasattr(transport, 'serial'):
_logger.debug(
"Serial connection opened on port: {}".format(transport.serial.port)
"Serial connection opened on port: {}".format(
transport.serial.port)
)

else:
_logger.warning(f"Unabel to get information about"
f" transport {transport}")
self.transport = transport
self.running = True
self.framer = self.server.framer(self.server.decoder, client=None)
Expand Down Expand Up @@ -721,7 +727,7 @@ def __init__(self, context, framer=None, identity=None, **kwargs): # pragma: no
to a missing slave
:param broadcast_enable: True to treat unit_id 0 as broadcast address,
False to treat 0 as any other unit_id
:param autoreonnect: True to enable automatic reconnection,
:param auto_reconnect: True to enable automatic reconnection,
False otherwise
:param reconnect_delay: reconnect delay in seconds
:param response_manipulator: Callback method for
Expand Down Expand Up @@ -803,7 +809,7 @@ def on_connection_lost(self):
self._check_reconnect()

def _check_reconnect(self):
_logger.debug("checkking autoreconnect {} {}".format(
_logger.debug("checking autoreconnect {} {}".format(
self.auto_reconnect, self.reconnecting_task))
if self.auto_reconnect and (self.reconnecting_task is None):
_logger.debug("Scheduling serial connection reconnect")
Expand Down

0 comments on commit 018d618

Please sign in to comment.