Hello all,

I am new to Tiny OS and I am waiting for the motes to learn further and test 
the program, 

I have read the concept of mote to mote radio communication and my doubt is in 
the usage of message_t;


implementation {
..
message_t pkt; // this is used to hold data for transmission 
message_t store  ////  Fix me here please!!  if i need to store receiving 
information, can i store in the address message_t type variable 
}

event void Timer0.fired() {
    BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)(call Packet.getPayload(&pkt, 
sizeof (BlinkToRadioMsg)));
   // logics are added
   if (call AMSend.send(AM_BROADCAST_ADDR, &pkt, sizeof(BlinkToRadioMsg)) == 
SUCCESS) {
   }
}
 event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) {
     if (len == sizeof(BlinkToRadioMsg)) {
    BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
    call Leds.set(btrpkt->counter);
    ///// here I am going to store the required information which is being 
received, i have created Cache_t header and I am   
   /////   storing    the   information.

  Cache_t* cpkt = (Cache_t*)(call Packet.getPayload(&store, sizeof (Cache_t)));
  cpkt->neighbor_id=btrpkt->node_id;
}
return msg;
}

is this right way to store the receiving information in new structure ??
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to