Cli-framework

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Replacing 'OpenMoko' with 'Openmoko')
(clean up)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=An interactive python command line for testing the framework=
+
'''Cli-framework''' is an interactive python command line for testing the [[FSO]] framework. With cli-framework you can explore the whole interface of the framework in an interactive way. It's the perfect tool for testing the API.
 
+
With cli-framework you can explore the whole interface of the framework in an interactive way. It's the perfect tool for testing the API.
+
  
 
==Where to get==
 
==Where to get==
Line 8: Line 6:
  
 
==How to use==
 
==How to use==
 +
 +
For a list of available commands see [http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/index.html;hb=HEAD the FSO API docs]!
  
 
<pre>
 
<pre>
Line 13: Line 13:
  
 
freesmartphone.org interactive command line
 
freesmartphone.org interactive command line
>>> dir()                                
+
>>> dir()
['LOG_DEBUG', 'LOG_ERR', 'LOG_INFO', 'LOG_WARNING', 'MainLoop', '__builtins__', '__doc__', '__file__', '__name__', 'atexit', 'audio', 'bus', 'code', 'console', 'dbus', 'getInterface', 'getObject', 'gsm', 'gsmcall', 'gsmdevice', 'gsmnetwork', 'gsmpdp', 'gsmsim', 'gsmtest', 'handler', 'hz', 'idle', 'mainloop', 'os', 'readline', 'rlcompleter', 'runmainloop', 'sys', 'syslog']                                                                                    
+
      [   'MainLoop',
>>>                                                                                                                                                     
+
    '__builtins__',
 +
    '__doc__',
 +
    '__file__',
 +
    '__name__',
 +
    '__version__',
 +
    'atexit',
 +
    'bat',
 +
    'bus',
 +
    'code',
 +
    'console',
 +
    'contact',
 +
    'dbus',
 +
    'dbus_to_python',
 +
    'devaudio',
 +
    'devidle',
 +
    'display',
 +
    'events',
 +
    'framework',
 +
    'frameworkiface',
 +
    'getInterface',
 +
    'getObject',
 +
    'getObjectsForInterface',
 +
    'gps',
 +
    'gpsaccuracy',
 +
    'gpsposition',
 +
    'gpssatellite',
 +
    'gpstime',
 +
    'gsm',
 +
    'gsmcall',
 +
    'gsmdebug',
 +
    'gsmdevice',
 +
    'gsmnetwork',
 +
    'gsmpdp',
 +
    'gsmsim',
 +
    'gsmsms',
 +
    'gsmtest',
 +
    'handler',
 +
    'hz',
 +
    'leds',
 +
    'mainloop',
 +
    'os',
 +
    'pim',
 +
    'pimsources',
 +
    'pp',
 +
    'pprint',
 +
    'preferences',
 +
    'prettyPrint',
 +
    'readline',
 +
    'rlcompleter',
 +
    'runmainloop',
 +
    'sys',
 +
    'types',
 +
    'ubxdebug',
 +
    'usage',
 +
    'usageiface']
 +
                       
 
>>> gsmdevice.GetInfo()                                                                                                                                   
 
>>> gsmdevice.GetInfo()                                                                                                                                   
dbus.Dictionary({dbus.String(u'imei'): dbus.String(u'354651011204130', variant_level=1), dbus.String(u'model'): dbus.String(u'Neo1973 Embedded GSM Modem', variant_level=1), dbus.String(u'revision'): dbus.String(u'HW: GTA, GSM: gsm_ac_gp_fd_pu_em_cph_ds_vc_cal35_ri_36_amd8_ts0-Moko9-beta1', variant_level=1), dbus.String(u'manufacturer'): dbus.String(u'FIC/Openmoko', variant_level=1)}, signature=dbus.Signature('sv'))                                       
+
{   'imei': '111222333444555666',
 +
    'manufacturer': 'FIC/OpenMoko',
 +
    'model': '"Neo1973 GTA02 Embedded GSM Modem"',
 +
    'revision': '"HW: GTA02BV5, GSM: gsm_ac_gp_fd_pu_em_cph_ds_vc_cal35_ri_36_amd8_ts0-Moko8"'}
 +
 
 
>>> gsmsim.GetAuthStatus()
 
>>> gsmsim.GetAuthStatus()
dbus.String(u'READY')
+
'READY'
>>> contacts=gsmsim.RetrievePhonebook()
+
 
 +
>>> gsmsim.ListPhonebooks()
 +
['emergency', 'dialed', 'received', 'contacts', 'missed', 'own']
 +
 
 +
>>> contacts=gsmsim.RetrievePhonebook('contacts')
 +
 
 
>>> contacts[0]
 
>>> contacts[0]
dbus.Struct((dbus.Int32(1), dbus.String(u'Mickey'), dbus.String(u'+4912345678')), signature=None)
+
(1, 'Mickey', '+4912345678')
 +
 
 
>>> contacts[1]
 
>>> contacts[1]
dbus.Struct((dbus.Int32(79), dbus.String(u'MNP-Info'), dbus.String(u'+4917710667')), signature=None)
+
(79, 'MNP-Info', '+4917710667')
 +
 
 
>>> contacts[2]
 
>>> contacts[2]
dbus.Struct((dbus.Int32(80), dbus.String(u'Sperrnotruf'), dbus.String(u'+49177116116')), signature=None)
+
(80, 'Sperrnotruf', '+49177116116')
 
</pre>
 
</pre>
  
[[Category:Framework]]
+
[[Category:FSO]]

Latest revision as of 12:06, 26 February 2010

Cli-framework is an interactive python command line for testing the FSO framework. With cli-framework you can explore the whole interface of the framework in an interactive way. It's the perfect tool for testing the API.

[edit] Where to get

git.freesmartphone.org => frameworkd => tools

[edit] How to use

For a list of available commands see the FSO API docs!

root@om-gta01:~# cli-framework 

freesmartphone.org interactive command line
>>> dir()
       [   'MainLoop',
    '__builtins__',
    '__doc__',
    '__file__',
    '__name__',
    '__version__',
    'atexit',
    'bat',
    'bus',
    'code',
    'console',
    'contact',
    'dbus',
    'dbus_to_python',
    'devaudio',
    'devidle',
    'display',
    'events',
    'framework',
    'frameworkiface',
    'getInterface',
    'getObject',
    'getObjectsForInterface',
    'gps',
    'gpsaccuracy',
    'gpsposition',
    'gpssatellite',
    'gpstime',
    'gsm',
    'gsmcall',
    'gsmdebug',
    'gsmdevice',
    'gsmnetwork',
    'gsmpdp',
    'gsmsim',
    'gsmsms',
    'gsmtest',
    'handler',
    'hz',
    'leds',
    'mainloop',
    'os',
    'pim',
    'pimsources',
    'pp',
    'pprint',
    'preferences',
    'prettyPrint',
    'readline',
    'rlcompleter',
    'runmainloop',
    'sys',
    'types',
    'ubxdebug',
    'usage',
    'usageiface']
                         
>>> gsmdevice.GetInfo()                                                                                                                                  
{   'imei': '111222333444555666',
    'manufacturer': 'FIC/OpenMoko',
    'model': '"Neo1973 GTA02 Embedded GSM Modem"',
    'revision': '"HW: GTA02BV5, GSM: gsm_ac_gp_fd_pu_em_cph_ds_vc_cal35_ri_36_amd8_ts0-Moko8"'}

>>> gsmsim.GetAuthStatus()
'READY'

>>> gsmsim.ListPhonebooks()
['emergency', 'dialed', 'received', 'contacts', 'missed', 'own']

>>> contacts=gsmsim.RetrievePhonebook('contacts')

>>> contacts[0]
(1, 'Mickey', '+4912345678')

>>> contacts[1]
(79, 'MNP-Info', '+4917710667')

>>> contacts[2]
(80, 'Sperrnotruf', '+49177116116')
Personal tools

An interactive python command line for testing the framework

With cli-framework you can explore the whole interface of the framework in an interactive way. It's the perfect tool for testing the API.

Where to get

git.freesmartphone.org => frameworkd => tools

How to use

root@om-gta01:~# cli-framework 

freesmartphone.org interactive command line
>>> dir()                                  
['LOG_DEBUG', 'LOG_ERR', 'LOG_INFO', 'LOG_WARNING', 'MainLoop', '__builtins__', '__doc__', '__file__', '__name__', 'atexit', 'audio', 'bus', 'code', 'console', 'dbus', 'getInterface', 'getObject', 'gsm', 'gsmcall', 'gsmdevice', 'gsmnetwork', 'gsmpdp', 'gsmsim', 'gsmtest', 'handler', 'hz', 'idle', 'mainloop', 'os', 'readline', 'rlcompleter', 'runmainloop', 'sys', 'syslog']                                                                                     
>>>                                                                                                                                                      
>>> gsmdevice.GetInfo()                                                                                                                                  
dbus.Dictionary({dbus.String(u'imei'): dbus.String(u'354651011204130', variant_level=1), dbus.String(u'model'): dbus.String(u'Neo1973 Embedded GSM Modem', variant_level=1), dbus.String(u'revision'): dbus.String(u'HW: GTA, GSM: gsm_ac_gp_fd_pu_em_cph_ds_vc_cal35_ri_36_amd8_ts0-Moko9-beta1', variant_level=1), dbus.String(u'manufacturer'): dbus.String(u'FIC/Openmoko', variant_level=1)}, signature=dbus.Signature('sv'))                                         
>>> gsmsim.GetAuthStatus()
dbus.String(u'READY')
>>> contacts=gsmsim.RetrievePhonebook()
>>> contacts[0]
dbus.Struct((dbus.Int32(1), dbus.String(u'Mickey'), dbus.String(u'+4912345678')), signature=None)
>>> contacts[1]
dbus.Struct((dbus.Int32(79), dbus.String(u'MNP-Info'), dbus.String(u'+4917710667')), signature=None)
>>> contacts[2]
dbus.Struct((dbus.Int32(80), dbus.String(u'Sperrnotruf'), dbus.String(u'+49177116116')), signature=None)