Skip to content

Commit 981dfa9

Browse files
committed
send_sms max_message argument re-added
modified: lib/pygsm/gsmmodem.py
1 parent f84f5ba commit 981dfa9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/pygsm/gsmmodem.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# debian/ubuntu: apt-get install python-tz
88

99
import re
10-
import datetime
1110
import time
1211
import errors
1312
import threading
@@ -434,7 +433,7 @@ def query(self, cmd, prefix=None):
434433
return None
435434

436435

437-
def send_sms(self, recipient, text):
436+
def send_sms(self, recipient, text, max_messages = 255):
438437
"""
439438
Sends an SMS to _recipient_ containing _text_.
440439
@@ -444,10 +443,12 @@ def send_sms(self, recipient, text):
444443
To enforce only a single SMS, set max_messages=1
445444
446445
Raises 'ValueError' if text will not fit in max_messages
446+
447+
NOTE: Only PDU mode respects max_messages! It has no effect in TEXT mode
447448
448449
"""
449450
with self.modem_lock:
450-
self.smshandler.send_sms(recipient, text)
451+
self.smshandler.send_sms(recipient, text, max_messages)
451452

452453
def break_out_of_prompt(self):
453454
self._write(chr(27))

0 commit comments

Comments
 (0)