[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Daniel Willmann daniel at totalueberwachung.de
Mon Feb 2 18:51:54 UTC 2009


The following commit has been merged in the master branch:
commit cf8ecea98c44799da68841da684324b0649618a6
Author: Daniel Willmann <daniel at totalueberwachung.de>
Date:   Mon Jan 12 13:35:56 2009 +0100

    ogsmd: Add new properties to SMS messages
    
    This adds support for setting and getting alphabet (encoding) and PID
    over sms.properties

diff --git a/framework/subsystems/ogsmd/gsm/const.py b/framework/subsystems/ogsmd/gsm/const.py
index 93f6c85..9bed9fc 100644
--- a/framework/subsystems/ogsmd/gsm/const.py
+++ b/framework/subsystems/ogsmd/gsm/const.py
@@ -724,6 +724,13 @@ SMS_PDU_STATUS_IN = { \
 }
 
 #=========================================================================#
+SMS_ALPHABET_TO_ENCODING = { \
+    "gsm_default": "gsm_default",
+    "ucs2": "utf_16_be",
+    "binary": None,
+}
+
+#=========================================================================#
 CB_PDU_DCS_LANGUAGE = [ "German", "English", "Italian", "French", "Spanish",
         "Dutch", "Swedish", "Danish", "Portuguese", "Finnish",
         "Norwegian", "Greek", "Turkish", "Hungarian", "Polish", None]
diff --git a/framework/subsystems/ogsmd/gsm/sms.py b/framework/subsystems/ogsmd/gsm/sms.py
index 2187448..5f3a225 100644
--- a/framework/subsystems/ogsmd/gsm/sms.py
+++ b/framework/subsystems/ogsmd/gsm/sms.py
@@ -12,7 +12,7 @@ Module: pdu
 
 """
 from ogsmd.gsm.convert import *
-from ogsmd.gsm.const import CB_PDU_DCS_LANGUAGE, TP_MTI_INCOMING, TP_MTI_OUTGOING
+from ogsmd.gsm.const import CB_PDU_DCS_LANGUAGE, TP_MTI_INCOMING, TP_MTI_OUTGOING, SMS_ALPHABET_TO_ENCODING
 import math
 
 class SMSError(Exception):
@@ -202,6 +202,7 @@ class SMS(object):
         self.dcs_mwi_indication = None
         self.dcs_mwi_type = None
         self.dcs_mclass = None
+        self.scts = []
 
     def _parse_userdata( self, ud_len, bytes ):
         offset = 0
@@ -331,6 +332,9 @@ class SMS(object):
     def _getProperties( self ):
         map = {}
         map["type"] = self.type
+        map["pid"] = self.pid
+        SMS_ALPHABET_TO_ENCODING.index(self.dcs_alphabet)
+
         if self.type == "sms-deliver" or self.type == "sms-submit-report":
             # FIXME Return correct time with timezoneinfo
             map["timestamp"] = self.scts[0].ctime() + " %+05i" % (self.scts[1]*100)
@@ -352,6 +356,10 @@ class SMS(object):
                     self.udh[0] = [ v, properties["csm_num"], properties["csm_seq"] ]
             if k == "port":
                 self.udh[4] = [v]
+            if k == "pid":
+                self.pid = v
+            if k == "alphabet":
+                self.dcs_alphabet = SMS_ALPHABET_TO_ENCODING[v]
 
     properties = property( _getProperties, _setProperties )
 
@@ -522,6 +530,7 @@ class CellBroadcast(SMS):
         if self.dcs_language_indication is None:
             group = 0x01
             dcs = 0x00
+            # FIXME: Why is language ucs2?
             if self.dcs_language == "utf_16_be":
                 dcs = 0x01
             dcs = group << 4 | dcs

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list