Hi all!
I am doing a simulation in TinyOS tutorial, Lesson 7 (Injecting and Broadcasting packets). I have 3 motes, in that one mote programmed as TOSBase. Two motes programmed with Bcast, in which one mote as Relay node  (receive packet and forward, mote address 1), one mote as destination (mote address 2).
I modify the BcastInject, from cygwin command I want to tell mote 2 to do something. (mote address is received from command as argument and put  in the SimpleCmdMsg struct):
 
typedef struct SimpleCmdMsg {
    int8_t seqno;
    int8_t action;
    uint16_t source;
    uint8_t hop_count;
    union {
      start_sense_args ss_args;
      read_log_args rl_args;// I put mote address here
      uint8_t untyped_args[0];
    } args;
} SimpleCmdMsg;
 
 
(For example If I want to tell Mote 2 Led_on, from cigwin I type .................led_on 2)
 
Packet will be transmitted from TOSBase -> Relay Node (Mote 1) (it receive packet, check mote address, and know that packet does not belong to it, it forward packet ) -> Destination (Mote 2).
 
with simple applications such as led_on, sound_on, my simulation work well.
 
Now, I want to tell mote 2 to do some other works, such as it take light samples from sensing board and transmit these values back to TOSBase (mote 2 -> mote 1 -> TosBase). Of course I will have to modify BcastInject and Bcast. However, I do not know how to put these values in the SimpleCmd struct to transmit.
 
typedef struct SimpleCmdMsg {
    int8_t seqno;
    int8_t action;
    uint16_t source;
    uint8_t hop_count;
    union {
      start_sense_args ss_args;
      read_log_args rl_args;
      uint8_t untyped_args[0];
    } args;
} SimpleCmdMsg;
How can I put the sample values in to the SimpleCmd struct?
Because I learnt that  BcatsInject, Bcast all use SimpleCmd struct to transmit and receive packet. Do I need to use other struct in my simulation? (in both directions, from TOSBase to Destination and from Destination to TOSBase).
In that case, can I still use BcastInject?
 
can you give me some suggestion to overcome this trouble? Many thanks!
 
Regards!
 
 
 
 
 
 
 
 
 
 
 


Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to