-
Notifications
You must be signed in to change notification settings - Fork 112
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
base: master
Are you sure you want to change the base?
Conversation
1 similar comment
There was a problem hiding this 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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
We need this. |
@alza54 I will see if I manage to integrate it on the weekend. |
I've tried
python-gsmmodem
with SIMCOM SIM300 based modem (ОВЕН ПМ01), it needs (RTS/CTS) and (DSR/DTR) setFalse
.