Significant Changes in TinyOS between v0.6 and 1.0b

Last updated 23 August 2002

This document outlines the major changes that have occured in TinyOS since the last release (0.6.1) and the current release (1.0 beta). These changes include the use of a new language, an improved networking stack, greatly increased documentation, and the inclusion of several large systems. There are many small changes (bug fixes, etc.), but the following describes these major changes which every user should be aware of.

nesC

TinyOS components used to be written in a highly decorated version of C, using preprocessor macros; TinyOS 1.0b uses a new C-like language, nesC (network-embedded-systems-C). The 1.0b release includes the nesC compiler (ncc) as well as a language reference and language transition help documents.

nesC has several advantages to older TinyOS code, such as interfaces, wire error detection, automatic document generation, and facilitation of significant code optimizations over previous TinyOS builds. One of its major goals is to make TinyOS code cleaner, easier to understand, and easier to write.

The TinyOS tutorials now provide an introduction to nesC and its syntactic constructions.

Networking Stack

The 40Kb mica networking stack has several added features. These include data-link level synchronous acknowledgements, variable length packets, and a rough estimate of network activity. An in-depth description of the workings of the stack is provided in the documentation directory /doc. The modified TOS_Msg structure is as follows:


typedef struct TOS_Msg {
  uint16_t addr;
  uint8_t type;
  uint8_t group;
  uint8_t length;
  int8_t data[TOSH_DATA_LENGTH];
  uint16_t crc;
  uint16_t strength;
  uint8_t ack;
  uint16_t time;
} TOS_Msg;

The message send interface has also changed to include a length parameter, which specifies how much data is in the data field.

The networking stack does not forward CRC values for packets. Instead, the crc field is set to 0 or 1 to denote whether the packet passed the check; the default networking stack discards all packets that fail CRC checks.

The ack field is only meaningful on packet sends. If the field is 1, then the mote received an explicit link-level acknowledgement from a receiver. In the case of broadcast messages, ack will be set to 1 if one or more motes received the message. These acknowledgements are synchronous and take roughly the same amount of time as transmitting one byte.

Documentation

ncc, the nesC compiler, can automatically generate documentation for TinyOS components. Typing make <platform> docs in an application directory will build HTML docs for each component and interface (as well as build the application). These documents are placed in doc/nesdoc and the top-level application document is symlinked in the application directory.

Systems

TinyOS 1.0b includes two large systems as examples of complex TinyOS applications. The first, Bombilla, is a bytecode interpreter for simple application programming. The second, TinyDB, is a tiny database engine for routing queries to and data from a network. Both have PC tools. Bombilla has tools for writing and injecting assembly-style programs, while TinyDB has tools for writing SQL-like queries and displaying the results. Documentation for both systems exists in the doc/ directory.