| | |
| | | this.msg_id = msg_id; |
| | | } |
| | | |
| | | protected byte[] toBytes(){ |
| | | public byte[] toBytes(){ |
| | | byte[] desBytes = new byte[1+16+2+1+1]; |
| | | int pos = 0; |
| | | |
| | |
| | | System.arraycopy(msg_pro_bytes,0,desBytes,pos,msg_pro_bytes.length); |
| | | pos+=msg_pro_bytes.length; |
| | | //终端手机号 |
| | | byte[] phoneBytes = ByteUtil.str2Bcd("12345678"); |
| | | byte[] phoneBytes = ByteUtil.str2Bcd("1234567890121518"); |
| | | System.arraycopy(phoneBytes,0,desBytes,pos,phoneBytes.length); |
| | | pos+=phoneBytes.length; |
| | | //消息流水号 |
| | |
| | | //末尾结束标识位 |
| | | desBytes[pos] = MESSAGE_TAIL; |
| | | |
| | | Log.i(TAG, "包长度="+pos); |
| | | Log.i(TAG, "包长度="+(pos+1)); |
| | | Log.i(TAG, "包内容: "+ByteUtil.byte2HexStr(desBytes)); |
| | | return desBytes; |
| | | } |