Warning: answer only relevant to TOS1.x...

I was going to say just look at the Message classes:
    net/tinyos/message/Message.java
    net/tinyos/oscope/OscopeMsg.java
and the doc for MIG (which generates OscopeMsg.java).

But when I did (because I just refused to use them from
the outset so I never did before) I found that there are
no builtin accessors for the message header. And what's
more the way to get to arbitrary fields is:

  protected long getUIntElement(int offset, int length)

So you can't use it from outside OscopeMsg. Somehow I have
come to expect this sort of thing but it still annoys me...


So your two options are A) extend OscopeMsg and add accessors
that call getUIntElement() using your own special knowledge of
the header structure gleaned from tos/types/AM.h; or, B) write
the whole thing yourself (assuming you are not just modifying
the oscope app...). For an example of the DIY option see my code:
    http://www.etantdonnes.com/Motes/robocode.tar.gz

MS

Heo Heo wrote:
I was wondering if there is a way to access the TOS_Msg fields (like addr, type, group, strength, etc.) from Java. The context is that there is a mote running OscilloscopeRF. This mote sends messages (class OscopeMsg) to the base station (connected to PC with Serial forwarder). For each message received at the PC, our Java program (running on the PC) needs to access some fields of the TOS_Msg header. Thanks a lot for any help. Everyone is raving about the all-new Yahoo! Mail beta. <http://us.rd.yahoo.com/evt=42297/*http://advision.webevents.yahoo.com/mailbeta>


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to