|
For demonstrating the benefits of the
graphical approach let us study a very simple TinyOS application, one with a
single user-defined component and three system components. Note that the real
advantages of the visual environment can be recognized more easily with complex
applications.
Our sample application, called BLINK, is
part of the TinyOS release. It does not provide tremendous functionality: it
blinks one of the LEDs at a given frequency. The configuration of the BLINK
application (shown below) specifies the included components and the wiring (->) between the
interfaces.

The Main component is contained in every
application and its sole role is to initialize and start the application. We
have wired these startup functions to our Blink component. Since our component
requires access to the LedsC, we have made the appropriate links the
LedsC system
component. After initializing the SingleTimer component it will generate events
periodically. These events are routed to the BlinkM component where the event
handling routine will toggle the LED.
The interface of our Blink component can be
easily defined now. From the wiring we know what kind of commands and events
must be handled in our component and what other commands will be used by it.

The graphical equivalent of the previous
configuration files is shown in the figure below. It contains two module references
and two configuration references.
The visual representation of the wiring is undeniably easier to comprehend.
Another advantage of this graphical representation is the easy navigation
through the component hierarchy. To double-click on a component's box GME opens
it.


Back to GratisII technical overview. |