[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/scp-mac/tos/interfaces CarrierSense.nc, NONE, 1.1 Cntr8bCompInt.nc, NONE, 1.1 Cntr8bOverInt.nc, NONE, 1.1 CsThreshold.nc, NONE, 1.1 CsmaControl.nc, NONE, 1.1 GetSetU16.nc, NONE, 1.1 GetSetU32.nc, NONE, 1.1 GetSetU8.nc, NONE, 1.1 LplControl.nc, NONE, 1.1 LplPollTimer.nc, NONE, 1.1 MacActivity.nc, NONE, 1.1 MacMsg.nc, NONE, 1.1 PhyNotify.nc, NONE, 1.1 PhyPkt.nc, NONE, 1.1 PhyPktError.h, NONE, 1.1 PhyStreamByte.nc, NONE, 1.1 RSSISample.nc, NONE, 1.1 RadioByte.nc, NONE, 1.1 RadioEncoding.nc, NONE, 1.1 RadioEnergy.h, NONE, 1.1 RadioEnergy.nc, NONE, 1.1 RadioState.h, NONE, 1.1 RadioState.nc, NONE, 1.1 TestSignal.nc, NONE, 1.1 Timer.h, NONE, 1.1 Timer.nc, NONE, 1.1 TimerAsync.nc, NONE, 1.1 TxPreamble.nc, NONE, 1.1 UartDebug.nc, NONE, 1.1
Wei Ye
weiyeisi at users.sourceforge.net
Tue May 6 10:31:00 PDT 2008
- Previous message: [Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/scp-mac/tos/platform/avrmote CounterAsyncC.nc, NONE, 1.1 CounterAsyncM.nc, NONE, 1.1 LocalTimeC.nc, NONE, 1.1 LocalTimeM.nc, NONE, 1.1 TimerC.nc, NONE, 1.1 TimerM.nc, NONE, 1.1 timerEvents.h, NONE, 1.1
- Next message: [Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/scp-mac/tos/platform/mica2 CC1000Const.h, NONE, 1.1 CC1000Control.nc, NONE, 1.1 CC1000ControlM.nc, NONE, 1.1 HPLUART0M.nc, NONE, 1.1 PhyConst.h, NONE, 1.1 PhyRadio.nc, NONE, 1.1 PhyRadioM.nc, NONE, 1.1 PhyRadioMsg.h, NONE, 1.1 RadioControl.nc, NONE, 1.1 RadioControlM.nc, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/contrib/scp-mac/tos/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9805/scp-mac/tos/interfaces
Added Files:
CarrierSense.nc Cntr8bCompInt.nc Cntr8bOverInt.nc
CsThreshold.nc CsmaControl.nc GetSetU16.nc GetSetU32.nc
GetSetU8.nc LplControl.nc LplPollTimer.nc MacActivity.nc
MacMsg.nc PhyNotify.nc PhyPkt.nc PhyPktError.h
PhyStreamByte.nc RSSISample.nc RadioByte.nc RadioEncoding.nc
RadioEnergy.h RadioEnergy.nc RadioState.h RadioState.nc
TestSignal.nc Timer.h Timer.nc TimerAsync.nc TxPreamble.nc
UartDebug.nc
Log Message:
scp-mac implementation from USC/ISI
--- NEW FILE: CarrierSense.nc ---
/*
* Copyright (C) 2003-2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides carrier sense on radio
* The return values for result_t is either SUCCESS or FAIL
*/
interface CarrierSense {
/* start carrier sense
* @param numSamples Number of samples to listen.
* The duration of sample interval is defined in PhyConst.h.
* @return Returns SUCCESS if successfully started carrier sense.
* Returns FAIL if radio is not in idle state
*/
command result_t start(uint16_t numSamples);
// signal events when channel busy or idle is detected
// carrier sense automatically stops when detection is done
async event result_t channelIdle();
async event result_t channelBusy();
/* IMPORTANT NOTES:
* 1) If CarrierSense.start returns SUCCESS, either channelIdle or
* channelBusy must be signalled.
* 2) It is possible that channelBusy is signalled right after
* CarrierSense.start returns SUCCESS. This could happen when the
* last bit of the start symbol is detected right after the carrier
* sense starts. As a result, if MAC does the following
*
* if (CarrierSense.start(numBits)) state = CARR_SENSE;
*
* it must be atomic (see SMACM for examples). Otherwise,
* 'state = CARR_SENSE;' could be done after channelBusy is signalled.
* In this case, MAC will wait in carrier sense state, but no more
* channelBusy (or channelIdle) will be signalled.
*/
}
--- NEW FILE: Cntr8bCompInt.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is to control and handle the compare interrupt on the
* 8-bit hardware timer/counter, e.g., counter0 and couter2 on the AtMega128L.
*/
interface Cntr8bCompInt
{
// enable output compare interrupt
command void enable();
// disable output compare interrupt
command void disable();
// Get output compare register value
command uint8_t getCompReg();
// Set output compare register value
command void setCompReg(uint8_t value);
// Signal event on output compare match interrupt
async event void fire();
}
--- NEW FILE: Cntr8bOverInt.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is to control and handle the overflow interrupt on the
* 8-bit hardware timer/counter, e.g., counter0 and couter2 on the AtMega128L.
*/
interface Cntr8bOverInt
{
// enable overflow interrupt
command void enable();
// disable overflow interrupt
command void disable();
// Signal event on overflow interrupt
async event void fire();
}
--- NEW FILE: CsThreshold.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for adjusting carrier sense threshold
*/
interface CsThreshold
{
/**
* reset carrier sense threshold to initial value
*/
command void reset();
/**
* update threshold with measured RSSI samples on signal and noise
* it is required that ALL samples are taken when a packet is correctly
* received, i.e., it should be signaled by PhyRadio after CRC check
* @param signalVal Measured signal strength
* @param noiselVal Measured noise level
*/
command void update(uint16_t signalVal, uint16_t noiselVal);
/**
* when a node is starved on Tx, busyThreshold will be raised to make
* it more aggressive. Starvation is defined by MAC that uses carrier
* sense, e.g., consecutive failures on randamized carrier sense
*/
command void starved();
}
--- NEW FILE: CsmaControl.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is controls CSMA MAC parameters
*/
interface CsmaControl
{
/**
* set the length of additional preamble
* @param length of additional preamble to be added to normal preamble
*/
command void addPreamble(uint16_t length);
/**
* set contention window size
* @param numSlots The size of the contention window, must be 2^n - 1
*/
command void setContWin(uint8_t numSlots);
/**
* set backoff time when carrier sense fails
* @param time The backoff time should be longer than preamble transmission
* time, so that the start symbol can be detected if there is an actual
* transmission
*/
command void setBackoffTime(uint32_t time);
/**
* disable automatic re-send after previous attempt fails
* autoReTx is default mode on CSMA
*/
command void disableAutoReTx();
/**
* enable automatic re-send after previous attempt fails
* autoReTx is default mode on CSMA
*/
command void enableAutoReTx();
}
--- NEW FILE: GetSetU16.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides two generic commands for getting and setting values
* on unsigned 16-bit values
*/
interface GetSetU16
{
// get an unsiged 16-bit value
command uint16_t get();
// set an unsiged 16-bit value
command result_t set(uint16_t value);
}
--- NEW FILE: GetSetU32.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides two generic commands for getting and setting values
* on unsigned 32-bit values
*/
interface GetSetU32
{
/**
*This command gets an unsigned 32-bit integer value value
*/
command uint32_t get();
/**
*This command sets an unsigned 32-bit integer value value
*/
command result_t set(uint32_t value);
}
--- NEW FILE: GetSetU8.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides two generic commands for getting and setting values
* on unsigned 8-bit values
*/
interface GetSetU8
{
// get an unsigned 8-bit value
command uint8_t get();
// set an unsigned 8-bit value
command result_t set(uint8_t value);
}
--- NEW FILE: LplControl.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye, Asif Pathan
*
* This interface is controls LPL MAC parameters
*/
interface LplControl
{
/**
* temporarily disable periodic radio sleeping
* in this mode, a node does not sleep, but still sends long preambles
*/
command void disableSleeping();
/**
* enable periodic radio sleeping; this is default, normal LPL
*/
command void enableSleeping();
/**
* temporarily disable regular polling
*/
command void disablePolling();
/**
* enable periodic polling; this is default, normal LPL
*/
command void enablePolling();
/**
* poll channel activity now
*/
command result_t pollChannel();
/**
* set the length of additional preamble
* @param length of additional preamble to be added to normal preamble
*/
command void addPreamble(uint16_t length);
/**
* set contention window size
* @param numSlots The size of the contention window, must be 2^n - 1
*/
command void setContWin(uint8_t numSlots);
/**
* set backoff time when poll channel indicates channel busy
* @param time The backoff time should be longer than preamble transmission
* time, so that the start symbol can be detected if there is an actual
* transmission
* @param repeat If true will repeat backoff if channel is still busy at
* the end of last backoff. If false, will go back to sleep after first
* backoff period
*/
command void setBackoffTime(uint32_t time, bool repeat);
/**
* disable automatic re-send after previous attempt fails
* autoReTx is default mode on LPL
*/
command void disableAutoReTx();
/**
* enable automatic re-send after previous attempt fails
* autoReTx is default mode on LPL
*/
command void enableAutoReTx();
}
--- NEW FILE: LplPollTimer.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface controls LPL's channel polling timer
*/
interface LplPollTimer
{
/**
* start channel polling timer
* @param period The period (ms) to poll the channel
*/
command result_t start(uint16_t period);
/**
* stop channel polling timer
*/
command result_t stop();
/**
* get poll timer value (remaining time)
*/
command uint16_t get();
/**
* set poll time value (remaining time)
* @param time The remianing time before the timer fires
*/
command result_t set(uint16_t time);
/**
* relay the timer firing event
*/
async event result_t fired();
}
--- NEW FILE: MacActivity.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides signals of MAC activity
*/
interface MacActivity
{
/**
* resend a previously buffered packet
* @return SUCCESS if buffered and started sending; FAIL if not buffered
* or can't start now
*/
command result_t reSend();
/**
* virtual carrier sense is busy now
* NAV timer is started when CSMA receives a packet to other nodes
*/
event void virtualCSBusy();
/**
* virtual carrier sense indicates channel idle (NAV timer fires)
* @return if SUCCESS, keep the radio on; if FAIL keep radio off
*/
event void virtualCSIdle();
/**
* signalled when radio is done with current Tx or Rx
* @return if SUCCESS, keep the radio on; if FAIL keep radio off
*/
event void radioDone(result_t result);
}
--- NEW FILE: MacMsg.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for message transmission and reception at the MAC layer
*/
interface MacMsg
{
/**
* send a message
* @param msg Pointer to the message buffer to be sent
* @param length The length of entire message including all headers
* @param toAddr The receivers address. If it is TOS_BCAST_ADDR, will
* broadcast, otherwise will unicast.
* @return Returns SUCCESS if accepted by MAC.
* Returns FAIL if not accepted.
*/
command result_t send(void* msg, uint8_t length, uint16_t toAddr);
/**
* cancel a message to be sent (after calling MacMsg.send)
* note MAC only buffers one message
* @param msg Pointer to the message buffer to be cancelled
* @return Returns SUCCESS if MAC successfully cancels the sending.
* Returns FAIL if MAC already started sending the msg.
*/
command result_t sendCancel(void* msg);
/**
* signal transmission of a message is done
* @param msg Pointer to the message buffer being sent
* @param result SUCCESS if sending is successful;
* FAIL if failed to send out
*/
event void sendDone(void* msg, result_t result);
/**
* signal reception of a message is done
* @param msg Pointer to the message buffer being received
*/
event void* receiveDone(void* msg);
}
--- NEW FILE: PhyNotify.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides notification signals on packet transmission and
* reception.
*/
interface PhyNotify
{
// packet transmission
// for putting timestamp on outgoing packets
async event result_t startSymSent(void* packet);
// packet reception
// for timestamping incoming packets
async event result_t startSymDetected(void* packet, uint8_t bitOffset);
}
--- NEW FILE: PhyPkt.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides packet transmission and reception at the
* physical layer.
*/
includes PhyPktError;
interface PhyPkt
{
// packet transmission
// send a packet with packet length and additional preamble bytes
command result_t send(void* packet, uint8_t pktLen, uint16_t addPreamble);
// transmission is done, signalled in a task
event result_t sendDone(void* packet);
// packet reception
// a packet is received, signalled in a task
event void* receiveDone(void* packet, uint8_t error);
}
--- NEW FILE: PhyPktError.h ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye and Fabio Silva
*
* This interface provides packet transmission and reception at the
* physical layer. This file includes the error codes for receiveDone
*/
enum {
PKT_RECV = 0,
PKT_ERROR = 1,
PKT_ERROR_TONE_RECV = 2
};
--- NEW FILE: PhyStreamByte.nc ---
/*
* Copyright (C) 2003-2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for physical layer to stream bytes to upper layer.
* The snooper application needs each byte for efficiently display a pkt.
*/
interface PhyStreamByte
{
event void rxDone(uint8_t* buffer, uint8_t byteIdx);
}
--- NEW FILE: RSSISample.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for getting a sample from the received signal strength
* indicator (RSSI)
*/
interface RSSISample
{
// get a sample of RSSI
// type can be either NOISE or SIGNAL, as defined in RSSISample.h
command result_t get();
// event when RSSI sample is ready from ADC
async event void ready(uint16_t value);
}
--- NEW FILE: RadioByte.nc ---
/*
* Copyright (C) 2003-2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for sending and receiving bytes over the radio
* The return values for result_t is either SUCCESS or FAIL
*/
interface RadioByte
{
// transmission of bytes
// startTx sets radio to Tx state, and send start symbol automatically
command result_t startTx(uint16_t addPreamble);
// tx next byte in the packet
command result_t txNextByte(uint8_t data);
// tx byte is done, asking for another byte
async event result_t txByteReady();
// start symbol is just sent; used for time stamping outgoing pkt
async event result_t startSymSent();
// reception of bytes
// start symbol is just received; used for time stamping incoming pkt
async event result_t startSymDetected(uint8_t bitOffset);
// a byte in packet is just received
async event result_t rxByteDone(uint8_t data);
}
--- NEW FILE: RadioEncoding.nc ---
// $Id: RadioEncoding.nc,v 1.1 2008/05/06 17:30:58 weiyeisi Exp $
/* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California.
* 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 THE UNIVERSITY OF CALIFORNIA 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 THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA 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 THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
* Copyright (c) 2002-2003 Intel Corporation
* All rights reserved.
*
* This file is distributed under the terms in the attached INTEL-LICENSE
* file. If you do not find these files, copies can be found by writing to
* Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
* 94704. Attention: Intel License Inquiry.
*/
interface RadioEncoding
{
async command result_t encode_flush();
async command result_t encode(uint8_t data);
async command result_t decode(uint8_t data);
async event result_t decodeDone(uint8_t data, uint8_t error);
async event result_t encodeDone(uint8_t data);
}
--- NEW FILE: RadioEnergy.h ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* Data structure for measuring radio energy consumption in different states.
*/
#ifndef RADIO_ENERGY
#define RADIO_ENERGY
// for measuring radio energy
typedef struct {
uint32_t sleepTime;
uint32_t wakeupTime; // transition time from sleep to active
uint32_t idleTime;
uint32_t rxTime;
uint32_t txTime;
} RadioTime;
#endif
--- NEW FILE: RadioEnergy.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for measuring energy performance of the radio
*/
includes RadioEnergy;
interface RadioEnergy
{
/**
* start measuring energy consumption on radio by measuring how much time
* the radio is in each state. All counters will be reset to zero on this
* command.
*/
command result_t startMeasure();
/**
* stop measuring radio energy consumption
*/
command result_t stopMeasure();
/**
* get measured data, as defined in RadioEnergy.h
*/
command RadioTime* get();
}
--- NEW FILE: RadioState.h ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* These radio states are maintained by RadioControl and can be used by other
* components.
*/
// radio states
// these constants are associated with RadioState.nc interface to represent
// the radio hardware states.
enum {
RADIO_SLEEP = 0,
RADIO_WAKEUP = 1, // transition from sleep to active
RADIO_IDLE = 2,
RADIO_RX = 3,
RADIO_TX = 4
};
--- NEW FILE: RadioState.nc ---
/*
* Copyright (C) 2003-2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface provides radio control: state control, Tx and Rx bytes
* The return values for result_t is either SUCCESS or FAIL
*/
includes RadioState;
interface RadioState
{
// Radio state control
/* put radio into idle state
* if wakes up from sleep, may not be immediately done
* Return: 0 -- fail; 1 -- success_done; 2 -- success_wait
*/
command int8_t idle();
/* signal radio wakeup is done */
async event result_t wakeupDone();
/* put radio into sleep state */
command result_t sleep();
/* get current radio state */
command uint8_t get();
}
--- NEW FILE: TestSignal.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for testing an async signal. It's commonly used to
* relay a signal generated by some interrupt
*/
interface TestSignal
{
/**
*relay a signal when it is arrived
*/
async event void received();
}
--- NEW FILE: Timer.h ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* Constants for Timer components
*/
// Constants for Timer and TimerAsync interfaces
// Both interfaces should use the same string "Timer" for getting a unique id
#define TIMER_NUM_UNIQUE_TIMERS uniqueCount("Timer")
#ifdef TIMER_NUM_ARRAY_TIMERS
#define TIMER_NUM_TIMERS (TIMER_NUM_UNIQUE_TIMERS + TIMER_NUM_ARRAY_TIMERS + 1)
#else
#define TIMER_NUM_TIMERS (TIMER_NUM_UNIQUE_TIMERS + 1)
#endif
enum {
TIMER_REPEAT = 0,
TIMER_ONE_SHOT = 1,
// TIMER_NUM_TIMERS = NUM_TIMERS
};
--- NEW FILE: Timer.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye, John Heidemann
*
* This is the timer interface to support S-MAC
*/
includes Timer;
interface Timer {
/**
* Start the timer.
* @param type The type of timer to start. Valid values include
* 'TIMER_REPEAT' for a repeated timer, signal by posting a task
* 'TIMER_ONE_SHOT' for a one-shot timer, signal by posting a task
* @param interval The timer interval in milliseconds. Note that the
* timer cannot support an arbitrary range of intervals.
* (Unfortunately this interface does not specify the valid range
* of timer intervals, which are specific to a platform.)
* @return Returns SUCCESS if the timer can be started with the
* given type and interval. Returns FAIL if the type is not
* valid, if the timer rate is too high, or if there are too many
* timers currently active.
*/
command result_t start(uint8_t type, uint32_t interval);
/**
* Stop the timer immediately, preventing it from firing again.
* @return SUCCESS if the timer could be stopped, or FAIL if the timer
* is not running or the timer ID is out of range.
*
* Notes:
* This command can stop both one-shot timers and repeated timers.
*/
command result_t stop();
/**
* Get the remaining time of the timer before its next firing.
* @return the the remaining time of the timer.
*/
command uint32_t getRemainingTime();
/**
* Set the remaining time of the timer before its next firing.
* @param value is the remaining time to be set to.
* @return SUCCESS if timer value is successfully set, otherwise FAIL.
*
* Notes:
* For a one-shot timer, this command is equivalent to stopping a timer
* and restarting it immediately, but it should be more efficient.
* For a repeated timer, this command only resets remaining time before
* its next firing. In other words, it resets the phase of the repeated
* timer, but does not change its period.
*/
command result_t setRemainingTime(uint32_t time);
/**
* The signal generated by the timer when it fires.
*
* Notes:
* For high-priority timers, the signal is generated within interrupt
* handler, but it does not require the global interrupt be disabled.
*/
event result_t fired();
}
--- NEW FILE: TimerAsync.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye, John Heidemann
*
* This is the timer interface to support S-MAC
*/
includes Timer;
interface TimerAsync {
/**
* Start the timer.
* @param type The type of timer to start. Valid values include
* 'TIMER_REPEAT' for a repeated timer, signal by posting a task
* 'TIMER_ONE_SHOT' for a one-shot timer, signal by posting a task
* @param interval The timer interval in milliseconds. Note that the
* timer cannot support an arbitrary range of intervals.
* (Unfortunately this interface does not specify the valid range
* of timer intervals, which are specific to a platform.)
* @return Returns SUCCESS if the timer can be started with the
* given type and interval. Returns FAIL if the type is not
* valid, if the timer rate is too high, or if there are too many
* timers currently active.
*/
command result_t start(uint8_t type, uint32_t interval);
/**
* Stop the timer immediately, preventing it from firing again.
* @return SUCCESS if the timer could be stopped, or FAIL if the timer
* is not running or the timer ID is out of range.
*
* Notes:
* This command can stop both one-shot timers and repeated timers.
*/
command result_t stop();
/**
* Get the remaining time of the timer before its next firing.
* @return the the remaining time of the timer.
*/
command uint32_t getRemainingTime();
/**
* Set the remaining time of the timer before its next firing.
* @param value is the remaining time to be set to.
* @return SUCCESS if timer value is successfully set, otherwise FAIL.
*
* Notes:
* For a one-shot timer, this command is equivalent to stopping a timer
* and restarting it immediately, but it should be more efficient.
* For a repeated timer, this command only resets remaining time before
* its next firing. In other words, it resets the phase of the repeated
* timer, but does not change its period.
*/
command result_t setRemainingTime(uint32_t time);
/**
* The signal generated by the timer when it fires.
*
* Notes:
* For high-priority timers, the signal is generated within interrupt
* handler, but it does not require the global interrupt be disabled.
*/
async event result_t fired();
}
--- NEW FILE: TxPreamble.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for sending preamble only (no packet), which can be used
* as a wakeup tone.
*/
interface TxPreamble
{
// start sending preamble (no packet) with specified length
// note: radio will go back to idle after Tx
command result_t start(uint16_t length);
// signal when sending preamble is done
async event void done();
// preload a tone in the radio buffer (used only for the CC2420 -- mica-z)
command result_t preload(uint16_t length);
}
--- NEW FILE: UartDebug.nc ---
/*
* Copyright (C) 2005 the University of Southern California.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition to releasing this program under the LGPL, the authors are
* willing to dual-license it under other terms. You may contact the authors
* of this project by writing to Wei Ye, USC/ISI, 4676 Admirality Way, Suite
* 1001, Marina del Rey, CA 90292, USA.
*/
/*
* Authors: Wei Ye
*
* This interface is for debugging by sending bytes to UART
*/
interface UartDebug
{
/**
* initialize UART
*/
command void init();
/**
* send a byte representing the state of a component
* @param byte a byte with any value
*/
command void txState(uint8_t state);
/**
* send a byte representing a pre-defined event
* @param byte a byte with any value
*/
command void txEvent(uint8_t eventNum);
/**
* send an arbitrary byte
* @param byte a byte with any value
*/
command void txByte(uint8_t byte);
}
- Previous message: [Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/scp-mac/tos/platform/avrmote CounterAsyncC.nc, NONE, 1.1 CounterAsyncM.nc, NONE, 1.1 LocalTimeC.nc, NONE, 1.1 LocalTimeM.nc, NONE, 1.1 TimerC.nc, NONE, 1.1 TimerM.nc, NONE, 1.1 timerEvents.h, NONE, 1.1
- Next message: [Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/scp-mac/tos/platform/mica2 CC1000Const.h, NONE, 1.1 CC1000Control.nc, NONE, 1.1 CC1000ControlM.nc, NONE, 1.1 HPLUART0M.nc, NONE, 1.1 PhyConst.h, NONE, 1.1 PhyRadio.nc, NONE, 1.1 PhyRadioM.nc, NONE, 1.1 PhyRadioMsg.h, NONE, 1.1 RadioControl.nc, NONE, 1.1 RadioControlM.nc, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-contrib-commits
mailing list