<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=213.150.1.132</id>
	<title>Maemo Wiki Mirror - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=213.150.1.132"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/213.150.1.132"/>
	<updated>2026-04-22T11:31:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/Accessing_APIs_without_Python_bindings&amp;diff=33237</id>
		<title>PyMaemo/Accessing APIs without Python bindings</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/Accessing_APIs_without_Python_bindings&amp;diff=33237"/>
		<updated>2010-09-12T11:02:14Z</updated>

		<summary type="html">&lt;p&gt;213.150.1.132: /* Accessing Items in a GList */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
There are many libraries written in C that do not have native Python bindings yet. In Maemo, one of such libraries is libosso-abook, which manipulates the address book on Maemo devices.&lt;br /&gt;
&lt;br /&gt;
While a full binding is very useful, in most cases you need to use just a couple of functions and data structures to get your work done. Instead of waiting for a binding to be implemented, you can use Python&#039;s &amp;lt;code&amp;gt;ctypes&amp;lt;/code&amp;gt; module, which allows to directly call functions and access data structures from C libraries.&lt;br /&gt;
&lt;br /&gt;
This document will explain how to do call C library functions using &amp;lt;code&amp;gt;ctypes&amp;lt;/code&amp;gt;, using mainly libosso-abook as an example. The idea has been borrowed from [http://hermes.garage.maemo.org/ Hermes] application source code, which in turn is based on the trick described on the [http://faq.pygtk.org/index.py?req=show&amp;amp;file=faq23.041.htp PyGTK FAQ].&lt;br /&gt;
&lt;br /&gt;
This document is not meant to be a complete &amp;lt;code&amp;gt;ctypes&amp;lt;/code&amp;gt; guide; for that, be sure to read the [http://docs.python.org/library/ctypes.html official API documentation]. It is assumed that you have read that document before continuing.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say you want to use &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt; from the GNU C Library. All you need in Python is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import ctypes&lt;br /&gt;
libc = ctypes.CDLL(&#039;libc.so.6&#039;)&lt;br /&gt;
libc.printf(&#039;Hello world!&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In a few words, you create an object correspondent to the library you need and use it to call the function directly. You can also store the functions in plain python objects to use them easily later:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
c_printf = libc.printf&lt;br /&gt;
c_printf(&#039;Hello libc&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Remember that those are C functions, not Python ones, so you must supply arguments of the correct type to avoid undefined behavior (such as segmentation faults). As an example, if an integer is passed to the above function, you get&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; c_printf(1)&lt;br /&gt;
 Segmentation fault (core dumped)&lt;br /&gt;
&lt;br /&gt;
== Initializing libosso-abook ==&lt;br /&gt;
&lt;br /&gt;
libosso-abook needs to be initialized by calling [http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/libosso-abook-osso-abook-init.html#osso-abook-init osso-abook-init()]. This is similar to the example above, but a little more complex because the function takes three pointers: argc, argv and the OSSO context. First of all, you must create a &amp;lt;code&amp;gt;osso.Context&amp;lt;/code&amp;gt; instance using the &amp;quot;osso&amp;quot; module (provided by python-osso):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import osso&lt;br /&gt;
&lt;br /&gt;
osso_ctx = osso.Context(&amp;quot;test_abook&amp;quot;, &amp;quot;0.1&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note: there is no documentation for python-osso yet, so see the C documentation for [http://maemo.org/api_refs/5.0/5.0-final/libosso/group__Init.html#g05d45d1e72c2cd74f665086225141431 osso_initialize()] for details about osso.Context() arguments. Note that only &amp;quot;application&amp;quot; and &amp;quot;version&amp;quot; attributes are used in Python.&lt;br /&gt;
&lt;br /&gt;
Next, load and initialize libosso-abook library:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import ctypes&lt;br /&gt;
# be sure to import gtk before calling osso_abook_init()&lt;br /&gt;
import gtk&lt;br /&gt;
&lt;br /&gt;
osso_abook = ctypes.CDLL(&#039;libosso-abook-1.0.so.0&#039;)&lt;br /&gt;
argv_type = ctypes.c_char_p * len(sys.argv)&lt;br /&gt;
argv = argv_type(*sys.argv)&lt;br /&gt;
argc = ctypes.c_int(len(sys.argv))&lt;br /&gt;
osso_abook.osso_abook_init(ctypes.byref(argc), ctypes.byref(argv), hash(osso_ctx))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The byref() function returns a pointer to the given data. The hash() function returns the memory address of the argument.&lt;br /&gt;
&lt;br /&gt;
== Calling a Function Which Returns a GObject ==&lt;br /&gt;
&lt;br /&gt;
Every GObject instance created by a C library must have a corresponding Python object, so that it can be manipulated on Python code. This object, which acts like a &amp;quot;wrapper&amp;quot; around the C pointer, is created using the pygobject_new() C function. Unfortunately, pygobject_new() is not a plain function, but a macro which points to a function pointer in a struct (see /usr/include/pygtk-2.0/pygobject.h on the &amp;quot;#define pygobject_new ...&amp;quot; line), making it a little more complex to be called from Python. The snippet of code below, borrowed from [http://faq.pygtk.org/index.py?req=show&amp;amp;file=faq23.041.htp PyGTK FAQ], will take care of this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# ctypes wrapper for pygobject_new(), based on code snippet from&lt;br /&gt;
# http://faq.pygtk.org/index.py?req=show&amp;amp;file=faq23.041.htp&lt;br /&gt;
class _PyGObject_Functions(ctypes.Structure):&lt;br /&gt;
    _fields_ = [&lt;br /&gt;
        (&#039;register_class&#039;,&lt;br /&gt;
            ctypes.PYFUNCTYPE(ctypes.c_void_p, ctypes.c_char_p,&lt;br /&gt;
            ctypes.c_int, ctypes.py_object, ctypes.py_object)),&lt;br /&gt;
        (&#039;register_wrapper&#039;,&lt;br /&gt;
            ctypes.PYFUNCTYPE(ctypes.c_void_p, ctypes.py_object)),&lt;br /&gt;
        (&#039;register_sinkfunc&#039;,&lt;br /&gt;
            ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),&lt;br /&gt;
        (&#039;lookupclass&#039;,&lt;br /&gt;
            ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_int)),&lt;br /&gt;
        (&#039;newgobj&#039;,&lt;br /&gt;
            ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
class PyGObjectCPAI(object):&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        import gobject&lt;br /&gt;
        py_obj = ctypes.py_object(gobject._PyGObject_API)&lt;br /&gt;
        addr = ctypes.pythonapi.PyCObject_AsVoidPtr(py_obj)&lt;br /&gt;
        self._api = _PyGObject_Functions.from_address(addr)&lt;br /&gt;
&lt;br /&gt;
    def pygobject_new(self, addr):&lt;br /&gt;
        return self._api.newgobj(addr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Adding this to your code, you will be able to create Python objects from an arbitrary GObject pointer, simply using something like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
capi = PyGObjectCPAI()&lt;br /&gt;
c_obj = c_function_returning_gobject(...)&lt;br /&gt;
obj = capi.pygobject_new(c_obj)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== Creating a OssoABookContactChooser Instance ==&lt;br /&gt;
&lt;br /&gt;
As an example of a GObject instantiation, let&#039;s call the &amp;lt;code&amp;gt;osso_abook_contact_chooser_new()&amp;lt;/code&amp;gt; constructor from Python, which creates a &amp;quot;contact chooser&amp;quot; dialog useful to select one of more contacts:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
capi = PyGObjectCPAI()&lt;br /&gt;
c_chooser = osso_abook.osso_abook_contact_chooser_new(None, &amp;quot;Choose a contact&amp;quot;)&lt;br /&gt;
chooser = capi.pygobject_new(c_chooser)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
After this, you can use &amp;lt;code&amp;gt;chooser&amp;lt;/code&amp;gt; like any other GObject in Python, including calling inherited methods:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
chooser.run()&lt;br /&gt;
chooser.hide()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== Accessing Items in a GList ==&lt;br /&gt;
&lt;br /&gt;
Once the &amp;quot;contact chooser&amp;quot; dialog has run, you can get the selected contacts using:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
contacts = osso_abook.osso_abook_contact_chooser_get_selection(c_chooser)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that you must pass the &#039;&#039;&#039;C Pointer&#039;&#039;&#039; to [http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/OssoABookContactChooser.html#osso-abook-contact-chooser-get-selection osso_abook_contact_chooser_get_selection()], not the Python object.&lt;br /&gt;
&lt;br /&gt;
the &amp;lt;code&amp;gt;contacts&amp;lt;/code&amp;gt; variable now holds a &amp;lt;code&amp;gt;GList&amp;lt;/code&amp;gt; pointer. In order to access the items stored on this list, you need some Python code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
glib = ctypes.CDLL(&#039;libglib-2.0.so.0&#039;)&lt;br /&gt;
def glist(addr):&lt;br /&gt;
    class _GList(ctypes.Structure):&lt;br /&gt;
        _fields_ = [(&#039;data&#039;, ctypes.c_void_p),&lt;br /&gt;
                    (&#039;next&#039;, ctypes.c_void_p)]&lt;br /&gt;
    l = addr&lt;br /&gt;
    while l:&lt;br /&gt;
        l = _GList.from_address(l)&lt;br /&gt;
        yield l.data&lt;br /&gt;
        l = l.next&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This function uses the yield statement to construct a so called [http://docs.python.org/tutorial/classes.html#generators generator]. The actual GList manipulation is made using functions from libglib library. This generator makes it very easy to iterate over the items:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for i in glist(contacts):&lt;br /&gt;
    get_display_name = osso_abook.osso_abook_contact_get_display_name&lt;br /&gt;
    get_display_name.restype = ctypes.c_char_p&lt;br /&gt;
    print &amp;quot;%s\n&amp;quot; % get_display_name(i)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here, we use [http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/OssoABookContact.html#osso-abook-contact-get-display-name osso_abook_contact_get_display_name()] to get the contact&#039;s display name, but you can call virtually any function using the same approach.&lt;br /&gt;
&lt;br /&gt;
Once you are done with the &amp;lt;code&amp;gt;GList&amp;lt;/code&amp;gt; manipulation, you should free its memory:&lt;br /&gt;
&lt;br /&gt;
With some functions (NOT this one, see docs), you should also unref the list items first:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for i in glist(stuffs):&lt;br /&gt;
   gobject.g_object_unref(i)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then free the list itself:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
glib.g_list_free(contacts)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Words ==&lt;br /&gt;
&lt;br /&gt;
This document purpose is to give a basic understanding necessary to use ctypes to explore C libraries, specially ones that manipulate GObject. Notably, we do not describe how to define callbacks, but this is left as an exercise for the reader. Again, be sure to read the [http://docs.python.org/library/ctypes.html#callback-functions ctypes documentation] if you are interested in more advanced techniques.&lt;br /&gt;
&lt;br /&gt;
See also more usage examples [[/More examples|here]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>213.150.1.132</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=USB_GPRS&amp;diff=41313</id>
		<title>USB GPRS</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=USB_GPRS&amp;diff=41313"/>
		<updated>2010-06-11T16:51:26Z</updated>

		<summary type="html">&lt;p&gt;213.150.1.132: /* Option HSDPA Modem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide covers using external USB 3G HSDPA GPRS modems with Maemo Diablo.&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
* Enable [[USB host mode]].&lt;br /&gt;
* Get a powered USB hub.&lt;br /&gt;
* Connect the hub to your tablet.&lt;br /&gt;
* Connect your modem to the USB hub.&lt;br /&gt;
* Get the SCSI kernel module from [http://fanoush.wz.cz/maemo/modules-diablo-2.6.21-200842maemo1.tar.gz Fanoush&#039;s kernel modules] (the /drivers/scsi/sg.ko file in the archive).&lt;br /&gt;
* Load the SCSI generic Linux kernel module. As root:&lt;br /&gt;
&lt;br /&gt;
 insmod sg.ko&lt;br /&gt;
&lt;br /&gt;
== Option HSDPA Modem ==&lt;br /&gt;
&lt;br /&gt;
* Compile the &amp;quot;HSO&amp;quot; Option Modem kernel module (Greg Kroah-Hartman is in the process of integrating the kernel module into the mainline kernel, but check [http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/t,445/ HSO] in the meantime or use this [http://www.scratchpost.org/software/Nokia_N8x0/Modem/ working directory] which includes compiled modules).&lt;br /&gt;
* Compile the [http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/t,425/ Rezero] Option mode switch application.&lt;br /&gt;
* Run the Option mode switch application.&lt;br /&gt;
&lt;br /&gt;
 ./rezero /dev/sg0&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Load the &amp;quot;HSO&amp;quot; kernel module.&lt;br /&gt;
&lt;br /&gt;
 insmod hso.ko&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;connect.sh&amp;lt;/code&amp;gt; script (from HSO) to actually &#039;&#039;do&#039;&#039; the changes in the routing table.&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;connect.sh&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
 ./connect.sh up&lt;br /&gt;
&lt;br /&gt;
* or use debian packages there: [[http://scratchpost.dreamhosters.com/software/Nokia_N8x0/Modem/DEB/]].&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* Use the udev script to automate the loading when the device is plugged (both for &amp;quot;rezero&amp;quot; and for &amp;quot;HSO&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Users]]&lt;br /&gt;
[[Category:Connectivity]]&lt;br /&gt;
[[Category:Cellular]]&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Power users]]&lt;/div&gt;</summary>
		<author><name>213.150.1.132</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=USB_GPRS&amp;diff=41314</id>
		<title>USB GPRS</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=USB_GPRS&amp;diff=41314"/>
		<updated>2010-06-11T16:51:09Z</updated>

		<summary type="html">&lt;p&gt;213.150.1.132: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide covers using external USB 3G HSDPA GPRS modems with Maemo Diablo.&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
* Enable [[USB host mode]].&lt;br /&gt;
* Get a powered USB hub.&lt;br /&gt;
* Connect the hub to your tablet.&lt;br /&gt;
* Connect your modem to the USB hub.&lt;br /&gt;
* Get the SCSI kernel module from [http://fanoush.wz.cz/maemo/modules-diablo-2.6.21-200842maemo1.tar.gz Fanoush&#039;s kernel modules] (the /drivers/scsi/sg.ko file in the archive).&lt;br /&gt;
* Load the SCSI generic Linux kernel module. As root:&lt;br /&gt;
&lt;br /&gt;
 insmod sg.ko&lt;br /&gt;
&lt;br /&gt;
== Option HSDPA Modem ==&lt;br /&gt;
&lt;br /&gt;
* Compile the &amp;quot;HSO&amp;quot; Option Modem kernel module (Greg Kroah-Hartman is in the process of integrating the kernel module into the mainline kernel, but check [http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/t,445/ HSO] in the meantime or use this [http://www.scratchpost.org/software/Nokia_N8x0/Modem/ working directory] which includes compiled modules).&lt;br /&gt;
* Compile the [http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/t,425/ Rezero] Option mode switch application.&lt;br /&gt;
* Run the Option mode switch application.&lt;br /&gt;
&lt;br /&gt;
 ./rezero /dev/sg0&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Load the &amp;quot;HSO&amp;quot; kernel module.&lt;br /&gt;
&lt;br /&gt;
 insmod hso.ko&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;connect.sh&amp;lt;/code&amp;gt; script (from HSO) to actually &#039;&#039;do&#039;&#039; the changes in the routing table.&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;connect.sh&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
 ./connect.sh up&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
* or use debian packages there: [[http://scratchpost.dreamhosters.com/software/Nokia_N8x0/Modem/DEB/]].&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* Use the udev script to automate the loading when the device is plugged (both for &amp;quot;rezero&amp;quot; and for &amp;quot;HSO&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Users]]&lt;br /&gt;
[[Category:Connectivity]]&lt;br /&gt;
[[Category:Cellular]]&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Power users]]&lt;/div&gt;</summary>
		<author><name>213.150.1.132</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=USB_GPRS&amp;diff=41315</id>
		<title>USB GPRS</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=USB_GPRS&amp;diff=41315"/>
		<updated>2010-01-13T14:43:40Z</updated>

		<summary type="html">&lt;p&gt;213.150.1.132: /* Option HSDPA Modem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide covers using external USB 3G HSDPA GPRS modems with Maemo Diablo.&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
* Enable [[USB host mode]].&lt;br /&gt;
* Get a powered USB hub.&lt;br /&gt;
* Connect the hub to your tablet.&lt;br /&gt;
* Connect your modem to the USB hub.&lt;br /&gt;
* Get the SCSI kernel module from [http://fanoush.wz.cz/maemo/modules-diablo-2.6.21-200842maemo1.tar.gz Fanoush&#039;s kernel modules] (the /drivers/scsi/sg.ko file in the archive).&lt;br /&gt;
* Load the SCSI generic Linux kernel module. As root:&lt;br /&gt;
&lt;br /&gt;
 insmod sg.ko&lt;br /&gt;
&lt;br /&gt;
== Option HSDPA Modem ==&lt;br /&gt;
&lt;br /&gt;
* Compile the &amp;quot;HSO&amp;quot; Option Modem kernel module (Greg Kroah-Hartman is in the process of integrating the kernel module into the mainline kernel, but check [http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/t,445/ HSO] in the meantime or use this [http://www.scratchpost.org/software/Nokia_N8x0/Modem/ working directory] which includes compiled modules).&lt;br /&gt;
* Compile the [http://www.pharscape.org/component/option,com_forum/Itemid,68/page,viewtopic/t,425/ Rezero] Option mode switch application.&lt;br /&gt;
* Run the Option mode switch application.&lt;br /&gt;
&lt;br /&gt;
 ./rezero /dev/sg0&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Load the &amp;quot;HSO&amp;quot; kernel module.&lt;br /&gt;
&lt;br /&gt;
 insmod hso.ko&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;connect.sh&amp;lt;/code&amp;gt; script (from HSO) to actually &#039;&#039;do&#039;&#039; the changes in the routing table.&lt;br /&gt;
* Run the &amp;lt;code&amp;gt;connect.sh&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
 ./connect.sh up&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* Create a ready-to-use Debian package.&lt;br /&gt;
* Use the udev script to automate the loading when the device is plugged (both for &amp;quot;rezero&amp;quot; and for &amp;quot;HSO&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Users]]&lt;br /&gt;
[[Category:Connectivity]]&lt;br /&gt;
[[Category:Cellular]]&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Power users]]&lt;/div&gt;</summary>
		<author><name>213.150.1.132</name></author>
	</entry>
</feed>