On Sep 11, 2007, at 11:48 PM, [EMAIL PROTECTED] wrote:

event message_t* AMProtoReceive.receive(message_t* msg, void* payload,
uint8_t len) {
     Protocol_Msg *btrpkt = (Protocol_Msg*)(call
AMProtoPacket.getPayload(msg, NULL));

     atomic {
       P_payload.protocol_id = btrpkt->protocol_id;
       P_payload.parameter_1 = btrpkt->parameter_1;
       P_payload.parameter_2 = btrpkt->parameter_2;
     }

     post protocol_msg_handler();

     return SUCCESS;
    }

The problem is that after the first hello msg is sent the node "stucks"
and I don't understand why. Can anybody help me?


SUCCESS is not a pointer to a message_t. You're passing a NULL pointer, and so the next packet that's received blows away control registers. Your compilation has a warning that says you're casting improperly.

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

Reply via email to