/** * This file is part of license combination gpl version 3 license and eCos. * The corresponding license terms are below. * * gpl version 3 Licence: * * The file were developed during the student thesis "Datensammlung in Wireless * Sensor Networks fuer Autonomic Home NetworkingÒ of Thomas Kothmayr and is * included in the dissertation "Secure Data Transmission in Wireless * Sensor Networks" by Corinna Schmitt during employment at the Technische * UniversitŠt MŸnchen, Department Computer Science, Chair Network * Architectures and Services (Germany). * Copyright (C) 2013 * Authors: Thomas Kothmayr and Corinna Schmitt (schmitt[at]net.in.tum.de) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License * * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * * eCos Licence: (http://ecos.sourceware.org) * * This file is part of eCos, the Embedded Configurable Operating System. * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, * 2007, 2008, 2009 Free Software Foundation, Inc. * * eCos is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 3 any later version. * * eCos 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 General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with eCos; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * As a special exception, if other files instantiate templates or use * macros or inline functions from this file, or you compile this file and * link it with other works to produce a work based on this file, this file * does not by itself cause the resulting work to be covered by the GNU * General Public License. However the source code for this file must still * be made available in accordance with section (3) of the GNU General * Public License v2. * * This exception does not invalidate any other reasons why a work based on * this file might be covered by the GNU General Public License. * */ Interface: tos.interfaces.LowPowerListening

Interface: tos.interfaces.LowPowerListening

interface LowPowerListening

Low Power Listening interface

Author:
Jonathan Hui
David Moss

Commands
command uint16_t dutyCycleToSleepInterval(uint16_t dutyCycle) Convert a duty cycle, in units of [percentage*100], to the sleep interval of the mote in milliseconds
command uint16_t getLocalDutyCycle()
command uint16_t getLocalSleepInterval()
command uint16_t getRxDutyCycle(message_t *msg)
command uint16_t getRxSleepInterval(message_t *msg)
command void setLocalDutyCycle(uint16_t dutyCycle) Set this node's radio duty cycle rate, in units of [percentage*100].
command void setLocalSleepInterval(uint16_t sleepIntervalMs) Set this this node's radio sleep interval, in milliseconds.
command void setRxDutyCycle(message_t *msg, uint16_t dutyCycle) Configure this outgoing message so it can be transmitted to a neighbor mote with the specified Rx duty cycle rate.
command void setRxSleepInterval(message_t *msg, uint16_t sleepIntervalMs) Configure this outgoing message so it can be transmitted to a neighbor mote with the specified Rx sleep interval.
command uint16_t sleepIntervalToDutyCycle(uint16_t sleepInterval) Convert a sleep interval, in units of [ms], to a duty cycle in units of [percentage*100]

Commands - Details

dutyCycleToSleepInterval

command uint16_t dutyCycleToSleepInterval(uint16_t dutyCycle)

Convert a duty cycle, in units of [percentage*100], to the sleep interval of the mote in milliseconds

Parameters:
dutyCycle - The duty cycle in units of [percentage*100]
Returns:
The equivalent sleep interval, in units of [ms]

getLocalDutyCycle

command uint16_t getLocalDutyCycle()

Returns:
this node's radio duty cycle rate, in units of [percentage*100]

getLocalSleepInterval

command uint16_t getLocalSleepInterval()

Returns:
the local node's sleep interval, in [ms]

getRxDutyCycle

command uint16_t getRxDutyCycle(message_t *msg)

Parameters:
'message_t* ONE msg'
Returns:
the destination node's duty cycle configured in this message in units of [percentage*100]

getRxSleepInterval

command uint16_t getRxSleepInterval(message_t *msg)

Parameters:
'message_t* ONE msg'
Returns:
the destination node's sleep interval configured in this message

setLocalDutyCycle

command void setLocalDutyCycle(uint16_t dutyCycle)

Set this node's radio duty cycle rate, in units of [percentage*100]. For example, to get a 0.05% duty cycle, call LowPowerListening.setDutyCycle(5); For a 100% duty cycle (always on), call LowPowerListening.setDutyCycle(10000); This is the equivalent of setting the local sleep interval explicitly.

Parameters:
dutyCycle - The duty cycle percentage, in units of [percentage*100]

setLocalSleepInterval

command void setLocalSleepInterval(uint16_t sleepIntervalMs)

Set this this node's radio sleep interval, in milliseconds. Once every interval, the node will sleep and perform an Rx check on the radio. Setting the sleep interval to 0 will keep the radio always on. This is the equivalent of setting the local duty cycle rate.

Parameters:
sleepIntervalMs - the length of this node's Rx check interval, in [ms]

setRxDutyCycle

command void setRxDutyCycle(message_t *msg, uint16_t dutyCycle)

Configure this outgoing message so it can be transmitted to a neighbor mote with the specified Rx duty cycle rate. Duty cycle is in units of [percentage*100], i.e. 0.25% duty cycle = 25.

Parameters:
'message_t* ONE msg' Pointer to the message that will be sent
dutyCycle - The duty cycle of the receiving mote, in units of [percentage*100]

setRxSleepInterval

command void setRxSleepInterval(message_t *msg, uint16_t sleepIntervalMs)

Configure this outgoing message so it can be transmitted to a neighbor mote with the specified Rx sleep interval.

Parameters:
'message_t* ONE msg' Pointer to the message that will be sent
sleepInterval - The receiving node's sleep interval, in [ms]

sleepIntervalToDutyCycle

command uint16_t sleepIntervalToDutyCycle(uint16_t sleepInterval)

Convert a sleep interval, in units of [ms], to a duty cycle in units of [percentage*100]

Parameters:
sleepInterval - The sleep interval in units of [ms]
Returns:
The duty cycle in units of [percentage*100]