[Tinyos-help] Reciving and Sending messages via TOSBase_TinyOS-1.x_micaz

antonio gonga ask25019fe at hotmail.com
Wed Aug 1 04:07:16 PDT 2007


Hey MS,I'm using Micaz and I changed TOSBase to work with Micaz->           //CC1000RadioIntM as RMac,    /* mica2 */             CC2420RadioM as RMac,    /* micaz */It's really  a bit strange, I'm correctly receiving messages from Motes in the Java Application, but whenever I send messages to the motes I have problems.all
expected behavior is ok. The red led is toggling it means that the
messages are being forwarded by the TOSBase... but the typecast to
querMsg it's not working.my query Structure is:typedef struct queryMsg{    uint16_t msgType;  //     uint16_t destID;    uint16_t upperth;    uint16_t  lowerth;}I send this values in a Java Application(I used MIG to generates the queryMsg.java file.):queryMsg query = new queryMsg();     query.set_destID(11);     query.set_msgType(03);     query.set_upperth(123);     query.set_lowerth(120);I use  MoteIF.send to send the messagestry{        mote.send(MoteIF.TOS_BCAST_ADDR, query);   }catch(Exception ex){ ex.printStackTrace(); }and in the TOSBase I do  this:event TOS_MsgPtr UARTTokenReceive.receive(TOS_MsgPtr Msg, uint8_t Token) {    TOS_MsgPtr  pBuf;    queryMsg *p;        p =(queryMsg*)Msg->data;    if(p->msgType == 3)        call Leds.yellowToggle();  // as I set msgType= 3I expect the yellow led to toggle... but it's not working. //rest of the code suppressed..} // end of UARTTokenReceive.receiveI printed the messages inside of the Sender.send method and what is being printed is like this:sent: 8 0 0 0 0 0 -1 -1 10 125 3 0 11 0 123 0 120 0  and decoding it is:8 0 0 0 0 0 -1 -1 TOS_BCAST_ADDR10 -> AMType125 -> TOS_AM_GROUP3 0 ->msgType11 0 ->destID123 0 ->upperth120 0 ->lowerth.I
don't understand what is wrong... maybe what is missing is the length
of the message but I also printed it ans it's equal to 18please help me...thanks in advance-antonio gonga
_________________________________________________________________
See what you’re getting into…before you go there.
http://newlivehotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070801/7073ccce/attachment.htm


More information about the Tinyos-help mailing list