Skip to content

Commit

Permalink
commenting applications
Browse files Browse the repository at this point in the history
  • Loading branch information
amaxilat committed May 19, 2012
1 parent fac92a5 commit 6ea31d9
Show file tree
Hide file tree
Showing 27 changed files with 461 additions and 705 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.

INPUT = iSense TelosB
INPUT = ./

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
Expand Down
100 changes: 72 additions & 28 deletions TelosB/collector/src/collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@

using namespace isense;

class iSenseDemoApplication :
/**
* An application that collects periodically readings
* from
* <a href='http://www.willow.co.uk/html/telosb_mote_platform.html'>
* TelosB : Light,Infrared,Humidity and Temperature sensors </a>
* and reports them to the
* <a href='https://github.com/organizations/Uberdust'> Uberdust Backend</a>
*/
class TelosBCollectorApp :
public isense::Application,
public isense::Receiver,
public isense::Sender,
Expand All @@ -40,32 +48,68 @@ public isense::TimeoutHandler,
public isense::ButtonHandler,
public isense::UartPacketHandler {
public:
iSenseDemoApplication(isense::Os& os);

~iSenseDemoApplication();

///From isense::Application
/**
* Constructor
* @param os a pointer to the os
*/
TelosBCollectorApp(isense::Os& os);

/**
* Destructor
*/
~TelosBCollectorApp();

/**
* Boot function executed when device is powered
*/
void boot(void);

///From isense::ButtonHandler
/**
* Executed when a button is pressed
* @param button the button pressed
*/
void button_down(uint8 button);

///From isense::ButtonHandler
/**
* Executed when a button is released
* @param button the button released
*/
void button_up(uint8 button);

///From isense::Receiver
/**
* Called when a new message is received.
* @param len length of the payload received
* @param buf a buffer containing the payload
* @param src_addr the source of the payload
* @param dest_addr the destination of the payload
* @param signal_strength the strenght of the received signal
* @param signal_quality the quality of the received signal
* @param seq_no sequence number of the message
* @param interface id of the radio received from
* @param time the time of the receive event
*/
void receive(uint8 len, const uint8 * buf, ISENSE_RADIO_ADDR_TYPE src_addr, ISENSE_RADIO_ADDR_TYPE dest_addr, uint16 signal_strength, uint16 signal_quality, uint8 seq_no, uint8 interface, Time time);

///From isense::Sender
void confirm(uint8 state, uint8 tries, isense::Time time);

///From isense::Task
/**
* Executed preriodically to report new readings to the backend
* @param userdata unused
*/
void execute(void* userdata);

///From isense::TimeoutHandler
/**
* unused
* @param userdata unused
*/
void timeout(void* userdata);

///From isense::UartPacketHandler
/**
* Handler for uart messages
* @param type the type of the message
* @param buf the buffer containing the data
* @param length the size of the payload
*/
void handle_uart_packet(uint8 type, uint8* buf, uint8 length);

private:
Expand All @@ -74,30 +118,30 @@ public isense::UartPacketHandler {

//----------------------------------------------------------------------------

iSenseDemoApplication::
iSenseDemoApplication(isense::Os& os)
TelosBCollectorApp::
TelosBCollectorApp(isense::Os& os)
: isense::Application(os),
telos(NULL) {
}

//----------------------------------------------------------------------------

iSenseDemoApplication::
~iSenseDemoApplication() {
TelosBCollectorApp::
~TelosBCollectorApp() {
}

//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
handle_uart_packet(uint8 type, uint8 * mess, uint8 length) {

}

//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
boot(void) {
os().debug("App::boot ");

Expand All @@ -110,7 +154,7 @@ boot(void) {

os().debug("my id is %x", os().id());

// telos->add_button_handler(this);
// telos->add_button_handler(this);

os().add_task_in(Time(5, 0), this, NULL);

Expand All @@ -124,22 +168,22 @@ boot(void) {
//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
button_down(uint8 button) {
telos->led_on(0);
os().debug("BUTTON");
}

void
iSenseDemoApplication::
TelosBCollectorApp::
button_up(uint8 button) {
telos->led_off(0);
}

//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
execute(void* userdata) {
telos->led_on(1);

Expand All @@ -149,7 +193,7 @@ execute(void* userdata) {
int16 light = telos->light();
int16 inflight = telos->infrared();

os().debug("node::%x temperature %d ", os().id(), temp/10);
os().debug("node::%x temperature %d ", os().id(), temp / 10);
os().debug("node::%x humidity %d ", os().id(), humid);
os().debug("node::%x ir %d ", os().id(), inflight);
os().debug("node::%x light %d ", os().id(), light);
Expand All @@ -161,21 +205,21 @@ execute(void* userdata) {
//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
receive(uint8 len, const uint8* buf, ISENSE_RADIO_ADDR_TYPE src_addr, ISENSE_RADIO_ADDR_TYPE dest_addr, uint16 signal_strength, uint16 signal_quality, uint8 seq_no, uint8 interface, Time time) {
}

//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
confirm(uint8 state, uint8 tries, isense::Time time) {
}

//----------------------------------------------------------------------------

void
iSenseDemoApplication::
TelosBCollectorApp::
timeout(void* userdata) {
}

Expand All @@ -184,7 +228,7 @@ timeout(void* userdata) {
/**
*/
isense::Application * application_factory(isense::Os & os) {
return new iSenseDemoApplication(os);
return new TelosBCollectorApp(os);
}


Expand Down
42 changes: 42 additions & 0 deletions doc/pages/mainpage.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** \mainpage Uberudst - sensorApps

\section main_intro Introduction

\section isense iSense Applications

For the iSense platform we use <a href='https://github.com/ibr-alg/wiselib/wiki/'>Wiselib</a> a library for applications to achieve connectivity and between gateway and Wireless devices. All gateway devices operate as intermediates and deliver to the back-end the sensor readings of the wireless devices.

A new <a href='https://github.com/ibr-alg/wiselib/wiki/'>Wiselib</a> message is defined and used to report back the Sensor Readings. Each sensor type uses a different SensorID field in the message header, followed by the SensorValue that may be of a variable size.

\subsection isense_env Environmental Module
<ul>
<li>Temperature
<li>Visible light Luminosity
</ul>
\subsection isense_pir Security Module
<ul>
<li>Movement Pir Sensor
</ul>
\subsection isense_weather Weather Module
<ul>
<li>Temperature
<li>Barometric Pressure
</ul>
\subsection wsn Wireless Network statistics gathering
A second applications responsible for detecting the connectivity between the iSense Sensors also operates simultaneously and reports in the same way network changes ( Bidirectional Link Up and Down ).

\section telosb TelosB Applications

The TelosB application <a href='https://github.com/Uberdust/sensorApps/blob/master/TelosB/collector/src/collector.cpp'>(see here)</a> uses the iSense for TelosB Operating System.

<ul>
<li>Temperature
<li>Visible light Luminosity
<li>Infrared light Luminosity
<li>Relative Humidity
</ul>
\section arduino Arduino Applications

\section more More Info
More information are available on <a href='https://github.com/Uberdust/webapp/wiki'>UberdustWiki</a>
*/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion iSense/collector/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ all: isense
export APP_SRC=collector.cpp
export BIN_OUT=collector

include ../Makefile
include ../Makefiles/Makefile
Loading

0 comments on commit 6ea31d9

Please sign in to comment.