Sorry, I think in the command if (cmd->args.rl_args=TOS_LOCAL_ADDRESS)
it must be if (cmd->args.rl_args==TOS_LOCAL_ADDRESS).
However, when I change this, the Cygwin display "invalid operands to binary ==". How can I solve this problem? Thanks alot.
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;
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;
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!
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
