Skip to content

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

Open
khssnv wants to merge 1 commit into
babca:masterfrom
khssnv:master
Open

Allow user to set (RTS/CTS) and (DSR/DTR) flows control#76
khssnv wants to merge 1 commit into
babca:masterfrom
khssnv:master

Conversation

@khssnv

@khssnv khssnv commented Apr 14, 2019

Copy link
Copy Markdown

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

@coveralls

Copy link
Copy Markdown

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
Copy Markdown

Coverage Status

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

@devegied

Copy link
Copy Markdown

#63

@lcnittl lcnittl left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread gsmmodem/serial_comms.py
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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and here

Comment thread gsmmodem/modem.py

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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Change here...

Comment thread gsmmodem/serial_comms.py
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
Copy Markdown
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

alza54 commented Dec 15, 2021

Copy link
Copy Markdown

We need this.

@lcnittl

lcnittl commented Dec 15, 2021

Copy link
Copy Markdown
Collaborator

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.

5 participants