Hi

In the tutorial, Lesson 2, about parameterized interfaces, it says (among
other things):

-----
Here,

  unique("Timer")

generates a unique 8-bit number from a set corresponding to the string
"Timer". Therefore, Every component that uses unique("Timer") is
guaranteed to get a different 8-bit value as long as the string used in
the argument is the same. Note that if one component uses unique("Timer")
and another uses unique("MyTimer"), they might get the same 8-bit value.
Therefore it's good practice to use the name of the parameterized
interface as an argument to the unique() function. The compile-time
constant function

  uniqueCount("Timer")

will count the number of uses of unique("Timer").
-----

For the timer component, it is not only good practice, but _required_ to
use the string "Timer" as an identifier. TimerM.nc includes code like
this:

if (id>=uniqueCount("Timer")) return FAIL;

which clearly assumes that clients have been using the string "Timer" as
the identifier.

I suggest the tutorial should reflect this. Maybe good practice should
rather be that it is required to use the name of the interface as the
identifier?

Mads

-- 
+----------------------------------------------------------------------+
|  Mads Bondo Dydensborg.               http://www.distlab.dk/madsdyd/ |
|  +45 35 32 14 18                                                     |
+----------------------------------------------------------------------+
_______________________________________________
Tinyos-users mailing list
[EMAIL PROTECTED]
http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users

Reply via email to