com.sentilla.platform.tmote
Class KernelProperty

java.lang.Object
  extended by com.sentilla.platform.tmote.Action
      extended by com.sentilla.platform.tmote.KernelProperty
All Implemented Interfaces:
Action

public class KernelProperty
extends Action

API for interacting with kernel properties on the Tmote platform. kernel properties are properties whose value is communicated into the kernel. These properties affect low-level quantities such as the radio channel being used.

A kernel property can be set directly and can also be saved in the property filesystem for persistence (see PropertyDriver). All of the static setter methods will set the value in the kernel and persist the new value in the property filesystem.

To retrieve the initial value for a property, use one of the getDefault methods. The value retrieved will be the one present on the first boot of the mote, regardless of how many times it has been changed since that time.


Field Summary
 
Fields inherited from class com.sentilla.platform.tmote.Action
actionAuto, actionId, actionState, isolateOwner
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Constructor Summary
KernelProperty()
           
 
Method Summary
 byte getDefaultChannel()
          Get the initial value for the radio channel.
 short getDefaultLPLInterval()
          Get the initial value for the Low Power Listening sleep interval.
 long getDefaultMac64()
          Get the initial value for the long Mac address.
 void getDefaultSecurityKey(byte[] seckey)
          Get the initial value for the security key.
static short getLPLInterval()
          Get the current Low Power Listening interval.
static long getMac64()
          Get the current long Mac address.
static void getSecurityKey(byte[] seckey)
          Get the current security key.
static void init()
          Restore all default kernel properties.
protected  void initLPLInterval()
           
protected  void initMac64()
           
protected  void initRadioChannel()
           
protected  void initSecurityKey()
           
 void setKernelLPLInterval(short interval)
          Set the Low Power Listening interval in the kernel.
 void setKernelMac64(long mac64)
          Set the Mac address in the kernel.
 void setKernelSecurityKey(byte[] seckey)
          Set the security key in the kernel.
static void setLPLInterval(short interval)
          Set the Low Power Listening interval in the properties and kernel.
static void setMac64(long mac64)
          Set the Mac address in the properties and kernel.
 void setRadioChannel(byte ch)
          Set the radio channel in the kernel.
static void setSecurityKey(byte[] seckey)
          Set the security key in the properties and kernel.
 
Methods inherited from class com.sentilla.platform.tmote.Action
block, block, cancel, getActionState, initAction, isDone, lookup, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KernelProperty

public KernelProperty()
Method Detail

init

public static void init()
Restore all default kernel properties.


initLPLInterval

protected void initLPLInterval()

getDefaultLPLInterval

public short getDefaultLPLInterval()
Get the initial value for the Low Power Listening sleep interval.


setKernelLPLInterval

public void setKernelLPLInterval(short interval)
Set the Low Power Listening interval in the kernel.

Parameters:
interval - in binary milliseconds (1/1024. sec)

getLPLInterval

public static short getLPLInterval()
Get the current Low Power Listening interval.

Returns:
interval in binary milliseconds (1/1024. sec)

setLPLInterval

public static void setLPLInterval(short interval)
Set the Low Power Listening interval in the properties and kernel.

Parameters:
interval - in binary milliseconds (1/1024. sec)

initMac64

protected void initMac64()

getDefaultMac64

public long getDefaultMac64()
Get the initial value for the long Mac address.


setKernelMac64

public void setKernelMac64(long mac64)
Set the Mac address in the kernel.

Parameters:
mac64 - long address

getMac64

public static long getMac64()
Get the current long Mac address.

Returns:
long address

setMac64

public static void setMac64(long mac64)
Set the Mac address in the properties and kernel.

Parameters:
mac64 - long address

initSecurityKey

protected void initSecurityKey()

getDefaultSecurityKey

public void getDefaultSecurityKey(byte[] seckey)
Get the initial value for the security key.

Parameters:
seckey - must be byte[16].

setKernelSecurityKey

public void setKernelSecurityKey(byte[] seckey)
Set the security key in the kernel.

Parameters:
seckey - byte[16] containing the new key.

getSecurityKey

public static void getSecurityKey(byte[] seckey)
Get the current security key.

Parameters:
seckey - must be byte[16].

setSecurityKey

public static void setSecurityKey(byte[] seckey)
Set the security key in the properties and kernel.

Parameters:
seckey - new key as byte[16].

initRadioChannel

protected void initRadioChannel()

getDefaultChannel

public byte getDefaultChannel()
Get the initial value for the radio channel.


setRadioChannel

public void setRadioChannel(byte ch)
Set the radio channel in the kernel.

Parameters:
ch - new channel.


Copyright © 2007 Sentilla Corporation. All Rights Reserved.