public class IOManager extends Object
This class also provides access to the user LED.
This class also provides access to the eWON front button.
Modifier and Type | Field and Description |
---|---|
static int |
COLOR_GREEN
use with
setUserLed(int) to set the led color to GREEN |
static int |
COLOR_OFF
use with
setUserLed(int) to set the led color to OFF |
static int |
COLOR_RED
use with
setUserLed(int) to set the led color to RED |
Constructor and Description |
---|
IOManager() |
Modifier and Type | Method and Description |
---|---|
static int |
getNbTags()
Return the number of tags defined in the eWON
|
static void |
modemLedJvmCtrl(boolean JvmCtrl)
This function is used to control if the PPP/Modem process must control the Modem led, or if the JAVA application does it.
|
static boolean |
readButton()
Read the current status of the button.
|
static float |
readTag(String tagName)
Read a tag with the given name and returns itf value.
|
static void |
setModemLed(int color)
Control the color/status of the eWON Modem led.
|
static void |
setUserLed(int color)
Control the color/status of the eWON user (status) led.
|
static void |
userLedJvmCtrl(boolean JvmCtrl)
This function is used to control if the eart beat process must control the user led or not.
|
static void |
writeTag(String tagName,
double tagValue)
Write to tag passing a double.
|
static void |
writeTag(String tagName,
float tagValue)
Write a tag with the given name.
|
public static final int COLOR_OFF
setUserLed(int)
to set the led color to OFFpublic static final int COLOR_GREEN
setUserLed(int)
to set the led color to GREENpublic static final int COLOR_RED
setUserLed(int)
to set the led color to REDpublic static void setUserLed(int color)
userLedJvmCtrl
must be called with true
, this means that the JVM has the contol of the led.color
- one of COLOR_OFF
, COLOR_GREEN
or COLOR_RED
public static void setModemLed(int color)
modemLedJvmCtrl
must be called with true
, this means that the JVM has the contol of the led.color
- one of COLOR_OFF
, COLOR_GREEN
public static boolean readButton()
It is also possible to monitor the button changes using the DefaultEventHandler
.
The DefaultEventHandler
has a function called setOnButtonListener
to create a listener on the button state change.
true
if button is pressed.public static void userLedJvmCtrl(boolean JvmCtrl)
If JvmCtrl
is true
then the eart beat process does not toggle the led and
the Jvm has the full control over the led (using the setUserLed
) function.
JvmCtrl
- false
if eart beat controls the led.
true
if JVM controls the led.public static void modemLedJvmCtrl(boolean JvmCtrl)
If JvmCtrl
is true
then the PPP/Modem process does not control the led and
the Jvm has the full control over the led (using the setModemLed
) function.
Once the function has been called, the eWON must be rebooted to release the led control.
JvmCtrl
- false
if PPP/Modem controls the led.
true
if JVM controls the led.public static float readTag(String tagName)
tagName
- Tag Namepublic static void writeTag(String tagName, float tagValue)
tagName
- Tag Name.tagValue
- Value to set tag.public static int getNbTags()
public static void writeTag(String tagName, double tagValue)
writeTag(String, float)
tagName
- The tag name.tagValue
- Value to set.