Cli-framework
From Openmoko
(Difference between revisions)
Marko Knöbl (Talk | contribs) (clean up) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | '''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() |
− | [' | + | [ '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() | ||
− | + | { '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() | ||
− | + | 'READY' | |
− | >>> contacts=gsmsim.RetrievePhonebook() | + | |
+ | >>> gsmsim.ListPhonebooks() | ||
+ | ['emergency', 'dialed', 'received', 'contacts', 'missed', 'own'] | ||
+ | |||
+ | >>> contacts=gsmsim.RetrievePhonebook('contacts') | ||
+ | |||
>>> contacts[0] | >>> contacts[0] | ||
− | + | (1, 'Mickey', '+4912345678') | |
+ | |||
>>> contacts[1] | >>> contacts[1] | ||
− | + | (79, 'MNP-Info', '+4917710667') | |
+ | |||
>>> contacts[2] | >>> contacts[2] | ||
− | + | (80, 'Sperrnotruf', '+49177116116') | |
</pre> | </pre> | ||
− | [[Category: | + | [[Category:FSO]] |
Latest revision as of 13: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')