[Tinyos-help] Cannot send message correctly

Lorenzo Mainardi lorenzo.mainardi at gmail.com
Fri Dec 8 08:43:13 PST 2006


Hi, I'm trying to send and receive message in Tinyos-2.x. I have been
foolowed the chapter 3 of Tutorial and I write this code:

event void Timer.fired(){
dbg("beacon", "Timer fired\n");
if(busy)
    dbg("beacon", "BUSY!!!");
if(!busy){

    beaconPayloadPtr = (BeaconMsg*) (call Packet.getPayload(&beaconPacket,
NULL));
    beaconPayloadPtr -> msgCode=BEACON_CODE;
    beaconPayloadPtr -> seed = call Random.rand16();
    if (call BSend.send(AM_BROADCAST_ADDR, &beaconPacket, sizeof(BeaconMsg))
== SUCCESS) {
       // busy = TRUE;
        dbg("beacon", "Message sent");
    }

    }}



event void BSend.sendDone(message_t *msg, error_t error){
dbg("beacon", "send done\n");
if (&beaconPacket == msg) {
    busy = FALSE;

    }


}


If I try to debug my application, I send but I don't receive any signal from
the event sendDone.I think to have well linked all the modules and
interfaces
Could you help me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20061208/5e247e36/attachment.html


More information about the Tinyos-help mailing list