Add access to LQI and RSSI to Contiki motes

This commit is contained in:
Yvonne-Anne Pignolet 2012-12-11 12:09:33 +01:00 committed by Moritz 'Morty' Strübe
parent 7b59e1dbe7
commit 83ae37b48e
3 changed files with 35 additions and 0 deletions

View file

@ -250,6 +250,24 @@ public class ContikiRadio extends Radio implements ContikiMoteInterface, PolledA
myMoteMemory.setIntValueOf("simSignalStrength", (int) signalStrength);
}
/** Set LQI to a value between 0 and 255.
*
* @see se.sics.cooja.interfaces.Radio#setLQI(int)
*/
public void setLQI(int lqi){
if(lqi<0) {
lqi=0;
}
else if(lqi>0xff) {
lqi=0xff;
}
myMoteMemory.setIntValueOf("simLQI", lqi);
}
public int getLQI(){
return myMoteMemory.getIntValueOf("simLQI");
}
public Position getPosition() {
return mote.getInterfaces().getPosition();
}