View source for Cli-framework

From Openmoko

Jump to: navigation, search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Administrators.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page:

Return to Cli-framework.

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 => frameworkd => tools

How to use

root@om-gta01:~# cli-framework 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()
>>> 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)