Module gammu
[show private | hide private]
[frames | no frames]

Module gammu

Module wrapping Gammu functions. Gammu is software for communication with GSM phones allowing work with most of data stored in them. Most of functionality is hidden in StateMachineclass which does all phone communication.

This documentation describes python-gammu 0.15.
Classes
StateMachine StateNachine(Locale)

Exceptions
ERR_BUG Exception corresponding to gammu error ERR_BUG.
ERR_CANCELED Exception corresponding to gammu error ERR_CANCELED.
ERR_CANTOPENFILE Exception corresponding to gammu error ERR_CANTOPENFILE.
ERR_DATACONVERTED Exception corresponding to gammu error ERR_DATACONVERTED.
ERR_DEVICEBUSY Exception corresponding to gammu error ERR_DEVICEBUSY.
ERR_DEVICECHANGESPEEDERROR Exception corresponding to gammu error ERR_DEVICECHANGESPEEDERROR.
ERR_DEVICEDTRRTSERROR Exception corresponding to gammu error ERR_DEVICEDTRRTSERROR.
ERR_DEVICELOCKED Exception corresponding to gammu error ERR_DEVICELOCKED.
ERR_DEVICENODRIVER Exception corresponding to gammu error ERR_DEVICENODRIVER.
ERR_DEVICENOPERMISSION Exception corresponding to gammu error ERR_DEVICENOPERMISSION.
ERR_DEVICENOTEXIST Exception corresponding to gammu error ERR_DEVICENOTEXIST.
ERR_DEVICENOTWORK Exception corresponding to gammu error ERR_DEVICENOTWORK.
ERR_DEVICEOPENERROR Exception corresponding to gammu error ERR_DEVICEOPENERROR.
ERR_DEVICEPARITYERROR Exception corresponding to gammu error ERR_DEVICEPARITYERROR.
ERR_DEVICEREADERROR Exception corresponding to gammu error ERR_DEVICEREADERROR.
ERR_DEVICEWRITEERROR Exception corresponding to gammu error ERR_DEVICEWRITEERROR.
ERR_EMPTY Exception corresponding to gammu error ERR_EMPTY.
ERR_EMPTYSMSC Exception corresponding to gammu error ERR_EMPTYSMSC.
ERR_FILEALREADYEXIST Exception corresponding to gammu error ERR_FILEALREADYEXIST.
ERR_FILENOTEXIST Exception corresponding to gammu error ERR_FILENOTEXIST.
ERR_FILENOTSUPPORTED Exception corresponding to gammu error ERR_FILENOTSUPPORTED.
ERR_FOLDERNOTEMPTY Exception corresponding to gammu error ERR_FOLDERNOTEMPTY.
ERR_FOLDERPART Exception corresponding to gammu error ERR_FOLDERPART.
ERR_FRAMENOTREQUESTED Exception corresponding to gammu error ERR_FRAMENOTREQUESTED.
ERR_FULL Exception corresponding to gammu error ERR_FULL.
ERR_GNAPPLETWRONG Exception corresponding to gammu error ERR_GNAPPLETWRONG.
ERR_INSIDEPHONEMENU Exception corresponding to gammu error ERR_INSIDEPHONEMENU.
ERR_INVALIDDATA Exception corresponding to gammu error ERR_INVALIDDATA.
ERR_INVALIDDATETIME Exception corresponding to gammu error ERR_INVALIDDATETIME.
ERR_INVALIDLOCATION Exception corresponding to gammu error ERR_INVALIDLOCATION.
ERR_MEMORY Exception corresponding to gammu error ERR_MEMORY.
ERR_MOREMEMORY Exception corresponding to gammu error ERR_MOREMEMORY.
ERR_NEEDANOTHERANSWER Exception corresponding to gammu error ERR_NEEDANOTHERANSWER.
ERR_NOSIM Exception corresponding to gammu error ERR_NOSIM.
ERR_NOTCONNECTED Exception corresponding to gammu error ERR_NOTCONNECTED.
ERR_NOTIMPLEMENTED Exception corresponding to gammu error ERR_NOTIMPLEMENTED.
ERR_NOTSUPPORTED Exception corresponding to gammu error ERR_NOTSUPPORTED.
ERR_OTHERCONNECTIONREQUIRED Exception corresponding to gammu error ERR_OTHERCONNECTIONREQUIRED.
ERR_PERMISSION Exception corresponding to gammu error ERR_PERMISSION.
ERR_PHONEOFF Exception corresponding to gammu error ERR_PHONEOFF.
ERR_SECURITYERROR Exception corresponding to gammu error ERR_SECURITYERROR.
ERR_SHOULDBEFILE Exception corresponding to gammu error ERR_SHOULDBEFILE.
ERR_SHOULDBEFOLDER Exception corresponding to gammu error ERR_SHOULDBEFOLDER.
ERR_SOURCENOTAVAILABLE Exception corresponding to gammu error ERR_SOURCENOTAVAILABLE.
ERR_TIMEOUT Exception corresponding to gammu error ERR_TIMEOUT.
ERR_UNKNOWN Exception corresponding to gammu error ERR_UNKNOWN.
ERR_UNKNOWNCONNECTIONTYPESTRING Exception corresponding to gammu error ERR_UNKNOWNCONNECTIONTYPESTRING.
ERR_UNKNOWNFRAME Exception corresponding to gammu error ERR_UNKNOWNFRAME.
ERR_UNKNOWNMODELSTRING Exception corresponding to gammu error ERR_UNKNOWNMODELSTRING.
ERR_UNKNOWNRESPONSE Exception corresponding to gammu error ERR_UNKNOWNRESPONSE.
ERR_WORKINPROGRESS Exception corresponding to gammu error ERR_WORKINPROGRESS.
ERR_WRONGCRC Exception corresponding to gammu error ERR_WRONGCRC.
GSMError Generic class as parent for all gammu exceptions.

Function Summary
  DecodeSMS(Messages, EMS)
Decodes multi part SMS message.
  EncodeSMS(MessageInfo)
Encodes multi part SMS message.
  LinkSMS(Messages, EMS)
Links multi part SMS messages.
  ReadBackup(Filename)
Reads backup into file.
  ReadSMSBackup(Filename)
Reads SMS backup into file.
  SaveBackup(Filename, Backup, UseUnicode)
Saves backup into file.
  SaveRingtone(Filename, Ringtone, Format)
Saves ringtone into file.
  SaveSMSBackup(Filename, Backup)
Saves SMS backup into file.
  SetDebugFile(File)
Sets global debug file.
  SetDebugLevel(Level)
Sets global debug level accorting to passed string.
  Version()
Get version information.

Variable Summary
dict Errors: Mapping of exceptions to gammu error codes.

Function Details

DecodeSMS(Messages, EMS)

Decodes multi part SMS message.
Parameters:
Messages - Nessages to decode
           (type=list)
EMS - Whether to use EMS, defalt to True
           (type=bool)
Returns:
Multi part message information

EncodeSMS(MessageInfo)

Encodes multi part SMS message.
Parameters:
MessageInfo - Description of message
           (type=dict)
Returns:
Dictionary with raw message

LinkSMS(Messages, EMS)

Links multi part SMS messages.
Parameters:
Messages - List of messages to link
           (type=list)
EMS - Whether to detect ems, defauls to True
           (type=bool)
Returns:
List of linked messages

ReadBackup(Filename)

Reads backup into file.
Parameters:
Filename - Name of file where backup is stored
           (type=string)
Returns:
Dictionary of read entries, it contains following keys, each might be empty:
  • IMEI
  • Model
  • Creator
  • PhonePhonebook
  • SIMPhonebook
  • Calendar
  • ToDo
  • DateTime

ReadSMSBackup(Filename)

Reads SMS backup into file.
Parameters:
Filename - Name of file where SMS backup is stored
           (type=string)
Returns:
List of messages read from file

SaveBackup(Filename, Backup, UseUnicode)

Saves backup into file.
Parameters:
Filename - Name of file to read backup from
           (type=string)
Backup - Backup data, see ReadBackup for description
           (type=dict)
UseUnicode - Whether to use unicode (UCS2-BE) for saving backup, default True
           (type=bool)
Returns:
None

SaveRingtone(Filename, Ringtone, Format)

Saves ringtone into file.
Parameters:
Filename - Name of file where ringote will be saved
           (type=string)
Ringtone - Ringtone to save
           (type=dict)
Format - One of 'ott', 'mid', 'rng', 'imy', 'wav', 'rttl'
           (type=string)
Returns:
None

SaveSMSBackup(Filename, Backup)

Saves SMS backup into file.
Parameters:
Filename - Name of file where to save SMS backup
           (type=string)
Backup - List of messages to store
           (type=list)
Returns:
None

SetDebugFile(File)

Sets global debug file.
Parameters:
File - File where to write debug stuff (as configured by SetDebugLevel). Can be either None for no file, Python file object or filename.
           (type=mixed)
Returns:
None

SetDebugLevel(Level)

Sets global debug level accorting to passed string. You need to configure output file using SetDebugFile to activate it.
Parameters:
Level - name of debug level to use, currently one of:
  • nothing
  • text
  • textall
  • binary
  • errors
  • textdate
  • textalldate
  • errorsdate

           (type=string)
Returns:
None

Version()

Get version information.
Returns:
Tuple of python-gammu and Gammu versions.

Variable Details

Errors

Mapping of exceptions to gammu error codes.
Type:
dict
Value:
{'ERR_BUG': 37,
 'ERR_CANCELED': 38,
 'ERR_CANTOPENFILE': 28,
 'ERR_DATACONVERTED': 53,
 'ERR_DEVICEBUSY': 5,
 'ERR_DEVICECHANGESPEEDERROR': 10,
 'ERR_DEVICEDTRRTSERROR': 9,
 'ERR_DEVICELOCKED': 3,
...                                                                    

Generated by Epydoc 2.1 on Fri Sep 22 08:28:06 2006 http://epydoc.sf.net