Thank you so much.
However, in my case, if I add LogMsg into "args" union. I am not sure for 2 possibilities:
- Can I still use BcastInject since this program is written to support old SImpleCmd struct? For me, it is really complecated to make change to some java programes.
- Since "args" is union, I can only use one field at the moment. In my program, I want the packet have to the destination address (in the "read_log_args rl_args" field, in my program it is TOSBase mote address) and sample values (ex: photo values). So can I use union here?
I look forward to hearing from you!
Regards!
Tran Chi Hieu


Michael Schippling <[EMAIL PROTECTED]> wrote:
it looks like someone thought this would be a good idea and included
some intriguingly named objects in SimpleCmdMsg.h. Like "start_sense_args
ss_args" and "LogMsg". But I don't find them used anywhere.

You could probably add LogMsg to the "args" union and
create a new action type for returned sense data. Just make sure
the whole struct size is under 29 bytes as defined in types/AM.h.
Hopefully the rest of the code will ignore messages it doesn't understand.

MS


Hieu Tran wrote:
> 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


Get amazing travel prices for air and hotel in one click on Yahoo! FareChase
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to