Hi,

I am a little bit confused at the moment. I have this components:

components new AMSenderC( AM_DISCOVERY_MSG) as AMSender_disc;
components new AMReceiverC( AM_DISCOVERY_MSG ) as AMReceiver_disc;
components new AMSenderC( AM_REPORT_MSG ) as AMSender_report;
components new AMSenderC( AM_LOC_MSG ) as AMSender_localization;

The AM_IDS are defined in the header file as follows:

enum
{       AM_DISCOVERY_MSG = 5,
        AM_REPORT_MSG = 6,
        AM_LOC_MSG = 7,
};

Then I wired my components to the application.

App.Packet_discovery -> AMSender_disc;
App.AMSend_disocvery -> AMSender_disc;
App.Receive_discovery -> AMReceiver_disc;
App.AMPacket_discovery -> AMReceiver_disc;

App.Packet_report -> AMSender_report;
App.AMSend_report -> AMSender_report;

App.Packet_localization -> AMSender_localization;
App.AMSend_localization -> AMSender_localization;

In my application I have 3 timers. As soon as the localization timer fires, I
want to send a localization packet.

Therefore I do this:

event void localization_timer.fired()
{
        if( !is_radio_busy )
        {
                loc_msg* l_msg = (loc_msg*)( call 
Packet_localization.getPayload( &pkt,
(uint16_t)NULL) );

                if( call AMSend_localization.send( AM_BROADCAST_ADDR, &pkt, 
sizeof(loc_msg))
== SUCCESS )
                {
                        is_radio_busy = TRUE;
                }
        }
}

So, I call the AMSend_localization interface. This should be done with the AM_ID
= 7. But somehow, all messages are sent with the ID = 6.

Did i get anything wrong?

I would appreciate any help :-)

Thanks,
Martin

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to