Hi All,

I'm trying to implement Akhila S Rao's code (8th Nov 2011) to get Rssi noise 
floor readings. However, after I managed to fix a few missing bits, I'm still 
struggling. When compiling I get the error "'Config.syncDone' not implemented". 
When I do call Config.sync (and Config.syncDone) in my code, I get many more 
errors though. Thanks for any help. Here is the code I'm working with:

NoiseAppC.nc:
#include "Timer.h"
#include "printf.h"

configuration NoiseAppC {
}

implementation {
    components MainC, NoiseC;
    components new TimerMilliC() as Timer;
    components SerialActiveMessageC;
    components CC2420ControlC;


    NoiseC -> MainC.Boot;
    NoiseC.Timer -> Timer;
    NoiseC.SplitControl -> SerialActiveMessageC;
    NoiseC.ReadRssi -> CC2420ControlC.ReadRssi;
    NoiseC.Config -> CC2420ControlC;
}


NoiseC.nc:
#include "Timer.h"
#include "printf.h"

module NoiseC {
    uses interface Boot;
    uses interface SplitControl as SplitControl;
    uses interface Timer<TMilli> as Timer;
    uses interface Read<uint16_t> as ReadRssi;
    uses interface CC2420Config as Config;
}

implementation {

  uint8_t count = 0;

  event void Boot.booted(){
    call SplitControl.start();
    call Timer.startPeriodic(500);
  }

  event void SplitControl.startDone(error_t err){
    if(err!=SUCCESS){
        call SplitControl.start();
    }
  }

  event void SplitControl.stopDone(error_t err){
  }

  event void Timer.fired(){
    if(call ReadRssi.read()==FAIL){
        call ReadRssi.read();
    }
  }

  event void ReadRssi.readDone(error_t result, uint16_t val){
    int8_t noise_val=(int8_t)(((val-0x7F)&0xFF)-45);
    count++;
    printf("%d\n",noise_val);
    printfflush();
  }
}


Makefile:
COMPONENT=NoiseAppC
CFLAGS += -I$(TOSDIR)/lib/printf

include $(MAKERULES)
This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, copy 
or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to