Cli-framework

From Openmoko

Revision as of 12:06, 26 February 2010 by Marko Knöbl (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Where to get

git.freesmartphone.org => frameworkd => tools

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

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.

Where to get

git.freesmartphone.org => frameworkd => tools

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')