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

docs: Fix a few typos #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gsmmodem/modem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ def deleteMultipleStoredSms(self, delFlag=4, memory=None):
""" Deletes all SMS messages that have the specified read status.

The messages are read from the memory set by the "memory" parameter.
The value of the "delFlag" paramater is the same as the "DelFlag" parameter of the +CMGD command:
The value of the "delFlag" parameter is the same as the "DelFlag" parameter of the +CMGD command:
1: Delete All READ messages
2: Delete All READ and SENT messages
3: Delete All READ, SENT and UNSENT messages
Expand Down Expand Up @@ -1243,7 +1243,7 @@ def sendDtmfTone(self, tones):

Note: this is highly device-dependent, and might not work

:param digits: A str containining one or more DTMF tones to play, e.g. "3" or "\*123#"
:param digits: A str containing one or more DTMF tones to play, e.g. "3" or "\*123#"

:raise CommandError: if the command failed/is not supported
:raise InvalidStateException: if the call has not been answered, or is ended while the command is still executing
Expand Down
4 changes: 2 additions & 2 deletions gsmmodem/pdu.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def encodeSmsSubmitPdu(number, text, reference=0, validity=None, smsc=None, requ
def decodeSmsPdu(pdu):
""" Decodes SMS pdu data and returns a tuple in format (number, text)

:param pdu: PDU data as a hex string, or a bytearray containing PDU octects
:param pdu: PDU data as a hex string, or a bytearray containing PDU octets
:type pdu: str or bytearray

:raise EncodingError: If the specified PDU data cannot be decoded
Expand Down Expand Up @@ -527,7 +527,7 @@ def _encodeTimestamp(timestamp):

def _decodeDataCoding(octet):
if octet & 0xC0 == 0:
#compressed = octect & 0x20
#compressed = octet & 0x20
alphabet = (octet & 0x0C) >> 2
return alphabet # 0x00 == GSM-7, 0x01 == 8-bit data, 0x02 == UCS2
# We ignore other coding groups
Expand Down
2 changes: 1 addition & 1 deletion test/test_gsmterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_deleteSingle(self):
self.assertRaises(KeyError, self.trie.__delitem__, 'unknown key')
# Delete zero-length unknown key
self.assertRaises(KeyError, self.trie.__delitem__, '')
# Delete zero-lenght known key
# Delete zero-length known key
self.trie[''] = '123'
self.assertEqual(len(self.trie), 1)
del self.trie['']
Expand Down
12 changes: 6 additions & 6 deletions test/test_modem.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def test_smscPreloaded(self):
gsmmodem.serial_comms.serial = mockSerial
modem = gsmmodem.modem.GsmModem('-- PORT IGNORED DURING TESTS --')
modem.connect()
# Make sure SMSC number was prevented from being deleted (some modems do this when setting text-mode paramters AT+CSMP)
# Make sure SMSC number was prevented from being deleted (some modems do this when setting text-mode parameters AT+CSMP)
self.assertEqual(test, modem.smsc, 'SMSC number was changed/deleted during connect()')
modem.close()
FAKE_MODEM = None
Expand Down Expand Up @@ -1157,7 +1157,7 @@ def callbackFunc(call):

def test_incomingCallCrcChangedExternally(self):
""" Tests handling incoming call notifications when the +CRC setting \
was modfied by some external program (issue #18) """
was modified by some external program (issue #18) """

callReceived = [False]
def callbackFunc(call):
Expand Down Expand Up @@ -1353,8 +1353,8 @@ def writeCallbackFunc2(data):
self.modem.close()

def test_sendSmsResponseMixedWithUnsolictedMessages(self):
""" Tests sending a SMS messages (PDU mode), but with unsolicted messages mixed into the modem responses
- the only difference here is that the modem's responseSequence contains unsolicted messages
""" Tests sending a SMS messages (PDU mode), but with unsolicited messages mixed into the modem responses
- the only difference here is that the modem's responseSequence contains unsolicited messages
taken from github issue #11
"""
self.initModem(None)
Expand All @@ -1369,14 +1369,14 @@ def test_sendSmsResponseMixedWithUnsolictedMessages(self):
def writeCallbackFunc(data):
def writeCallbackFunc2(data):
self.assertEqual('{0}{1}'.format(pduHex, chr(26)), data, 'Invalid data written to modem; expected "{0}", got: "{1}"'.format('{0}{1}'.format(pduHex, chr(26)), data))
# Note thee +ZDONR and +ZPASR unsolicted messages in the "response"
# Note thee +ZDONR and +ZPASR unsolicited messages in the "response"
self.modem.serial.responseSequence = ['+ZDONR: "METEOR",272,3,"CS_ONLY","ROAM_OFF"\r\n', '+ZPASR: "UMTS"\r\n', '+ZDONR: "METEOR",272,3,"CS_PS","ROAM_OFF"\r\n', '+ZPASR: "UMTS"\r\n', '+CMGS: {0}\r\n'.format(ref), 'OK\r\n']
self.assertEqual('AT+CMGS={0}\r'.format(calcPdu.tpduLength), data, 'Invalid data written to modem; expected "{0}", got: "{1}"'.format('AT+CMGS={0}'.format(calcPdu.tpduLength), data))
self.modem.serial.writeCallbackFunc = writeCallbackFunc2
self.modem.serial.writeCallbackFunc = writeCallbackFunc
self.modem.serial.flushResponseSequence = True

# Note thee +ZDONR and +ZPASR unsolicted messages in the "response"
# Note thee +ZDONR and +ZPASR unsolicited messages in the "response"
self.modem.serial.responseSequence = ['+ZDONR: "METEOR",272,3,"CS_ONLY","ROAM_OFF"\r\n', '+ZPASR: "UMTS"\r\n', '> \r\n']

sms = self.modem.sendSms(number, message)
Expand Down