| package com.dayu.qiheonlinelibrary.card; | 
|   | 
| import com.dayu.baselibrary.tools.HexUtil; | 
| import com.dayu.qiheonlinelibrary.dao.QHOnLineAppDatabase; | 
| import com.dayu.qiheonlinelibrary.utils.CardCommon; | 
|   | 
| import java.io.Serializable; | 
|   | 
| /** | 
|  * Created by Android Studio. | 
|  * author: zuo | 
|  * Date: 2023-11-13 | 
|  * Time: 18:11 | 
|  * 备注:配置设备注册信息卡 | 
|  * <p> | 
|  * 为方便现场更换设备时重新注册的问题,配置设备信息卡,首先刷卡,把原设备的注册号和ID号读到卡内,同时卡状态则00修改为FF,再新设备上刷此卡时,注册号和ID号自动写到控制器内,可以直接刷卡使用 | 
|  */ | 
| public class ConfigureDeviceRegistrationCrad extends BaseCard implements Serializable { | 
|     public String cardType = CardCommon.CONFIGURATION_CARD_TYPE;//卡类型 | 
|     public String cardData = "A0B1C289";//标识码 | 
|   | 
|     public String getCardData() { | 
|         return cardData; | 
|     } | 
|   | 
|     public byte[] toByte(QHOnLineAppDatabase QHOnLineAppDatabase) { | 
|         setCardData(QHOnLineAppDatabase, cardType); | 
|         Zero zero = new Zero(); | 
|         return zero.toByte(); | 
|     } | 
|   | 
|     public class Zero  { | 
|         public byte[] toByte() { | 
|             byte[] data = new byte[16]; | 
|             data[0] = HexUtil.hexToByte(cardType); | 
|             byte[] cardDatas = HexUtil.hexToByteArray(cardData); | 
|                 System.arraycopy(cardDatas, 0, data, 1, cardDatas.length); | 
|             data[15] = getByteSum(data); | 
|             return data; | 
|         } | 
|   | 
|     } | 
| } |