Class w.c.p.p.PDU(object):

Part of wader.contrib.pdu_sms.pdu View In Hierarchy

No class docstring
Method __init__ Create a PDU with encoding specified by pduformat
Method encode_pdu Returns a tuple of message length and PDU
Method decode_pdu Decodes a complete SMS pdu and returns a tuple strings
Method decode_cds_pdu Decodes a complete CDS pdu and returns a tuple strings
def __init__(self, pduformat=None):

Create a PDU with encoding specified by pduformat

If pduformat is None, it will try to infer the encoding itself

pdu.SEVENBIT = 7-bit GSM text (160 char limit) pdu.EIGHTBIT = 8-bit code - no manipulation (140 char limit) pdu.UNICODE = each char is two byte unicode (70 char limit)
def _find_out_pduformat(self, text):
Undocumented
def encode_pdu(self, number, text, csca='', request_status=False, msgref=0, msgvp=170):

Returns a tuple of message length and PDU

csca = SMSC number request_status = True, False msgref = currently ignored integer 0-255 msgvp = relative validity period as per ETSI (0xff == no validity) Message Encoding format defined by pduformat attribute SMSC can be ommited if phone can use internal defaults
def _unpack_msg(self, pdu, limit=160):
Unpacks pdu into 7-bit characters and returns the decoded string
def decode_pdu(self, pdu):
Decodes a complete SMS pdu and returns a tuple strings sender, # Senders number datestr, # GSM format date string msg, # The actual msg less any header in UCS2 format ref, # Msg reference (from SMSC) cnt, # Number of msg in the sequence (concat msgs) seq # Sequence number of the msg (concat msgs) fmt # Format of recieved msg
def decode_cds_pdu(self, pdu):
Decodes a complete CDS pdu and returns a tuple strings sender, # Senders number datestr, # GSM format date string msg, # The actual msg less any header in utf-8 format ref, # Msg reference (from SMSC) cnt, # Number of msg in the sequence (concat msgs) seq # Sequence number of the msg (concat msgs)
def _cleanNumber(self, number):

Returns clean number

Makes sure numbers are stripped of unwanted characters
def _get_phone_pdu(self, number):
Converts number to pdu format
def _get_smsc_pdu(self, number):
Converts SMSC number string to expected pdu format for SMSC number
def _convert_message(self, message):

Converts 7-bit and Unicode message to correct format

Does nothing with 8-bit except calc length at front
API Documentation for wader-core, generated by pydoctor at 2008-08-27 16:53:37.