package com.dev.ntm.cmd;
|
|
import java.io.UnsupportedEncodingException;
|
import java.nio.ByteBuffer;
|
import java.nio.ByteOrder;
|
|
public class NTM_HeartBeat
|
{
|
public NTM_Cmd NTM_Cmd = new NTM_Cmd();
|
public String inf = "";
|
public int CRC;
|
|
public void putByteBuffer(final ByteBuffer bf) {
|
byte[] inf_b = new byte[bf.limit()];
|
bf.get(inf_b);
|
try {
|
inf = new String(inf_b, "utf-8");
|
} catch (UnsupportedEncodingException e) {
|
// TODO Auto-generated catch block
|
e.printStackTrace();
|
}
|
}
|
|
public ByteBuffer getByteBuffer(byte[] inf_b) {
|
ByteBuffer bytebuffer = ByteBuffer.allocate(inf_b.length);
|
bytebuffer.order(ByteOrder.LITTLE_ENDIAN);
|
bytebuffer.put(inf_b);
|
return bytebuffer;
|
}
|
}
|
/***************************************************************************************
|
****************************** end of file (NTM_HeartBeat) *****************************
|
***************************************************************************************/
|