package com.dev.ica_600kw;
|
|
import java.nio.ByteBuffer;
|
import java.nio.ByteOrder;
|
|
import com.dev.bts.data.FBS9100_ComBase;
|
|
public class IAC_Cmd {
|
public static final int Byte_Len = 18; //»ù±¾Êý¾Ý³¤¶È
|
|
public int addr; //µØÖ·
|
public int[] synCode = new int[] {0xAA,0xAA,0xAA};
|
public int length; //·¢ËÍ×Ö½Ú³¤¶È
|
public int cmd; //²Ù×÷Ö¸Áî
|
public int result; //²Ù×÷·µ»Ø
|
public int testType; //²âÊÔÀàÐÍ
|
public int state; //״̬
|
public int alarm; //Í£Ö¹Ìõ¼þ
|
|
public int[] back = new int[4]; //Ô¤Áô
|
public int crc; //crc16
|
|
public static ByteBuffer createControlByteBuffer(int control) {
|
ByteBuffer buffer = ByteBuffer.allocate(2);
|
buffer.order(ByteOrder.BIG_ENDIAN);
|
buffer.position(0);
|
|
buffer.putShort(FBS9100_ComBase.changeIntToShort(control));
|
|
buffer.flip();
|
return buffer;
|
}
|
|
|
public static void main(String[] args) {
|
// ByteBuffer bf = ByteBuffer.allocate(2);
|
// bf.putShort((short)24);
|
// bf.flip();
|
// ByteBuffer bf1 = ByteBuffer.allocate(bf.capacity());
|
// bf1.put(bf);
|
//
|
// bf.position(0);
|
// bf1.position(0);
|
// System.out.println(bf.getShort());
|
// System.out.println(bf1.getShort());
|
|
float ff = 1.0f;
|
int d = 1;
|
System.out.println((ff==d));
|
}
|
}
|