Hi again.
Here is what I have done so far. I really hope somone can help me fix the
problem. I gave up on having human friendly commands. At the moment I just want
to turn on Led0 of Telosb with command '0x1' and turn it of with command '0x2'.
Here is the struct I made in tinyOS:
typedef nx_struct pc_serial_msg
{
nx_uint8_t sequenceNumber;
nx_uint16_t controlCommand;
}pc_serial_msg;
And I modified TestSerial app and somewhere in the app I have:
event message_t * ReceiveSerial.receive(message_t *msg, void *payload, uint8_t
len){
if(len != sizeof(nx_struct pc_serial_msg))
return msg;
else
{
pc_serial_msg* serMsg = (nx_struct pc_serial_msg*) payload;
switch(serMsg->controlCommand)
{
case 0x1:
call Leds.led0On();
break;
case 0x2:
call Leds.led0Off();
break;
}
}
}
The TinyOS code compiles good. I am quite confident the TinyOS app is going to
work.
My only problem is how can I make a packet in C#...I know I have to make a
byte sequence but how does it shoud look like?!
Looking forward for your reply!
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help