Class EeicLibrary

Object
EeicLibrary

public class EeicLibrary
extends Object
The CASIO Enterprise Developer Tools External Expansion Interface Control (EEIC) Library
Since:
2.00
API Note:
The External Expansion Interface Control (EEIC) Library is bound to the calling application on application startup time automatically.
The Library's lifecycle therefore depends on the application lifecycle.
Due to the Lifecycle of Android Applications and the underlying timing, it is strongly advised not to call any Library Methods inside the onCreate method.
When the activity is being launched (and hence the process gets created), the same applies to the onStart and onResume methods.
If you need to call any Library methods at application start in one of the above mentioned methods, you should use the Callback Mechanism offered by the onLibraryReady method instead.
For instance, instead of calling EeicLibrary.SerialDevice.sendBreak() directly in onCreate, use this code to postpone it to a Callback appropriately:
EeicLibrary.onLibraryReady(new LibraryCallback() {
     public void onLibraryReady() {
         EeicLibrary.SerialDevice.sendBreak();
     }
 });

Which can be simplified to:
EeicLibrary.onLibraryReady(() -> { EeicLibrary.SerialDevice.sendBreak(); });

Or even further to:
EeicLibrary.onLibraryReady(EeicLibrary.SerialDevice::sendBreak);
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  EeicLibrary.GpioDevice
    The GpioDevice class is used to control general purpose input / output pins
    static class  EeicLibrary.I2cDevice
    The I2cDevice class is used to communicate with an external expansion device connected via I²C Interface.
    static class  EeicLibrary.InterruptCallback
    This callback class called when an interrupt occurs.
    static class  EeicLibrary.SerialDevice
    The SerialDevice class is used to communicate with an external expansion device connected via Serial Interface.
    static class  EeicLibrary.SpiDevice
    The SpiDevice class is used to communicate with an external expansion device connected via the Serial Peripheral Interface (SPI).
  • Method Summary

    Modifier and Type Method Description
    static String getLibraryVersion()
    Gets the EEIC Library Version.
    static boolean isMethodSupported​(String methodName)
    Check whether the Method indicated by the String methodName parameter is supported on the currently active device
    static boolean isMethodSupported​(BigInteger method)
    Check whether the Method indicated by the BigInteger method parameter is supported on the currently active device
    static boolean isPowerOn()
    Gets the power status of the external expansion interface.
    static void onLibraryReady​(LibraryCallback callback)
    Add a new Callback to the Queue of Callbacks to be processed once the EeicLibrary Service becomes available
    static boolean setPower​(boolean enable)
    Turns the power of the external expansion interface on and off.