Open sherpya opened 7 years ago
I've also noticed encodeSmsSubmitPdu has a default keyword arg requestStatusReport=True
Please switch to the updated fork :slightly_smiling_face: There is optional parameter "requestDelivery=True" inside GsmModem class which sets the option that you have mentioned:
self.write('AT+CSMP=17,167,0,0', parseError=False) # Not enable delivery reports
And you're right - it is related to encodeSmsSubmitPdu
, which is used inside sendSms
method of GsmModem class:
# Encode text into PDUs
pdus = encodeSmsSubmitPdu(destination, text, reference=self._smsRef, sendFlash=sendFlash)
and should be changed into:
# Encode text into PDUs
pdus = encodeSmsSubmitPdu(destination, text, reference=self._smsRef, sendFlash=sendFlash, requestStatusReport=self.requestDelivery)
It would be also nice to take this flag into account when user sets waitForDeliveryReport=True
(sendSms
method parameter) while reports are disabled.
Could you apply those changed, verify them and make a pull request to the mentioned above repository?
the line
self.write('AT+CSMP=49,167,0,0', parseError=False) # Enable delivery reports
enables delivery reports that have often a cost
If I'm correct it should be
self.write('AT+CSMP=17,167,0,0', parseError=False) # Enable delivery reports
anyway it would be better to have it configurable