Hi all!
I am a new to TinyOS. I am doing a simulation with one mote program with TOSBase. I use BcastIject to send radio packet. In BcastInject, I modify it with destination address is received from command. After that, I put this address in the read_log_arg variable of SimpleCmd. Here are some structes in SimpleCmd:
 
 
typedef struct {
    uint16_t destaddr;
} read_log_args;
// SimpleCmd message structure
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 destination address here)
      uint8_t untyped_args[0];
    } args;
} SimpleCmdMsg;
 
The packet is sent with broadcast address. I want to programming one node as the relay node. It receives radio packet, make comparision of its TOS_LOCAL_ADDRESS with destination address (encapsulated in SimpleCmd). If these addresses are equal, the node keep the packet, other it forward the packet.
 
In the program for the relay mote, I declare cmd as a SimpleCmd structure pointer that point to packet
struct SimpleCmdMsg * cmd = (struct SimpleCmdMsg *) msg->data;
 
and I make comparision with command
 
if (cmd->args.rl_args=TOS_LOCAL_ADDRESS)
 
I run the make mica2 to compile this program. However, the Cygwin display "Incompatible types in assignment" (cmd->args.rl_args=TOS_LOCAL_ADDRESS)
I can not figure it out what is wrong with this. Can you give me some advice?
Many thanks!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
I want to programming one mote as a relay node, it receive radio packet (SimpleCmd structure including destination address), and when receiving the packet, it make a coparision of destination address in the received packet with its address. If they are equal, the node keep the packet, if not it forward the packet to the destination. However, I do not know how a node can take itshelf address (MOTE address, presume I have set the MOTE address of 2). Can you give me some advice?
Many thanks!


Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to