Akankshu,

The tx_power data field is part of the packet's metadata. This means that it's not transmitted when a packet is sent. Therefore, the tx_power for a received packet will always be the default value because it is only used for outgoing packets.

-Paul

Akankshu Dhawan wrote:
Hi All
I am trying to set the transmission power and then get the received message's TxPower on the MICAZ.
I am setting the power as follows:
====================================
call CC2420Packet.setPower(&sendBuf,11);
memcpy(call AMSend.getPayload(&sendBuf, sizeof(local)), &local, sizeof local); if (call AMSend.send(AM_BROADCAST_ADDR, &sendBuf, sizeof local) == SUCCESS)
     sendBusy = TRUE;
============================
and then inside Receive.receive(message_t* msg, void* payload, uint8_t len)
{
...
txPow=call CC2420Packet.getPower(msg);
 printf("The received packet's Tx power is : %d\n",txPow);
...
}
==========================
My wirings in the configuration file is :
components CC2420PacketC;
SafeC.CC2420Packet -> CC2420PacketC;

and inside the module file is :
uses {
...
interface CC2420Packet;
}
========================================================================


but on this display I keep getting the value of txPow as 0 . Can some one please guide me as to what I might be doing wrong here.

Thanks a lot.

Akankshu

--
First they ignore you, then they laugh at you, then they fight you, then you win.
- Mahatma Gandhi
------------------------------------------------------------------------

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

Reply via email to