[Tinyos-2-commits]
CVS: tinyos-2.x/apps/tests/TestRadioPM/lib/radioPM/components/abstractions/RadioDutyCycling
RadioDutyCyclingC.nc, NONE, 1.1.2.1 RadioDutyCyclingTable.h,
NONE, 1.1.2.1 RadioDutyCyclingTable.nc, NONE,
1.1.2.1 RadioDutyCyclingTableC.nc, NONE, 1.1.2.1
Kevin Klues
klueska at users.sourceforge.net
Mon May 15 12:36:10 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/TestRadioPM/lib/radioPM/components/abstractions/RadioDutyCycling
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9561/apps/tests/TestRadioPM/lib/radioPM/components/abstractions/RadioDutyCycling
Added Files:
Tag: tos-2-resource-pm-eval-cand
RadioDutyCyclingC.nc RadioDutyCyclingTable.h
RadioDutyCyclingTable.nc RadioDutyCyclingTableC.nc
Log Message:
Radio Power Management protocol architecture
--- NEW FILE: RadioDutyCyclingC.nc ---
/*
* "Copyright (c) 2005 Washington University in St. Louis.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY
* FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
* OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON
* UNIVERSITY IN ST. LOUIS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* WASHINGTON UNIVERSITY IN ST. LOUIS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS."
*/
/**
*
* @author Kevin Klues (klueska at cs.wustl.edu)
* @version $Revision: 1.1.2.1 $
* @date $Date: 2006/05/15 19:36:08 $
*/
#include "DutyCycling.h"
#define RADIO_PM_RADIO_DUTY_CYCLING "RadioPm.RadioDutyCycling"
generic configuration RadioDutyCyclingC() {
provides {
interface RadioDutyCycling;
}
}
implementation {
components RadioPmC;
RadioDutyCycling = RadioPmC.RadioDutyCycling[unique(RADIO_PM_RADIO_DUTY_CYCLING)];
}
--- NEW FILE: RadioDutyCyclingTable.h ---
/*
* "Copyright (c) 2005 Washington University in St. Louis.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY
* FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
* OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON
* UNIVERSITY IN ST. LOUIS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* WASHINGTON UNIVERSITY IN ST. LOUIS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS."
*/
/**
* Constants and structures for use with the Radio Duty Cycling Table.
*
* @author Kevin Klues (klueska at cs.wustl.edu)
* @version $Revision: 1.1.2.1 $
* @date $Date: 2006/05/15 19:36:08 $
*/
#ifndef RADIO_DUTY_CYCLING_TABLE_H
#define RADIO_DUTY_CYCLING_TABLE_H
enum {
RADIO_DUTY_CYCLING_NUM_COLS = 2,
RADIO_DUTY_CYCLING_ON_TIME_MODE_INDEX = 0,
RADIO_DUTY_CYCLING_OFF_TIME_MODE_INDEX = 1,
};
#endif //RADIO_DUTY_CYCLING_TABLE_H
--- NEW FILE: RadioDutyCyclingTable.nc ---
/*
* "Copyright (c) 2005 Washington University in St. Louis.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY
* FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
* OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON
* UNIVERSITY IN ST. LOUIS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* WASHINGTON UNIVERSITY IN ST. LOUIS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS."
*/
/**
*
* @author Kevin Klues (klueska at cs.wustl.edu)
* @version $Revision: 1.1.2.1 $
* @date $Date: 2006/05/15 19:36:08 $
*/
interface RadioDutyCyclingTable
{
command uint8_t* getOnTimeModes();
command uint8_t* getOffTimeModes();
command void signalBeginOnTime(uint8_t i);
command void signalBeginOffTime(uint8_t i);
}
--- NEW FILE: RadioDutyCyclingTableC.nc ---
/*
* "Copyright (c) 2005 Washington University in St. Louis.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY
* FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
* OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON
* UNIVERSITY IN ST. LOUIS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* WASHINGTON UNIVERSITY IN ST. LOUIS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS."
*/
/**
*
* @author Kevin Klues (klueska at cs.wustl.edu)
* @version $Revision: 1.1.2.1 $
* @date $Date: 2006/05/15 19:36:08 $
*/
module RadioDutyCyclingTableC {
provides {
interface RadioDutyCyclingTable;
interface RadioDutyCycling[uint8_t];
}
}
implementation {
uint8_t table[RADIO_DUTY_CYCLING_NUM_COLS][uniqueCount(RADIO_PM_RADIO_DUTY_CYCLING)];
command uint8_t* RadioDutyCyclingTable.getOnTimeModes() {
return table[RADIO_DUTY_CYCLING_ON_TIME_MODE_INDEX];
}
command uint8_t* RadioDutyCyclingTable.getOffTimeModes() {
return table[RADIO_DUTY_CYCLING_OFF_TIME_MODE_INDEX];
}
command error_t RadioDutyCycling.setModes[uint8_t n](DutyCycleModes onMode, DutyCycleModes offMode) {
table[RADIO_DUTY_CYCLING_ON_TIME_MODE_INDEX][n] = onMode;
table[RADIO_DUTY_CYCLING_OFF_TIME_MODE_INDEX][n] = offMode;
return SUCCESS;
}
command error_t RadioDutyCycling.setOnTimeMode[uint8_t n](DutyCycleModes onMode) {
table[RADIO_DUTY_CYCLING_ON_TIME_MODE_INDEX][n] = onMode;
return SUCCESS;
}
command error_t RadioDutyCycling.setOffTimeMode[uint8_t n](DutyCycleModes offMode) {
table[RADIO_DUTY_CYCLING_OFF_TIME_MODE_INDEX][n] = offMode;
return SUCCESS;
}
command void RadioDutyCyclingTable.signalBeginOnTime(uint8_t i) {
signal RadioDutyCycling.beginOnTime[i]();
}
command void RadioDutyCyclingTable.signalBeginOffTime(uint8_t i) {
signal RadioDutyCycling.beginOffTime[i]();
}
default event void RadioDutyCycling.beginOffTime[uint8_t n]() {
}
default event void RadioDutyCycling.beginOnTime[uint8_t n]() {
}
}
More information about the Tinyos-2-commits
mailing list