package safeluck.drive.evaluation.platformMessage; import android.text.TextUtils; import com.anyun.im_lib.util.ByteUtil; /** * 获取学员信息消息(发送身份证ID上去给平台) * MyApplication2 * Created by lzw on 2019/12/19. 18:26:35 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class GainStuMessage extends DriveExamProtocol { private static final int BODY_LENGTH = 17; private String id;//卡ID private short examaCourse = 0; public GainStuMessage(short msg_id) { super(msg_id); } @Override protected short msgBodyLength() { return BODY_LENGTH; } @Override protected byte[] createMessageBody() { int pos = 0; byte[] messageBody = new byte[BODY_LENGTH]; byte[] idBytes = !TextUtils.isEmpty(id)?id.getBytes():"".getBytes(); System.arraycopy(idBytes,0,messageBody,pos,idBytes.length); pos+= 16; byte[] examBytes = ByteUtil.shortGetByte(examaCourse); System.arraycopy(examBytes,0,messageBody,pos,examBytes.length); return messageBody; } public String getId() { return id; } public void setId(String id) { this.id = id; } public short getExamaCourse() { return examaCourse; } public void setExamaCourse(short examaCourse) { this.examaCourse = examaCourse; } }