0

I am using Telosb motes, with the help of tutorials, I could able to log the data into flash memory of the mote. But I dont know how to retrieve the logged data from flash memory. Is there any kind of command which has to be given at the linux terminal to do this function. please guide me.

My program is to log the counter value when timer is fired.

module LogC {
  uses {
    interface Boot;
    interface Leds;
    interface Timer<TMilli>;
    interface LogWrite;
  }
}

implementation {
   uint8_t counter=0;

   typedef nx_struct logentry_t {
     nx_uint8_t value;
   } logentry_t;

   logentry_t m_entry;

  event void Boot.booted() {
    call Timer.startPeriodic(200);
  }

  event void Timer.fired() {
    counter++;      
    m_entry.value = counter;
       if( call LogWrite.append(&m_entry, sizeof(logentry_t))==SUCCESS){;
          call Leds.led1Toggle();
       }
  }

  event void LogWrite.appendDone(void* buf, storage_len_t len, 
                                 bool recordsLost, error_t err) {
     call Leds.led0Toggle();
  }

  event void LogWrite.syncDone(error_t err) { }

  event void LogWrite.eraseDone(error_t err) { }

}
4

1 回答 1

0

您需要编写一个应用程序,该应用程序使用该LogRead接口从闪存中检索记录的数据,例如,使用串行连接将其发送到 PC(这还需要 PC 端的 Java 应用程序)。

查看这里http://www.tinyos.net/tinyos-2.x/doc/html/tep103.html了解更多关于日志接口的信息,这里http://tinyos.stanford.edu/tinyos-wiki/index.php /Mote-PC_serial_communication_and_SerialForwarder用于关于 mote 和 PC 之间的串行通信的教程。

于 2014-06-05T17:30:35.987 回答