gsmdecode.py support integration
authorkibergus <kibergus@gmail.com>
Wed, 6 Jan 2010 21:10:28 +0000 (21:10 +0000)
committerkibergus <kibergus@gmail.com>
Wed, 6 Jan 2010 21:10:28 +0000 (21:10 +0000)
git-svn-id: file:///svnroot/ussd-widget/trunk@8 d197f4d6-dc93-42ad-8354-0da1f58e353f

ussd-common/build_ussd-common.py
ussd-common/src/usr/bin/ussdquery.py

index 1fac39e..c2c91e3 100644 (file)
@@ -39,7 +39,7 @@ chmod +s /usr/bin/pnatd
 """ #Set here your post install script
 
     version = "0.0.0"
-    build = "2" 
+    build = "3" 
     changeloginformation = "First release" 
    
     dir_name = "src"     
index 51fa6f0..7785511 100755 (executable)
@@ -10,6 +10,7 @@ import pexpect
 import time
 from subprocess import *
 import sys
+import gsmdecode
 
 if len(sys.argv) != 2:
     print "Usage: ussdquery.py <ussd number>"
@@ -37,13 +38,8 @@ encoding = replystring[end+2:].strip();
 
 child.sendeof();
 
-# Check if we need to decode answer
-# Compressed messages are not supported yet
-if encoding == '86':
-    reply = reply.decode("hex")
-elif encoding == '72':
-    reply = reply.decode("hex")
-    reply = reply.decode("UTF-16 BE")
+# Decoding ansver
+reply = gsmdecode.decode(reply, int(encoding))
 
 print reply;