| | |
| | | |
| | | import android.util.Log; |
| | | |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.anyun.im_lib.util.ByteUtil; |
| | | |
| | | import safeluck.drive.evaluation.util.Utils; |
| | | |
| | | /** |
| | | * MyApplication2 |
| | |
| | | pos+=messageBodyBytes.length; |
| | | |
| | | //校验码 |
| | | // TODO: 2019/12/18 校验码需要计算 还有转义需要处理 |
| | | checkCode = Utils.calCheckCode(ByteUtil.subArray(desBytes,1,pos-1)); |
| | | desBytes[pos] = checkCode; |
| | | pos++; |
| | | //末尾结束标识位 |
| | | desBytes[pos] = MESSAGE_TAIL; |
| | | |
| | | Log.i(TAG, "包长度="+(pos+1)); |
| | | Log.i(TAG, "包内容: "+ByteUtil.byte2HexStr(desBytes)); |
| | | |
| | | return desBytes; |
| | | MyLog.i(TAG, "原始包长度="+(pos+1)); |
| | | MyLog.i(TAG, "原始包内容: "+ByteUtil.byte2HexStr(desBytes)); |
| | | byte[] tranferbytes = Utils.transferMeaning(desBytes); |
| | | MyLog.i(TAG,"转义后的包内容:"+ByteUtil.byte2HexStr(tranferbytes)); |
| | | return tranferbytes; |
| | | } |
| | | |
| | | } |