com.buglabs.bug.module.lcd.pub
Class LCDModlet

java.lang.Object
  extended by com.buglabs.bug.module.lcd.pub.LCDModlet
All Implemented Interfaces:
ILCDModuleControl, IModuleDisplay, IModlet, IModuleControl, IModuleLEDController

public class LCDModlet
extends java.lang.Object
implements IModlet, ILCDModuleControl, IModuleControl, IModuleDisplay, IModuleLEDController

LCD Modlet class for 1x LCD module.


Field Summary
 
Fields inherited from interface com.buglabs.bug.module.lcd.pub.IModuleDisplay
MODULE_ID
 
Constructor Summary
LCDModlet(BundleContext context, int slotId, java.lang.String moduleId)
           
 
Method Summary
 int disable()
           
 int enable()
           
 java.awt.Frame getFrame()
           
 java.lang.String getModuleId()
          Return the MODULE ID.
 java.lang.String getModuleName()
          Get the human-readable name of this module.
 java.util.List getModuleProperties()
          Return a list of IModuleProperty elements.
 int getSlotId()
           
 int getStatus()
           
 int setBackLight(int val)
           
 int setBlackLight(int val)
           
 int setLEDGreen(boolean state)
           
 int setLEDRed(boolean state)
           
 boolean setModuleProperty(IModuleProperty property)
          Set a property.
 void setup()
          Connect to any devices or do any initialization.
 void start()
          Begin modlet.
 void stop()
          Unregister services and release any resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LCDModlet

public LCDModlet(BundleContext context,
                 int slotId,
                 java.lang.String moduleId)
Method Detail

setup

public void setup()
           throws java.lang.Exception
Description copied from interface: IModlet
Connect to any devices or do any initialization. This is a good place to throw an exception if the expected hardware environment is not valid.

Specified by:
setup in interface IModlet
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Description copied from interface: IModlet
Begin modlet. Any services that the modlet supports should be registered here.

Specified by:
start in interface IModlet
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Description copied from interface: IModlet
Unregister services and release any resources.

Specified by:
stop in interface IModlet
Throws:
java.lang.Exception

getModuleProperties

public java.util.List getModuleProperties()
Description copied from interface: IModuleControl
Return a list of IModuleProperty elements.

Specified by:
getModuleProperties in interface IModuleControl
Returns:

setModuleProperty

public boolean setModuleProperty(IModuleProperty property)
Description copied from interface: IModuleControl
Set a property. This is from a client request.

Specified by:
setModuleProperty in interface IModuleControl
Returns:

getSlotId

public int getSlotId()
Specified by:
getSlotId in interface IModlet
Specified by:
getSlotId in interface IModuleControl
Returns:
Slot that the Module is currently connected to.

getFrame

public java.awt.Frame getFrame()
Specified by:
getFrame in interface IModuleDisplay
Returns:
Returns the base frame used to create controls on the display.

getModuleId

public java.lang.String getModuleId()
Description copied from interface: IModlet
Return the MODULE ID. This comes from the hardware.

Specified by:
getModuleId in interface IModlet
Returns:

getModuleName

public java.lang.String getModuleName()
Description copied from interface: IModuleControl
Get the human-readable name of this module.

Specified by:
getModuleName in interface IModuleControl
Returns:

setLEDGreen

public int setLEDGreen(boolean state)
                throws java.io.IOException
Specified by:
setLEDGreen in interface IModuleLEDController
Throws:
java.io.IOException

setLEDRed

public int setLEDRed(boolean state)
              throws java.io.IOException
Specified by:
setLEDRed in interface IModuleLEDController
Parameters:
state - on = true, off = false;
Returns:
the return of the underlying ioctl.
Throws:
java.io.IOException

getStatus

public int getStatus()
              throws java.io.IOException
Specified by:
getStatus in interface ILCDModuleControl
Returns:
The stat of IOX. The 3 LSBs reprersent the state of the backlight.
Throws:
java.io.IOException

disable

public int disable()
            throws java.io.IOException
Specified by:
disable in interface ILCDModuleControl
Throws:
java.io.IOException

enable

public int enable()
           throws java.io.IOException
Specified by:
enable in interface ILCDModuleControl
Throws:
java.io.IOException

setBlackLight

public int setBlackLight(int val)
                  throws java.io.IOException
Specified by:
setBlackLight in interface ILCDModuleControl
Parameters:
val - Set's the intensity of the backlight 0-7.
Throws:
java.io.IOException

setBackLight

public int setBackLight(int val)
                 throws java.io.IOException
Specified by:
setBackLight in interface ILCDModuleControl
Parameters:
val - Set's the intensity of the backlight 0-7.
Throws:
java.io.IOException