department of computer engineering @ yeditepe university

The Network Laboratory
TinyXML

 

This page contains information about TinyOS implementation of a novel routing protocol used to disseminate query and construct topology across sensor nodes scattered around a terrain. This protocol tightly integrates with SeMA architecture for Mobile Ad Hoc Networks..

General Purpose Xml Parser For TinyOS (TinyXML)

Introduction

XML ( Extensible Markup Language) is a markup language used to carry data without tag limitations as found on the HTML.

If you don't know what XML is a free tutorial is available at http://www.w3schools.com/xml/xml_whatis.asp

Due to limitations of hardware resources parsifal library has been chosen as the source for porting to tinyos platform.Parsifal library is known to be a fast non-validating xml parser that implements a subset of SAX(Simple API for XML) API.

In order to speed up processing no tight checking of the xml data is made at sensor nodes.Sensor nodes own very slow CPUS ( 8 bit RISC based cpus from Atmel).So the library had to be fast enough to meet the cpu speed problem.

There are some features removed from parsifal library in order to decrease code size.These include:

  • Namespace support has been removed.(contains large matrices that waste lots of memory)
  • DTD(Document Type Definition) handler support has been removed.
  • No encoding any more

Note that TinyXML is not intended for complex XML data.

Download

TinyXML can be downloaded here

A windows application(elements from parsifal) that uses TinyXML.(similar to parsifal excludes DTD and NS) TinyXml_(parsifal)_vs6.zip
TinyXML test application. ( a test application that uses TinyXML library for TinyOS) TestXML.zip
TinyXML library for TinyOS xml.zip

Compile and Install Instructions

  1. TinyXML requires TOSDIR environment variable to be set in order to compile.

    Linux/Unix

    If you haven't already set the TOSDIR environment variable use

    export TOSDIR = directory to tos (/tinyos-1.x)

    for setting environment variable.

    If you want this environment varible to be permanent add this line to either ".bash_profile" in your home directory or "profile" file in /etc directory.

    Windows

    Cygwin is used to emulate linux internal calls from windows so that any application developed for unix environment can be run from windows after recompilation.

    TinyOS needs to be setup for windows using cygwin.Refer to tinyos home page and maillist archives for installing latest code for tinyos.

    TOSDIR environment for windows has to be set from "Environmental Settings" accessed from system menu.In order to maintain compatibility TOSDIR has to be specified in UNIX file path format.

    TOSDIR= /cygdrive/c/tinyos-1.x

  2. Download xml.zip and testXML.zip. Extract xml.zip to $(TOSDIR)/tos/lib directory where TOSDIR is the directory tinyos resides in. After having extracted the xml.zip parsifal libraries source files should reside in $(TOSDIR)/tos/xml directory. Make sure that you have extracted the zip file correctly.Extract TestXML.zip to $(TOSDIR)/apps/TestXML directory. This directory should contain two nc files and two makefiles.
  3. Depending on your environment make command is issued for different kind of architectures."make pc" is used to compile project for pc platform using nido simulation. "make mica" will compile for mica motes etc.Have a look at make params for other platforms.

Testing

Xml library provides a StdControl and a XmlParser interface for use with other applications.StdControl interface is used to initialize , start and stop the library. XmlParser interface is used to register the callback function that will be called after issuing the start command of StdControl. Stop command will release any memory obtained during parse operations.The sample application will parse

strcpy(strbuf,"<hello><1>test</1><2>test2</2></hello>");

and display the results using dbg command.

Here is the output from pc environment:

0: hello
0: 0: 1
0: test
0: 0: 2
0: test2

Have a look at TestXml project for details of xml library usage.

For questions regarding to the tinyos port of the library please contact oskaya@softhome.net