Hi, I wrote a program in which a node braodcasts a message to two other nodes, when the others receive it, they broadcast another message. My problem is that the node 2 doesn't receive node 1's message even if senddone is signaled by node 1. I need help please
http://old.nabble.com/file/p27720633/RBS.tar RBS.tar event void AMSend.sendDone(message_t* bufPtr, error_t error) { if(error != SUCCESS) dbg("Base","send done !success\n"); if (TOS_NODE_ID == 0) { if (&pkt == bufPtr) { busy = FALSE; // dbg("Base","send Done %s .\n",sim_time_string()); } } else {if (&pkt == bufPtr) { busy=FALSE; dbg("Base","send Done by node %u.\n",TOS_NODE_ID);}} } task void DiffuseTime(){ RbsMsg* data = (RbsMsg*) call Packet.getPayload(&pkt,sizeof(RbsMsg)); data->count = (uint32_t) time; data->id = (uint32_t)TOS_NODE_ID; if(!busy) if( call AMSend.send(AM_BROADCAST_ADDR,&pkt,sizeof(RbsMsg)) == SUCCESS) { dbg("Base","Packet sent %u. id= %u\n",data->count,data->id); busy=TRUE; }else dbg("Receive","failure Packet %u. id= %u\n",data->count,data->id); } event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len){ time = (uint32_t) call LocalTime.get(); if (len == sizeof(RbsMsg)) { if (TOS_NODE_ID != 0) { RbsMsg* data = (RbsMsg*)payload; dbg("Receive","Packet received %u. from node %u \n",data->count,data->id); if(data->id == 0) { post DiffuseTime(); } else {//calculer l'horloge } } } return msg; } -- View this message in context: http://old.nabble.com/Senddone-signaled-but-not-receive.receive-tp27720633p27720633.html Sent from the TinyOS - Help mailing list archive at Nabble.com. _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
