[Tinyos-help] error while incorporating interface CC2420Packet;
Philip Levis
pal at cs.stanford.edu
Mon Dec 3 09:42:50 PST 2007
On Dec 2, 2007, at 3:47 PM, Vijayant Bhatnagar wrote:
> Hi Kevin,
> I would like to thank you for your reply. We are indeed using
> TOSSIM. Right now I am trying to get the latest source code from
> CVS and then try to run my code.
>
> Do you think that we will not be able to change TX_POWER even after
> getting the latest source code ? Any help by others is
> appreciated ! Actually, changing TX_POWER is very important for our
> research. If this thing doesn't work, it will be very difficult for
> us to prove our algorithm. So, we have to get this working at any
> cost!
>
> Any help appreciated in this regards.
>
TOSSIM currently doesn't supporting changing TX power, but its
implementation is such that adding such support would not be too
hard. The call you care about is in TossimPacketModelC.nc:
call GainRadioModel.putOnAirTo(destNode, sending, metadata->ack,
evt->time,
0.0, 0.0);
The signature is this:
command void putOnAirTo(int dest,
message_t* msg,
bool ack,
sim_time_t endTime,
double gain,
double reverseGain);
Basically, the final two parameters, both of which are 0.0, are there
to incorporate TX power control. It assumes 0.0 is the max power. If
you want the node to transmit at a lower power, then you change the
first parameter. The second parameter is the receiver's transmit
power, which matters for acknowledgement transmissions.
So if you put a metadatafield in the message_t that held the transmit
power level and could be set by an interface, then pulled that out
just before this call in order to change the gain, that would work.
I'd add some noise or non-linearity in there because TX power control
is rarely a simple and crisp curve. But you can refer to chip data
sheets to see what their curves look like.
Phil
More information about the Tinyos-help
mailing list