DELL
2025-04-28 e6eb7fb0af366e370f125668d62e89eb0004f517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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));
    }
}