diff --git a/gsmmodem/modem.py b/gsmmodem/modem.py index 7b37dbd..d075808 100644 --- a/gsmmodem/modem.py +++ b/gsmmodem/modem.py @@ -679,13 +679,13 @@ def smsEncoding(self, encoding): self._commands = self.supportedCommands if self._commands == None: - if encoding != self._encoding: + if encoding != self._smsEncoding: raise CommandError('Unable to set SMS encoding (no supported commands)') else: return if not '+CSCS' in self._commands: - if encoding != self._encoding: + if encoding != self._smsEncoding: raise CommandError('Unable to set SMS encoding (+CSCS command not supported)') else: return @@ -703,7 +703,7 @@ def smsEncoding(self, encoding): self._smsEncoding = encoding return - if encoding != self._encoding: + if encoding != self._smsEncoding: raise ValueError('Unable to set SMS encoding (enocoding {0} not supported)'.format(encoding)) else: return