SunSPOT API V3.0


com.sun.spot.sensorboard.io
Interface IInputPin

All Known Subinterfaces:
IIOPin
All Known Implementing Classes:
BinaryScalar, InputPin, InvertingInputPin, IOPin

public interface IInputPin

Interface IInputPin defines access to a single input pin.


Method Summary
 void addIInputPinListener(IInputPinListener who)
          Adds the specified input pin listener to receive callbacks from this input pin.
 IInputPinListener[] getIInputPinListeners()
          Return an array of all the input pin listeners registered on this input pin.
 PinDescriptor getIndex()
          Return the PinDescriptor associated with this input pin.
 boolean isHigh()
          Return true if the input bit is high.
 boolean isLow()
          Return true if the input bit is low.
 void removeIInputPinListener(IInputPinListener who)
          Removes the specified input pin listener so that it no longer receives callbacks from this input pin.
 void waitForChange()
          Block the current thread until the pin's state changes.
 

Method Detail

getIndex

PinDescriptor getIndex()
Return the PinDescriptor associated with this input pin.

Returns:
the PinDescriptor associated with this input pin.

isLow

boolean isLow()
Return true if the input bit is low.

Returns:
true if the input bit is low.

isHigh

boolean isHigh()
Return true if the input bit is high.

Returns:
true if the input bit is high.

waitForChange

void waitForChange()
Block the current thread until the pin's state changes. (This now uses interrupts and no longer polls.) Note: waitForChange does not inhibit deep sleep.


addIInputPinListener

void addIInputPinListener(IInputPinListener who)
Adds the specified input pin listener to receive callbacks from this input pin. Note: that if pin changes happen too fast some transitions may be missed. At least 3 milliseconds is required between pin changes.

Parameters:
who - the input pin listener to add.

removeIInputPinListener

void removeIInputPinListener(IInputPinListener who)
Removes the specified input pin listener so that it no longer receives callbacks from this input pin. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this input pin.

Parameters:
who - the input pin listener to remove.

getIInputPinListeners

IInputPinListener[] getIInputPinListeners()
Return an array of all the input pin listeners registered on this input pin.

Returns:
all of this input pin's listeners or an empty array if no input pin listeners are currently registered.

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.