package com.epson.mobilephone.common.maintain;

import android.content.Context;
import com.epson.mobilephone.common.EpLog;
import com.epson.mobilephone.common.escpr.EscprLib;

public class MaintainPrinter {
    protected EscprLib mEscprLib = EscprLib.getInstance();
    protected MaintainPrinterInfo mPrinterInfor = new MaintainPrinterInfo();
    protected int mSearchPos = 0;

    public void setMSearchPos(int i) {
        mSearchPos = i;
    }

    public EscprLib getMEscpLib() {
        return mEscprLib;
    }

    public MaintainPrinterInfo getMPrinterInfor() {
        return mPrinterInfor;
    }

    public int getMSearchPos() {
        return mSearchPos;
    }

    public int doInitDriver(Context context, int i) {
        String path = context.getExternalFilesDir((String) null).getPath();
        EpLog.m78i("MaintainPrinter", "**********doInitDriver************:" + path);
        return mEscprLib.init_driver(context, path);
    }

    public int doReleaseDriver() {
        return mEscprLib.release_driver();
    }

    public int doFindPrinter(int i, int i2) {
        EpLog.m78i("MaintainPrinter", "**********Call do find printer************");
        return mEscprLib.search_printer((String) null);
    }

    public int doGetLang() {
        return mEscprLib.get_lang();
    }

    public String doGetIp() {
        return mEscprLib.epsWrapperGetIp();
    }

    public int doCancelFindPrinter() {
        return mEscprLib.cancel_search_printer();
    }

    public int doSetPrinter() {
        return mEscprLib.set_printer(mSearchPos);
    }

    public int doGetStatus() {
        return mEscprLib.epsWrapperGetStatus(mPrinterInfor.getMStatus());
    }

    public int doDoMainteCmd(int i) {
        EpLog.m78i("MaintainPrinter", "**********doDoMainteCmd************");
        return mEscprLib.epsWrapperDoMainteCmd(i);
    }

    public int doGetSupplyInfo() {
        return mEscprLib.epsWrapperGetSupplyInfo(mPrinterInfor.getMSupplyInfo());
    }

    public int doGetSupplyInfoEx() {
        return mEscprLib.epsWrapperGetSupplyInfo(mPrinterInfor.getMSupplyInfo());
    }

    public int doProbePrinter(int i, int i2, String str) {
        EpLog.m78i("MaintainPrinter", "doProbePrinter");
        return mEscprLib.search_printer(str);
    }
}
