Java Question Nul Pointer Error using a wrapper library

javiman6969

Member
Licensed User
Longtime User
Hi.
I am trying to create a library from an sdk (caiosdevice) Casio.
I am using SLC and I have the source code of a class called LineDisplay.java

This is the code.

B4X:
package axinfor.casiosdk.com;

import android.app.Application;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
import anywheresoftware.b4a.AbsObjectWrapper;
import jp.co.casio.caios.framework.device.*;


@ShortName("LineDisplay")
@DependsOn(values = { "caiosdevice" })


/*
    LineDisplay
    Created with Basic4Android Library Generator - by XverhelstX
    Line Display class enables the line display (back display) to be indicated.
    The line display device has display area of 20 lines of 20 half-byte characters.
*/
public class LineDisplay extends AbsObjectWrapper<LineDisplay> {

    public static final int DEVICE_MODE_COMMON            = 0x01;
    public static final int DEVICE_MODE_EXCLUSIVE        = 0x02;

    public static final String DEVICE_HOST_LOCALHOST    = "localhost";

    public static final int LCD_CONTROL_NORMAL            = 0x00;
    public static final int LCD_CONTROL_HEIGHT            = 0x01;
    public static final int LCD_CONTROL_REVERSE            = 0x02;

    public static final int LCD_BACKLIGHT_OFF            = 0x00;
    public static final int LCD_BACKLIGHT_GREEN            = 0x01;
    public static final int LCD_BACKLIGHT_WHITE            = 0x02;
    public static final int LCD_BACKLIGHT_EMEGREEN        = 0x03;

    public static final int LCD_DEFAULT_MODE_NORMAL        = 0x00;
    public static final int LCD_DEFAULT_MODE_ANK        = 0x01;
    public static final int LCD_DEFAULT_MODE_JAPAN        = 0x02;
    public static final int LCD_DEFAULT_MODE_CHINA        = 0x03;

    public static final int LCD_DEFAULT_CODE_NORMAL        = 0x00;
    public static final int LCD_DEFAULT_CODE_AMERICA    = 0x01;
    public static final int LCD_DEFAULT_CODE_FRANCE        = 0x02;
    public static final int LCD_DEFAULT_CODE_GERMAN        = 0x03;
    public static final int LCD_DEFAULT_CODE_ENGLAND    = 0x04;
    public static final int LCD_DEFAULT_CODE_DENMARK    = 0x05;
    public static final int LCD_DEFAULT_CODE_SWEDEN        = 0x06;
    public static final int LCD_DEFAULT_CODE_ITALY        = 0x07;
    public static final int LCD_DEFAULT_CODE_SPAIN        = 0x08;
    public static final int LCD_DEFAULT_CODE_JAPAN        = 0x09;
    public static final int LCD_DEFAULT_CODE_NORWAY        = 0x0A;
    public static final int LCD_DEFAULT_CODE_DENMARK2    = 0x0B;

    public static final int LCD_DEFAULT_TABLE_NORMAL    = 0x00;
    public static final int LCD_DEFAULT_TABLE_USA        = 0x01;
    public static final int LCD_DEFAULT_TABLE_JAPAN        = 0x02;
    public static final int LCD_DEFAULT_TABLE_EURO        = 0x03;
    public static final int LCD_DEFAULT_TABLE_ARABIC    = 0x03;

    public static final int LCD_SLEEP_OFF                = 0x01;
    public static final int LCD_SLEEP_ON                = 0x01;


    private BA ba;
    private String eventName;
    private LineDisplay linedisplay;
   
    public void Initialize(final BA ba) {
   
        this.ba = ba;
        this.linedisplay = new LineDisplay();
       
    }

    public LineDisplay getLineDisplay() {
        return this.linedisplay;
    }

    public void setLineDisplay(LineDisplay linedisplay) {
        this.linedisplay = linedisplay;
    }

    /*
        Opens a device and controls it exclusively       
        int open(int mode, String hostname)               
    */   
    public int open(int arg0, String arg1) {
        return this.linedisplay.open(arg0, arg1);
    }

    /*
        Closes a device.                                   
        int close(void)                                   
    */
    public int close() {
        return this.linedisplay.close();
    }

    /*
        Clears line display indication.                               
        int clear(void)                           
    */
    public int clear() {
        return this.linedisplay.clear();
    }

    /*
        Enables line display indication.
        When assigned character number is less than the display area, spaces are filled in the remaining area.
        If assigned character number exceeds display area, the exceeded characters are cancelled.                           
        int setText(byte[] line1, byte[] line2, int control)                           
        Byte[] line1: Character string of the first display line: 20 bytes.
        Byte[] line2: Character string of the second display line: 20 bytes.
        int control: Assigns display control (multiple assignment available).
    */
    public void setText(byte[] arg0, byte[] arg1, int arg2) {
        this.linedisplay.setText(arg0, arg1, arg2);
    }

    /*
        Assigns backlight color.
        int setBacklight(int backlightStatus)
        Sets contrast value:  0 to 255
    */   
    public void setBacklight(int arg0) {
        this.linedisplay.setBacklight(arg0);
    }

    /*
        Assigns contrast value.
        int setContrast(int contrastStatus)
       
    */       
    public void setContrast(int arg0) {
        this.linedisplay.setContrast(arg0);
    }

    /*
        Registers the initial value at power recovery.
        setPowerDefault(int mode, int code, int table)
       
    */
    public void setPowerDefault(int arg0, int arg1, int arg2) {
        this.linedisplay.setPowerDefault(arg0, arg1, arg2);
    }

    /*
        Sleep control. Turns the backlight on or off. The ON status depends on the set status of the backlight.
        setSleep(int mode)
    */
    public void setSleep(int arg0) {
        this.linedisplay.setSleep(arg0);
    }

    /*
        Sets character code type, international character, and character code table by discriminating the locale.
        setCurrentCodepage()
    */
    public void setCurrentCodepage() {
        this.linedisplay.setCurrentCodepage();   
    }

}

Compile correctly, but when I try to use it from b4a, I get an error of Null Pointer in the method Open

This is the code:

B4X:
Sub ButtonVisor_Click

    Dim casioVisor As LineDisplay
   
    Dim nRes As Long
    Dim cLinea1, cLinea2 As String
    Dim byteConv As ByteConverter
    Dim bLinea1(20) As Byte
    Dim bLinea2(20) As Byte
   
    casioVisor.Initialize
           
    nRes = casioVisor.open( casioVisor.DEVICE_MODE_COMMON, casioVisor.DEVICE_HOST_LOCALHOST )
         
    casioVisor.clear
   
    cLinea1 = "hello"
    cLinea2 = "world"
   
    bLinea1 = byteConv.StringToBytes(cLinea1, "UTF8")
    bLinea2 = byteConv.StringToBytes(cLinea2, "UTF8")
   
    casioVisor.setText( bLinea1, bLinea2, casioVisor.LCD_CONTROL_NORMAL)
   
    casioVisor.close
   
End Sub

The error occurs in line:

nRes = casioVisor.open( casioVisor.DEVICE_MODE_COMMON, casioVisor.DEVICE_HOST_LOCALHOST )

Null Pointer Exception.

Someone be so kind to help me.
A greeting and thanks.
 

barx

Well-Known Member
Licensed User
Longtime User
If you are using AbsObjectWrapper you should setObject and get Object. Not got an example as i am on my phone at moment. But the object is not accessed with 'this'.
 

javiman6969

Member
Licensed User
Longtime User
Can you give an example please?

I do not have much knowledge of JAVA. It's frustrating having to resort to using Java when B4A decided to not have to learn JAVA

Thanks!
 

barx

Well-Known Member
Licensed User
Longtime User
Here is an example that uses AbsObjectWrapper()

B4X:
package barxdroid.pinit;
import com.pinterest.pinit.PinIt;
import com.pinterest.pinit.PinItListener;
import android.net.Uri;
import anywheresoftware.b4a.AbsObjectWrapper;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.Events;
import anywheresoftware.b4a.BA.ShortName;
@ActivityObject
@DependsOn(values={"pinit-sdk"})
@Author("BarxDoid")
@Version(1.0f)
@ShortName("PinIt")
@Events(values={"Complete(Completed as Boolean)", "Start()", "Error(Error as String)"})
public class mPinIt extends AbsObjectWrapper<PinIt> {
    BA mBA;
    String mEventName;
    /**
    * Initializes the PinIt object.
    *
    * EventName - The sub that will handle the events
    *
    * ClientID - To use PinIt you must obtain a ClientID (sometimes known as PartnerID). Enter it here.
    */
    public void Initialize(BA ba, String EventName, String ClientID) {
        Init(ba, EventName, ClientID, false);
    }
    /**
    * Same as Initialize but sets Debug mode to True.
    */
    public void Initilize2(BA ba, String EventName, String ClientID) {
        Init(ba, EventName, ClientID, true);
    }
    private void Init(final BA ba, String EventName, String ClientID, boolean DebugMode) {
        mEventName = EventName.toLowerCase();
        setObject(new PinIt());
        PinIt.setPartnerId(ClientID);
        PinIt.setDebugMode(DebugMode);
        ((PinIt)getObject()).setListener(new PinItListener() {
            @Override
            public void onComplete(boolean completed) {
                if (ba.subExists(mEventName + "_complete")) {
                    ba.raiseEvent(((PinIt)getObject()), mEventName + "_complete", new Object[] {completed});
                }
            }
            @Override
            public void onStart() {
                if (ba.subExists(mEventName + "_start")) {
                    ba.raiseEvent(((PinIt)getObject()), mEventName + "_start", new Object[0]);
                }
            }
            @Override
            public void onException(Exception e) {
                if (ba.subExists(mEventName + "_error")) {
                    ba.raiseEvent(((PinIt)getObject()), mEventName + "_error", new Object[] {e.toString()});
                    BA.Log("PinItButton" + mEventName + "Error:");
                    BA.Log(e.toString());
                }
            }
        });
    }
    /**
    * Sets or Gets the Description related to the Pin
    */
    public void setDescription(String Description) {
        ((PinIt)getObject()).setDescription(Description);
    }
    public String getDescription() {
        return ((PinIt)getObject()).getDescription();
    }
    /**
    * Sets or Gets the ImageUri related to the Pin
    */
    public void setImageUri(Uri uri) {
        ((PinIt)getObject()).setImageUri(uri);
    }
    public Uri getImageUri() {
        return ((PinIt)getObject()).getImageUri();
    }
    /**
    * Sets or Gets the ImageUrl related to the Pin
    */
    public void setImageUrl(String Url) {
        ((PinIt)getObject()).setImageUrl(Url);
    }
    public String getImageUrl() {
        return ((PinIt)getObject()).getImageUrl();
    }
    /**
    * Sets or Get the Url the Pin will link to
    */
    public void setUrl(String Url) {
        ((PinIt)getObject()).setUrl(Url);
    }
    public String getUrl() {
        return ((PinIt)getObject()).getUrl();
    }
    /**
    * Returns the state of Debug Mode
    */
    public boolean isDebugMode() {
        return PinIt.isDebugMode();
    }
    /*
    *Checks whether the device setup meets the requirements to Pin using this library
    */
    public boolean getMeetsRequirements() {
        return PinIt.meetsRequirements();
    }
    /**
    * Reset the PinIt object to a blank state
    */
    public void Reset() {
        ((PinIt)getObject()).reset();
    }
    /**
    * This invokes the native Pinterest Android app to perform a pin action.
    * If Pinterest is not installed or the installed version does not support this feature the user will be sent to Google Play to install or update before continuing.
    */
    public void doPinIt(BA ba) {
        BA.Log("Pinning.");
        ((PinIt)getObject()).doPinIt(ba.context);
    } 
}
 

javiman6969

Member
Licensed User
Longtime User
Thank you very much. Actually I do not know the difference in using AbsObjectWrapper.

Or is my bad English level is confusing or perhaps creating libraries from an sdk.
 

barx

Well-Known Member
Licensed User
Longtime User
your code is setup to use AbsObjectWrapper. It is done so with this code

B4X:
public class LineDisplay extends AbsObjectWrapper<LineDisplay>

So, for example, in your Initialize method instead of

B4X:
this.linedisplay = new LineDisplay();

You should have something like
B4X:
setObject(new LineDisplay());

And then in your methods you should use

B4X:
((LineDisplay)getObject())

So

B4X:
this.linedisplay.setText(arg0, arg1, arg2);

Would become

B4X:
((LineDisplay)getObject()).setText(arg0, arg1, arg2);
 

javiman6969

Member
Licensed User
Longtime User
Helo Barx.
This is my new code for LineDisplay class.

B4X:
package axinfor.casiosdk.com;

import anywheresoftware.b4a.AbsObjectWrapper;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
import jp.co.casio.caios.framework.device.*;


@ShortName("LineDisplay")
@DependsOn(values = { "caiosdevice" })


/*
    LineDisplay
*/

public class LineDisplay extends AbsObjectWrapper<LineDisplay> {

    public static final int DEVICE_MODE_COMMON            = 0x01;
    public static final int DEVICE_MODE_EXCLUSIVE        = 0x02;

    public static final String DEVICE_HOST_LOCALHOST    = "localhost";

    public static final int LCD_CONTROL_NORMAL            = 0x00;
    public static final int LCD_CONTROL_HEIGHT            = 0x01;
    public static final int LCD_CONTROL_REVERSE            = 0x02;

    public static final int LCD_BACKLIGHT_OFF            = 0x00;
    public static final int LCD_BACKLIGHT_GREEN            = 0x01;
    public static final int LCD_BACKLIGHT_WHITE            = 0x02;
    public static final int LCD_BACKLIGHT_EMEGREEN        = 0x03;

    public static final int LCD_DEFAULT_MODE_NORMAL        = 0x00;
    public static final int LCD_DEFAULT_MODE_ANK        = 0x01;
    public static final int LCD_DEFAULT_MODE_JAPAN        = 0x02;
    public static final int LCD_DEFAULT_MODE_CHINA        = 0x03;

    public static final int LCD_DEFAULT_CODE_NORMAL        = 0x00;
    public static final int LCD_DEFAULT_CODE_AMERICA    = 0x01;
    public static final int LCD_DEFAULT_CODE_FRANCE        = 0x02;
    public static final int LCD_DEFAULT_CODE_GERMAN        = 0x03;
    public static final int LCD_DEFAULT_CODE_ENGLAND    = 0x04;
    public static final int LCD_DEFAULT_CODE_DENMARK    = 0x05;
    public static final int LCD_DEFAULT_CODE_SWEDEN        = 0x06;
    public static final int LCD_DEFAULT_CODE_ITALY        = 0x07;
    public static final int LCD_DEFAULT_CODE_SPAIN        = 0x08;
    public static final int LCD_DEFAULT_CODE_JAPAN        = 0x09;
    public static final int LCD_DEFAULT_CODE_NORWAY        = 0x0A;
    public static final int LCD_DEFAULT_CODE_DENMARK2    = 0x0B;

    public static final int LCD_DEFAULT_TABLE_NORMAL    = 0x00;
    public static final int LCD_DEFAULT_TABLE_USA        = 0x01;
    public static final int LCD_DEFAULT_TABLE_JAPAN        = 0x02;
    public static final int LCD_DEFAULT_TABLE_EURO        = 0x03;
    public static final int LCD_DEFAULT_TABLE_ARABIC    = 0x03;

    public static final int LCD_SLEEP_OFF                = 0x01;
    public static final int LCD_SLEEP_ON                = 0x01;


    private BA ba;
    private String eventName;
    private LineDisplay linedisplay;
   
    public void Initialize(final BA ba) {
   
        BA.Log("casioSDK");
       
   
        this.ba = ba;
        linedisplay = new LineDisplay();       
        setObject(linedisplay);

                       
        if ( linedisplay == null ) {
            BA.Log("casioSDK error");           
        } else {
            BA.Log("casioSDK ok");   
        }

    }

    public LineDisplay getLineDisplay() {
        return ((LineDisplay)getObject()).linedisplay;       
    }

    public void setLineDisplay(LineDisplay linedisplay) {       
        ((LineDisplay)getObject()).linedisplay = linedisplay;
    }

    /**
        Opens a device and controls it exclusively       
        int open(int mode, String hostname)               
    */   
    public int open(int arg0, String arg1) {       
        return ((LineDisplay)getObject()).open(arg0, arg1);
    }

    /**
        Closes a device.                                   
        int close(void)                                   
    */
    public int close() {
        return ((LineDisplay)getObject()).close();
    }

    /**
        Clears line display indication.                               
        int clear(void)                           
    */
    public int clear() {
        return ((LineDisplay)getObject()).clear();       
    }

    /**
        Enables line display indication.
        When assigned character number is less than the display area, spaces are filled in the remaining area.
        If assigned character number exceeds display area, the exceeded characters are cancelled.                           
        int setText(byte[] line1, byte[] line2, int control)                           
        Byte[] line1: Character string of the first display line: 20 bytes.
        Byte[] line2: Character string of the second display line: 20 bytes.
        int control: Assigns display control (multiple assignment available).
    */
    public void setText(byte[] arg0, byte[] arg1, int arg2) {
        ((LineDisplay)getObject()).setText(arg0, arg1, arg2);       
    }

    /**
        Assigns backlight color.
        int setBacklight(int backlightStatus)
        Sets contrast value:  0 to 255
    */   
    public void setBacklight(int arg0) {
        ((LineDisplay)getObject()).setBacklight(arg0);
    }

    /**
        Assigns contrast value.
        int setContrast(int contrastStatus)
       
    */       
    public void setContrast(int arg0) {
        ((LineDisplay)getObject()).setContrast(arg0);
    }

    /**
        Registers the initial value at power recovery.
        setPowerDefault(int mode, int code, int table)
       
    */
    public void setPowerDefault(int arg0, int arg1, int arg2) {
        ((LineDisplay)getObject()).setPowerDefault(arg0, arg1, arg2);
    }

    /**
        Sleep control. Turns the backlight on or off. The ON status depends on the set status of the backlight.
        setSleep(int mode)
    */
    public void setSleep(int arg0) {
        ((LineDisplay)getObject()).setSleep(arg0);
    }

    /**
        Sets character code type, international character, and character code table by discriminating the locale.
        setCurrentCodepage()
    */
    public void setCurrentCodepage() {
        ((LineDisplay)getObject()).setCurrentCodepage();   
    }

}


But the result now is:

java.lang.RuntimeException: Object should first be initialized (LineDisplay)

in the sane line of code:

nRes = casioVisor.open( casioVisor.DEVICE_MODE_COMMON, casioVisor.DEVICE_HOST_LOCALHOST )

Thanks!!!
 

javiman6969

Member
Licensed User
Longtime User
I do not know if it is not properly referencing the library (SDK) caiosdevice.jar
But I still have the problem ...
Can anyone help me, please?
thanks
 

javiman6969

Member
Licensed User
Longtime User
Hi.

Yes!
See the next code.

B4X:
Sub ButtonVisor_Click

    Dim casioVisor As LineDisplay
   
    Dim nRes As Long
    Dim cLinea1, cLinea2 As String
    Dim byteConv As ByteConverter
    Dim bLinea1(20) As Byte
    Dim bLinea2(20) As Byte
   
   
    casioVisor.Initialize
           
    nRes = casioVisor.open( 1, "localhost" )
   
    txtLog.Text = txtLog.Text & nRes & Chr(10) & Chr(13)
   
    casioVisor.clear
   
    cLinea1 = "hello"
    cLinea2 = "world"
           
    bLinea1 = byteConv.StringToBytes(cLinea1, "UTF8")
    bLinea2 = byteConv.StringToBytes(cLinea2, "UTF8")
   
    casioVisor.setText( bLinea1, bLinea2, casioVisor.LCD_CONTROL_NORMAL)
   
    casioVisor.close
   
End Sub


In the java class. I change the method "open".
B4X:
public int open(int arg0, String arg1) {       
        //return linedisplay.open(arg0, arg1);       
        return 1000;
}

And run perfectly!!! Return the number 1000;
But when I invoke the original "open" method of the SDK returns the error I commented.

Any idea?
thanks
 

javiman6969

Member
Licensed User
Longtime User
Hi.
This is the code...

B4X:
package axinfor.casiosdk.com;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
import anywheresoftware.b4a.AbsObjectWrapper;

import jp.co.casio.caios.framework.device.LineDisplay;

@ShortName("csLineDisplay")
@DependsOn( values = { "caiosdevice" } )
@Author("aXinfor")
@Version(0.17f)


/*
    LineDisplay
*/

public class csLineDisplay extends AbsObjectWrapper<LineDisplay> {

    public static final int DEVICE_MODE_COMMON            = 0x01;
    public static final int DEVICE_MODE_EXCLUSIVE        = 0x02;

    public static final String DEVICE_HOST_LOCALHOST    = "localhost";

    public static final int LCD_CONTROL_NORMAL            = 0x00;
    public static final int LCD_CONTROL_HEIGHT            = 0x01;
    public static final int LCD_CONTROL_REVERSE            = 0x02;

    public static final int LCD_BACKLIGHT_OFF            = 0x00;
    public static final int LCD_BACKLIGHT_GREEN            = 0x01;
    public static final int LCD_BACKLIGHT_WHITE            = 0x02;
    public static final int LCD_BACKLIGHT_EMEGREEN        = 0x03;

    public static final int LCD_DEFAULT_MODE_NORMAL        = 0x00;
    public static final int LCD_DEFAULT_MODE_ANK        = 0x01;
    public static final int LCD_DEFAULT_MODE_JAPAN        = 0x02;
    public static final int LCD_DEFAULT_MODE_CHINA        = 0x03;

    public static final int LCD_DEFAULT_CODE_NORMAL        = 0x00;
    public static final int LCD_DEFAULT_CODE_AMERICA    = 0x01;
    public static final int LCD_DEFAULT_CODE_FRANCE        = 0x02;
    public static final int LCD_DEFAULT_CODE_GERMAN        = 0x03;
    public static final int LCD_DEFAULT_CODE_ENGLAND    = 0x04;
    public static final int LCD_DEFAULT_CODE_DENMARK    = 0x05;
    public static final int LCD_DEFAULT_CODE_SWEDEN        = 0x06;
    public static final int LCD_DEFAULT_CODE_ITALY        = 0x07;
    public static final int LCD_DEFAULT_CODE_SPAIN        = 0x08;
    public static final int LCD_DEFAULT_CODE_JAPAN        = 0x09;
    public static final int LCD_DEFAULT_CODE_NORWAY        = 0x0A;
    public static final int LCD_DEFAULT_CODE_DENMARK2    = 0x0B;

    public static final int LCD_DEFAULT_TABLE_NORMAL    = 0x00;
    public static final int LCD_DEFAULT_TABLE_USA        = 0x01;
    public static final int LCD_DEFAULT_TABLE_JAPAN        = 0x02;
    public static final int LCD_DEFAULT_TABLE_EURO        = 0x03;
    public static final int LCD_DEFAULT_TABLE_ARABIC    = 0x03;

    public static final int LCD_SLEEP_OFF                = 0x01;
    public static final int LCD_SLEEP_ON                = 0x01;


    private BA myba;
    private String eventName;
    private static boolean IsInit = false;
   
    private csLineDisplay linedisplay;
       
   
   
    /**
        Initialize
    */           
    public void Initialize(final BA ba) {
           
        //BA.Log("casioSDK");
        myba = ba;

        try {           
            setObject( new LineDisplay() );           
            IsInit = true;               
        } catch (RuntimeException runtimeException) {
            IsInit = false;           
        }

    }
       
    /**
        IsInitialize
    */               
    public boolean IsInitialized(){
        return IsInit;
    }

   
    /**
        Opens a device and controls it exclusively       
        int open(int mode, String hostname)               
    */   
    public int open(int arg0, String arg1) {       
        return getObject().open(arg0, arg1);       
    }

    /**
        Closes a device.                                   
        int close(void)                                   
    */
    public int close() {
        return getObject().close();
    }

    /**
        Clears line display indication.                               
        int clear(void)                           
    */
    public int clear() {
        return getObject().clear();       
    }

    /**
        Enables line display indication.
        When assigned character number is less than the display area, spaces are filled in the remaining area.
        If assigned character number exceeds display area, the exceeded characters are cancelled.                           
        int setText(byte[] line1, byte[] line2, int control)                           
        Byte[] line1: Character string of the first display line: 20 bytes.
        Byte[] line2: Character string of the second display line: 20 bytes.
        int control: Assigns display control (multiple assignment available).
    */
    public void setText(byte[] arg0, byte[] arg1, int arg2) {
        getObject().setText(arg0, arg1, arg2);       
    }

    /**
        Assigns backlight color.
        int setBacklight(int backlightStatus)
       
    */   
    public void setBacklight(int arg0) {
        getObject().setBacklight(arg0);
    }

    /**
        Assigns contrast value.
        int setContrast(int contrastStatus)
        Sets contrast value:  0 to 255
    */       
    public void setContrast(int arg0) {
        getObject().setContrast(arg0);
    }

    /**
        Registers the initial value at power recovery.
        setPowerDefault(int mode, int code, int table)
       
    */
    public void setPowerDefault(int arg0, int arg1, int arg2) {
        getObject().setPowerDefault(arg0, arg1, arg2);
    }

    /**
        Sleep control. Turns the backlight on or off. The ON status depends on the set status of the backlight.
        setSleep(int mode)
    */
    public void setSleep(int arg0) {
        getObject().setSleep(arg0);
    }

    /**
        Sets character code type, international character, and character code table by discriminating the locale.
        setCurrentCodepage()
    */
    public void setCurrentCodepage() {
        getObject().setCurrentCodepage();   
    }

}
 
Top