Apps     Components     Interfaces     All Files     Source Tree     source: apps.SenseLightToLog.SenseLightToLogM.nc

Component: SenseLightToLogM

Implementation for SenseLightToLog module. When a command to start sensing is received, it periodically samples the light sensor for N samples and stores them in the EEPROM. Once N samples have been collected, the timer is turned off and a send done event is posted.

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

StdControl.init

command result_t StdControl.init (void)

Initialize the application.
Returns: Initialization status.

StdControl.start

command result_t StdControl.start (void)

Start the application.
Returns: Start status.

StdControl.stop

command result_t StdControl.stop (void)

Stop the application.
Returns: Stop status.

Sensing.start

command result_t Sensing.start (int samples, int interval_ms)

This command belongs to the Sensing interface. It starts the timer to generate periodic events.
Returns: Always returns SUCCESS

Timer.fired

event result_t Timer.fired (void)

Event handler to the Timer.fired event.
Returns: Always returns SUCCESS

Sensing.done

event result_t Sensing.done (void)

Default event handler to the Sensing.done event.
Returns: Always returns SUCCESS

ADC.dataReady

async event result_t ADC.dataReady (uint16_t this_data)

Event handler to the ADC.dataReady event. Store the reading in the buffer, when the buffer fills up, write it out to the logger, and switch to another circular buffer.
Returns: Always returns SUCCESS

LoggerWrite.writeDone

event result_t LoggerWrite.writeDone (result_t status)

Event handler for the LoggerWrite.writeDone event. Toggle the yellow LED if status is true.
Returns: Always returns SUCCESS

CmdExecute.done

event result_t CmdExecute.done (TOS_MsgPtr pmsg, result_t status)

Event handler to the CmdExecute.done event. Do nothing.
Returns: Always returns SUCCESS