Skip to content

Commit

Permalink
Merge branch 'topic/rfc2217_less_negotiations'
Browse files Browse the repository at this point in the history
  • Loading branch information
Emantor committed Sep 10, 2018
2 parents d656868 + c8b35f4 commit 08fc229
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions serial/rfc2217.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,15 @@ def set(self, value):
the client needs to know if the change is performed he has to check the
state of this object.
"""
self.value = value
self.state = REQUESTED
self.connection.rfc2217_send_subnegotiation(self.option, self.value)
if self.connection.logger:
self.connection.logger.debug("SB Requesting {} -> {!r}".format(self.name, self.value))
if value != self.value:
self.value = value
self.state = REQUESTED
self.connection.rfc2217_send_subnegotiation(self.option, self.value)
if self.connection.logger:
self.connection.logger.debug("SB Requesting {} -> {!r}".format(self.name, self.value))
else:
if self.connection.logger:
self.connection.logger.debug("SB Requesting {} -> {!r} (skipped)".format(self.name, self.value))

def is_ready(self):
"""\
Expand Down

0 comments on commit 08fc229

Please sign in to comment.