package com.joe.print.mvp.print;

import android.content.Context;

import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.sunmi.peripheral.printer.InnerPrinterCallback;
import com.sunmi.peripheral.printer.InnerPrinterException;
import com.sunmi.peripheral.printer.InnerPrinterManager;

/**
 * Created by Wyh on 2020/2/10.
 */
public class SunMiPrint {

    public static boolean bindService(Context context, InnerPrinterCallback callback) {
        try {
            return InnerPrinterManager.getInstance().bindService(context, callback);
        } catch (InnerPrinterException e) {
            e.printStackTrace();
            ToastUtils.show(context, "連接失敗，錯誤信息：" + e.getMessage());
            return false;
        }
    }
}
