[高三政史地]kurtosis Gaussian
Introduction
This lesson shows you how to compile a TinyOS program and install it on a mote, introduces the basic concepts and syntax of the TinyOS component model, and shows you how to generate and navigate TinyOSs source code documentation.
Compiling and Installing
As a first exercise, youll compile and install a very simple TinyOS application called Blink. If you dont have mote hardware, you can compile it for TOSSIM, the TinyOS simulator.
You compile TinyOS applications with the program make. TinyOS uses a powerful and extensible make system that allows you to easily add new platforms and compilation options. The makefile system definitions are located in tinyos-2.x/support/make.
The first step is to check that your environment is set up correctly. Run the tos-check-env command:
$ tos-check-env
This script checks pretty much everything that the TinyOS environment needs. Most of the warnings should be somewhat self-explanatory, if you are at all accustomed to a UNIX environment. If you are having trouble with warnings, your best bet is to join and ask questions on the tinyos-help email list. Its almost always the case that if youve run into a problem, someone else has too. Searching the help archives can therefore be useful.
If your system says some command is not available, then chances are you need to install the TinyOS tools (tos-*) RPM. Please refer to your installation instructions. If you have installed the RPM, then look in /usr/bin and /usr/local/bin for tos-check-env. If you have downloaded from CVS rather than used RPMs, then you need to compile and build the tools. Go to tinyos-2.x/tools/tinyos and type:
$ configure
$ make
$ make install
On Linux systems, you will either need superuser abilities or access to sudo for the last command.
The second thing to check is that you have the TinyOS build system enabled. This involves the MAKERULES environment variable. In a shell, type:
printenv MAKERULES
You should see /opt/tinyos-2.x/support/make/Mak
原创力文档

文档评论(0)