com.nokia.m2m.imp.iocontrol
Class IOControl

java.lang.Object
  |
  +--com.nokia.m2m.imp.iocontrol.IOControl

public class IOControl
extends Object

The IOControl class is used to control I/O pin states from the IMlet. IOControl provides a collection of methods to control some of the special features available in Nokia 12 GSM M2M module, e.g., the reading and writing of IO pins. This is a Singleton implementation, so only one instance is allowed and possible. Use IOControl.getInstance to generate this instance. If the instance is already created, the existing one will be returned.
This class is thread safe.


Constructor Summary
protected IOControl()
           
 
Method Summary
 int getAnalogInputPin(int pin)
          Reads the value of the specified analog input pin 1-3.
 int getAnalogOutputPin(int pinParam)
          Returns the value of an analog output pin.
 boolean getDigitalInputPin(int pin)
          Reads the value of the specified digital input pin 4-11.
 boolean getDigitalOutputPin(int pin)
          Reads the value of the specified digital output pin 1-9.
static IOControl getInstance()
          This is a singleton method for returning the only instance of a class.
 void setAnalogOutputPin(int pinParam, int valueParam)
          Sets the value of an analog output pin.
 void setDigitalOutputPin(int pin, boolean state)
          Changes the state of the output pins 1-9.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOControl

protected IOControl()
Method Detail

getInstance

public static IOControl getInstance()
This is a singleton method for returning the only instance of a class.

Returns:
Instance of IOControl

setDigitalOutputPin

public void setDigitalOutputPin(int pin,
                                boolean state)
                         throws IOException,
                                IllegalArgumentException
Changes the state of the output pins 1-9. Parameter pin defines the number of the device pin that you want to control. The parameter state either turns the pin on or off. "True" turns the pin on, "false" turns the pin off.

Parameters:
pin - Digital output pin number 1-9
state - Pin state
Throws:
IOException - If the state of the pin could not be changed.
IllegalArgumentException - If the given pin number does not exists.

getDigitalOutputPin

public boolean getDigitalOutputPin(int pin)
                            throws IOException,
                                   IllegalArgumentException
Reads the value of the specified digital output pin 1-9. Parameter pin defines the number of the device output pin to be read.

Parameters:
pin - Defines output pin number.
Returns:
Pin state
Throws:
IOException - If the state of the pin could not be changed.
IllegalArgumentException - If the given pin number does not exists.

getDigitalInputPin

public boolean getDigitalInputPin(int pin)
                           throws IOException,
                                  IllegalArgumentException
Reads the value of the specified digital input pin 4-11. Parameter pin defines the number of the device input pin to be read.

Parameters:
pin - Defines the number of the digital input pin 4-11.
Returns:
Value of the specified input pin.
Throws:
IOException
IllegalArgumentException - If the given pin number does not exists.

getAnalogInputPin

public int getAnalogInputPin(int pin)
                      throws IOException,
                             IllegalArgumentException
Reads the value of the specified analog input pin 1-3. Parameter pin defines the number of the device input pin to be read.

Parameters:
pin - Analog input pin number 1-3.
Returns:
The mV (milliVolts) value of the specified analog input pin .
Throws:
IOException - If the state of the pin could not be changed.
IllegalArgumentException - If the given pin number does not exists.

getAnalogOutputPin

public int getAnalogOutputPin(int pinParam)
                       throws IOException,
                              IllegalArgumentException
Returns the value of an analog output pin.
There are no analog output pins in the Nokia 12 GSM module and therefore calling this method throws a java.io.IOException.

Parameters:
pinParam - Defines analog output pin number.
Throws:
IOException - Because there are no analog output pins in the Nokia 12 GSM module.
IllegalArgumentException

setAnalogOutputPin

public void setAnalogOutputPin(int pinParam,
                               int valueParam)
                        throws IOException,
                               IllegalArgumentException
Sets the value of an analog output pin. There are no analog output pins in the Nokia 12 GSM module and therefore calling this method throws a java.io.IOException.

Parameters:
pinParam - Defines analog output pin number.
valueParam - Defines the value of analog output pin.
Throws:
IOException - Because there are no analog output pins in the Nokia 12 GSM module.
IllegalArgumentException


Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.

Portions of this document are under the following copyright:
Copyright © 2003 Nokia. All rights reserved.