Apps     Components     Interfaces     All Files     Source Tree     source: apps.TestEEPROM.EEPROM.TestEEPROMM.nc

Component: TestEEPROMM

This application serves as a test of off-chip EEPROM functionality. The application is meant to be used with net/tinyos/tools/TestEEPROM.java application; it provides interfaces for testing the reading and writing functions of the EEPROM. The mote running this code should turn on the red LED on initialization; from that point on the LEDs toggle. Green LED is toggled when the app receives the command to either read or write to EEPROM; red LED toggles when the app attempt to send a response, and yellow LED toggles when the app thinks that the response transmission was successful. Contents of the response can be displayed with GenericBase and ForwarderListen tools.
Author: tinyos-help@millennium.berkeley.edu

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

StdControl.init

command result_t StdControl.init (void)

Application initialization code. Initializes subcomponents: the eeprom driver and the communication stack.
Returns: always SUCCESS

SendResultMsg.sendDone

event result_t SendResultMsg.sendDone (TOS_MsgPtr data, result_t success)

When a message has been sent, the app marks the message buffer as available for further use. The buffer will be used in processing further directives from the network.
Returns: Always SUCCESS.

sendAnswer

void sendAnswer(uint8_t code)

Helper function used to produce the final response of the app to the command fron the network. The first byte of the message is the success code; the remainder is the response specic data. The return codes are as follows:

EEPROMRead.readDone

event result_t EEPROMRead.readDone (uint8_t *buf, result_t success)

This event is called when the eeprom read command succeeds; it sends a message indicating the success or failure of the operation. If read succeeded the data read will be located in the response buffer, starting at the 3rd byte.
Returns: Always SUCCESS

EEPROMWrite.writeDone

event result_t EEPROMWrite.writeDone (uint8_t *buf)

This event is invoked when EEPROM finishes transfering data into its temporary buffer. In this app the temporary buffer is immediately flushed to nonvolatile storage. If a transfer to the temporary buffer failed, this handler will send a response code over the radio.
Returns: Always SUCCESS.

EEPROMWrite.endWriteDone

event result_t EEPROMWrite.endWriteDone (result_t success)

This event is invoked when EEPROM finishes transfering data into its nonvolatile storage. The handler signals the success of the write operation or the failure of commit operation, and sends that status to the application.
Returns: Always SUCCESS.