Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to set (RTS/CTS) and (DSR/DTR) flows control #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

khssnv
Copy link

@khssnv khssnv commented Apr 14, 2019

I've tried python-gsmmodem with SIMCOM SIM300 based modem (ОВЕН ПМ01), it needs (RTS/CTS) and (DSR/DTR) set False.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 89.814% when pulling bb3bc05 on khssnv:master into 5c816ba on babca:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 89.814% when pulling bb3bc05 on khssnv:master into 5c816ba on babca:master.

@devegied
Copy link

#63

Copy link
Collaborator

@lcnittl lcnittl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the proposed changes!

pySerial's defaults for both rtscts and dsrdtr are False (cf. pySerial API), thus, please change the defaults in the __init__ funcs to False as well to mimic the behavior before this PR.

After this, should be fine to merge.

@@ -22,7 +22,7 @@ class SerialComms(object):
# Default timeout for serial port reads (in seconds)
timeout = 1

def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCallbackFunc=None, *args, **kwargs):
def __init__(self, port, baudrate=115200, rtscts=True, dsrdtr=True, notifyCallbackFunc=None, fatalErrorCallbackFunc=None, *args, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@@ -147,8 +147,8 @@ class GsmModem(SerialComms):
CDSI_REGEX = re.compile('\+CDSI:\s*"([^"]+)",(\d+)$')
CDS_REGEX = re.compile('\+CDS:\s*([0-9]+)"$')

def __init__(self, port, baudrate=115200, incomingCallCallbackFunc=None, smsReceivedCallbackFunc=None, smsStatusReportCallback=None, requestDelivery=True, AT_CNMI="", *a, **kw):
super(GsmModem, self).__init__(port, baudrate, notifyCallbackFunc=self._handleModemNotification, *a, **kw)
def __init__(self, port, baudrate=115200, rtscts=True, dsrdtr=True, incomingCallCallbackFunc=None, smsReceivedCallbackFunc=None, smsStatusReportCallback=None, requestDelivery=True, AT_CNMI="", *a, **kw):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change here...

@@ -47,7 +49,7 @@ def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCal

def connect(self):
""" Connects to the device and starts the read thread """
self.serial = serial.Serial(dsrdtr=True, rtscts=True, port=self.port, baudrate=self.baudrate,
self.serial = serial.Serial(rtscts=self.rtscts, dsrdtr=self.dsrdtr, port=self.port, baudrate=self.baudrate,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put rtscts and dsrdtr after timeout

@alza54
Copy link

alza54 commented Dec 15, 2021

We need this.

@lcnittl
Copy link
Collaborator

lcnittl commented Dec 15, 2021

We need this.

@alza54 I will see if I manage to integrate it on the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants