[Tinyos-help] [TOSSIM]

vazoumana fofana zoumlander at hotmail.com
Mon Jun 25 08:02:54 PDT 2007


Hello bibudh and Mehdi,

i don't understand very well your expanation about how displaying values 
with debug.
indeed, i ve met the same problem than Mehedi Bakht.

You say that :
U need a debug mode, e.g.,
dbg(DBG_TEMP, "Counter: Value is %i\n", (int)state);
here the mode is 'temp'. To get the message in the console, u need to export
the debug mode with the following command before u run the program.
export DBG=temp
i add this line on the code but it doesn't work. it doesn t know DBG_TEMP.
Here is the code :

event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) 
{
  if (len == sizeof(BlinkToRadioMsg)) {
    BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
    dbg(DBG_TEMP,"BlinkToRadio","compteur : %s\n",btrpkt->counter);
    call Leds.set(btrpkt->counter);
  }
  return msg;

from TOSSIM import *
import sys

f = open("log.txt", "w")
t = Tossim([])


t.addChannel("BlinkC", sys.stdout);
t.addChannel("BlinkC", f);

for i in range(0,1):
	m = t.getNode(i).bootAtTime(0);

time = t.time()
while (time + 10000000000 > t.time()):
  t.runNextEvent()

_________________________________________________________________
Gagnez des écrans plats avec Live.com http://www.image-addict.fr/



More information about the Tinyos-help mailing list