1

I'm working on a project where I have increase or decrease the RF power based on rssi value. The sender mote sends data and the receiver measures the rssi value.

Based on that, I have to set the power of antenna. How can I achieve that?

Thank you

Illuminati0x5B
  • 602
  • 7
  • 24

1 Answers1

1

That's probably a little late answer, but this might help others, so here it is:

You can either change it in code by calling:
call CC2420Packet.SetRFPower(&packet, pwr);

or by changing it at compile time in Makefile by adding this line:
CFLAGS += "-DCC2420_DEF_RFPOWER=N"

where valid values for pwr in setRFPower and N in CFLAG are 1 through 31 with power of 1 equal to -25dBm and 31 equal to max power (0dBm).

the-lay
  • 1,461
  • 12
  • 22
  • 1
    Worth noting that this only applies to motes with CC2420 radio, and that the [CC2420 radio data sheet](http://www.ti.com/lit/ds/symlink/cc2420.pdf) indicates that only values 3 to 31 are valid, in eight steps (3, 7, 11, 15, 19, 23, 27 and 31) – James Allen Sep 04 '17 at 09:10