Cli-framework
From Openmoko
(Difference between revisions)
DolfjeBot1 (Talk | contribs) m (Replacing 'OpenMoko' with 'Openmoko') |
m (→How to use: update) |
||
| 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:Framework]] | [[Category:Framework]] | ||
Revision as of 17:03, 25 November 2008
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()
[ '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')
