package com.hh.lib_m1_card.config;

import android.text.TextUtils;

/**
 * Description: $
 *
 * @author xwh
 * time 2024/11/5
 **/
public class M1CardConfig {
    private int sector = 0 ; //读取的扇区  0-15
    private String block="";  // 读取的块，可以多块"1,2,3"
    private String secretKey=""; //密钥
    private byte keyMode=0x60; //默认keyA, 0x61 KeyB


    public int getSector() {
        return sector;
    }

    public void setSector(int sector) {
        this.sector = sector;
    }

    public String getBlock() {
        return block;
    }

    public void setBlock(String block) {
        this.block = block;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public byte getKeyMode() {
        return keyMode;
    }

    public void setKeyMode(byte keyMode) {
        this.keyMode = keyMode;
    }

    public String[] getBlockList() {
        String[] list;
        if(TextUtils.isEmpty(block)){
            return new String[0];
        }
        list= block.split(",");
        if(list==null){
            return new String[0];
        }
        return list;
    }

    @Override
    public String toString() {
        return "M1CardConfig{" +
                "sector=" + sector +
                ", block='" + block + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", keyMode=" + keyMode +
                '}';
    }
}
