package com.hh.lib_social_security_card;

import android.content.Context;

import com.hh.lib_dx_base_multi.DxInitListener;
import com.hh.lib_dx_base_multi.SimpleDxInitListener;
import com.hh.lib_dx_base_multi.bean.sscard.SSCardConfig;
import com.hh.lib_dx_base_multi.listener.sscard.SSCardResultListener;

/**
 * @Description:
 * @author: Xia WeiHao
 * @date: 2024/6/24
 */
public abstract class BaseSSCardReader {

    private int mCardReadState=0; //0 设备未连接  1 已加载读卡器 2 插入USB设备 3  拔出USB设备

    SSCardConfig config;

    public SSCardResultListener listener;

    public BaseSSCardReader() {
    }

    public BaseSSCardReader(SSCardConfig config, SSCardResultListener listener) {
        this.config = config;
        this.listener = listener;
    }



    public void setConfig(SSCardConfig config) {
        this.config = config;
    }

    public SSCardConfig getConfig() {
        return config;
    }



    public int getmCardReadState() {
        return mCardReadState;
    }

    public void setmCardReadState(int mCardReadState) {
        this.mCardReadState = mCardReadState;
    }

    public SSCardResultListener getListener() {
        return listener;
    }

    public void setLoopListener(SSCardResultListener listener) {
        this.listener = listener;
    }

    public abstract void initSSCard(SimpleDxInitListener listener);

    public abstract void setOnceLinstenr(SSCardResultListener onceLinstenr);

    public abstract void startRead();
    public abstract void  stopRead();

    public abstract void release(Context context);
}
