<?xml version="1.0" encoding="UTF-8" ?>

<node name="/org/openmoko/Diversity/Net" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
  <interface name="org.openmoko.Diversity.Net">

    <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="control_net"/>

    <!-- assuming there is one wireless device -->
    <property name="Interface" type="s" access="read">
      <tp:docstring>
        The interface (e.g., eth0) of the device.
      </tp:docstring>
    </property>

    <tp:enum name="DIVERSITY_NET_STATE" type="u">
      <tp:docstring>
      </tp:docstring>

      <tp:enumvalue suffix="UNKNOWN" value="0">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="DOWN" value="1">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="DISCONNECTED" value="2">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="PREPARE" value="3">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="CONFIG" value="4">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="NEED_AUTH" value="5">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="IP_CONFIG" value="6">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="ACTIVATED" value="7">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="FAILED" value="8">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="CANCELLED" value="9">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="VERIFIED" value="10">
        <tp:docstring>
        </tp:docstring>
      </tp:enumvalue>
    </tp:enum>

    <property name="State" type="u" access="read" tp:type="DIVERSITY_NET_STATE">
      <tp:docstring>
        The state of the device.
      </tp:docstring>
    </property>

    <property name="Ip4Address" type="i" access="read">
      <tp:docstring>
        The IPv4 address of the device.
      </tp:docstring>
    </property>

    <signal name="StateChanged">
      <tp:docstring>
        Indicate the state of the device is changed.
      </tp:docstring>

      <arg type="u" name="state" tp:type="DIVERSITY_NET_STATE">
        <tp:docstring>
          The new state of the device.
        </tp:docstring>
      </arg>
    </signal> 

    <method name="ConnectAp">
      <tp:docstring>
        Connect to the specified AP.
      </tp:docstring>

      <arg type="o" name="ap" direction="in">
        <tp:docstring>
          The object path of the AP.
        </tp:docstring>
      </arg>
    </method> 

    <method name="GetAp">
      <tp:docstring>
        Get the connected AP.
      </tp:docstring>

      <arg type="o" name="ap" direction="out">
        <tp:docstring>
          The object path of the AP.
        </tp:docstring>
      </arg>
    </method> 

    <method name="ConnectWired">
      <tp:docstring>
        UNUSED.
      </tp:docstring>
    </method> 

  </interface>
</node>
