package net.tinyos.ranging.*

README:

The tools in this directory allow you to interact with motes running the code found in: "tinyos1.x/lib/Ranging"

Two test applications that use this code are found in:
"tinyos1.x/apps/TestTofRanging"
"tinyos1.x/apps/TestUltrasound"

To create the tools in this java package, type make twice (2X).  The makefile uses MIG to generate message classes that interact with the code in tinyos1.x/lib/Ranging.  MIG (message interface generator) actually goes into the NesC code found in those directories to figure out the structure of the packets they are generating/expecting and then generates Java message objects with a matching structure.  

There are many ways to use the message objects created by MIG.  One such way is found in the tinyos1.x/doc/tutorial/matlab.html tutorial.

To use the ranging message objects from Matlab:
1) open matlab
2) change to your /tinyos1.x/tools/matlab/contrib/kamin/raning/ directory
3) run 'defineRangingEnvironment' to setup matlab to use these tools
4) do 'mIF(1).send(moteID, TofChirpCommandMsg)' where moteID is the ID of the mote you are commanding to chirp
5) you should see both chirp messages and rangingData messages appear on your screen
6) you can edit the distanceDataMessageReceived function to do something with the distance messages as they arrive.