-
Notifications
You must be signed in to change notification settings - Fork 1
Config::Examples
The choices and functionality for the xml configuration file of ouroboros is quite large, so we split the examples in to two sections. The first section shows the full demonstration of the functionality in an xml file with arbitrary names. The second example uses screenshots of a dashboard for an Apple Airport Base Station and how that translates to our xml file. Later we will change out the example with screenshots of our own dashboard generated from the xml.
<?xml version="1.0" encoding="UTF-8"?>
<deviceConfig>
<libraries>
<file>myfile.h</file>
</libraries>
<group name="lights!">
<field>
<title>Red LED</title>
<!-- <name>redLed</name> <- this will be optional in a moment -->
<type>
<integer>
<minInclusive>0</minInclusive>
<value>0</value>
</integer>
</type>
<tagName>LEDS!</tagName>
<description>
Red LED light for indicating a failure or off state.
</description>
</field>
<field>
<title>Green LED</title>
<!-- <name>redLed</name> <- this will be optional in a moment -->
<type>
<integer>
<minInclusive>0</minInclusive>
<value>0</value>
</integer>
</type>
<tagName>LEDS!</tagName>
<description>
Green LED light for indicating a failure or off state.
</description>
</field>
<field>
<title>Green Light Switch</title>
<type>
<boolean>true</boolean>
</type>
<tagName>Switches</tagName>
<description>
This switch controls the green light that are on the device.
</description>
</field>
<field>
<title>Red Light Switch</title>
<type>
<boolean>true</boolean>
</type>
<tagName>Switches</tagName>
<description>
This switch controls the red light that are on the device.
</description>
</field>
</group>
<group name="misc stuff">
<field>
<title>LCD Screen Display</title>
<type>
<string>
<value>hello</value>
</string>
</type>
<description>
You can display whatever text you want on this screen so long as its just letters, numbers, and spaces.
</description>
</field>
</group>
</deviceConfig>
</xml>
We will go through each tab in the router step-by-step to layout what we have done to convert the functionality of that window into our xml for a real world example of how our xml covers all cases for a given device.
Each tab has been broken down into its respective group:
Screenshot
Code
<group name="Base Station">
<field>
<title>Base Station Name</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Base Station Password</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Verify Password</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Remember this password in my keychain</title>
<name>remember_password</name>
<type>
<boolean>true</boolean>
</type>
<description>
</description>
</field>
<field>
<title>Allow setup over WAN</title>
<type>
<boolean>false</boolean>
</type>
<description>
</description>
</field>
<field>
<title>Back to My Mac</title>
<type>
<enum>
<complex>
<string name="Apple ID"></string>
<boolean name="status"></boolean>
</complex>
</enum>
</type>
<description>
Using Back to My Mac you can access this AirPort base station for services suck as file sharing from your other computers that have Back to My Mac enabled. Click Add(+) and enter your Apple ID and password.
</description>
</field>
</group>
Screenshot
Code
<group name="Internet">
<field>
<title>Connect Using</title>
<type>
<enum>
<choice>DHCP</choice>
<choice>Static</choice>
<choice>PPPoE</choice>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>IPv4Address</title>
<type>
<string>
<constant>true</constant>
</stirng>
</type>
<description>
</description>
</field>
<field>
<title>Subnet Mask</title>
<type>
<string>
<constant>true</constant>
</stirng>
</type>
<description>
</description>
</field>
<field>
<title>Router Address</title>
<type>
<string>
<constant>true</constant>
</stirng>
</type>
<description>
</description>
</field>
<field>
<title>DNS Servers</title>
<type>
<enum>
<string>
<pattern>[0-9]{3}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}</pattern>
</stirng>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>IPv6 DNS Servers</title>
<type>
<enum>
<string>
<pattern>[0-9]{3}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}</pattern>
</string>
<enum>
</type>
<description>
</description>
</field>
<field>
<title>Domanin Name</title>
<type>
<string>
<pattern>[a-z0-9A-Z-\.]*\.[a-z]{2,}</pattern>
</stirng>
</type>
<description>
</description>
</field>
<field>
<title>IPv6 Address</title>
<type>
<string>
<constant>true</constant>
</stirng>
</type>
<description>
</description>
</field>
</group>
Screenshot
Code
<group name="Wireless">
<field>
<title>Connect Using</title>
<type>
<enum>
<choice>Create a wireless network</choice>
<choice>Extend a wireless network</choice>
<choice>off</choice>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>Wireless Network Name</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Wireless Security</title>
<type>
<enum>
<choice>None</choice>
<choice>WPA/WPA2 Personal</choice>
<choice>WPA2 Personal</choice>
<choice>WPA/WPA2 Enterprise</choice>
<choice>WPA2 Enterprise</choice>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>Wireless Password</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Verify Password</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Remember this password in my keychain</title>
<name>remember_password</name>
<type>
<boolean>true</boolean>
</type>
<description>
</description>
</field>
</group>
Screenshot
Code
<group name="Network">
<field>
<title>Router Mode</title>
<type>
<enum>
<choice>DHCP and NAT</choice>
<choice>DHCP Only</choice>
<choice>Off (Bridge Mode)</choice>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>DHCP Range</title>
<type>
<string>
<constant>true</constant>
</stirng>
</type>
<description>
</description>
</field>
<field>
<title>DHCP Reservations</title>
<type>
<enum>
<complex>
<string name="Description"></string>
<string name="IP Address"></string>
</complex>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>Port Settings</title>
<type>
<enum>
<complex>
<string name="Description"></string>
<string name="Type"></string>
</complex>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>Enable Access Control</title>
<type>
<boolean>false</boolean>
</type>
<description>
</description>
</field>
</group>
Screenshot
Code
<group name="Disks">
<field>
<title>Partitions</title>
<type>
<enum>
<string></string>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>Enable File Sharing</title>
<type>
<boolean>false</boolean>
</type>
<description>
</description>
</field>
<field>
<title>Share disks over WAN</title>
<type>
<boolean>false</boolean>
</type>
<description>
</description>
</field>
<field>
<title>Secure Shared Disks</title>
<type>
<enum>
<choice>With accounts</choice>
<choice default="true">With a disk password</choice>
<choice>With a device password</choice>
</enum>
</type>
<description>
</description>
</field>
<field>
<title>Disk Password</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Verify Password</title>
<type>
<string>
</string>
</type>
<description>
</description>
</field>
<field>
<title>Remember this password in my keychain</title>
<name>remember_password</name>
<type>
<boolean>true</boolean>
</type>
<description>
</description>
</field>
</group>