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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package com.hdl.sdk.hdl_core.HDLAppliances.HDLLight;
 
import com.hdl.sdk.hdl_core.HDLDeviceManger.Bean.AppliancesInfo;
 
/**
 * Created by JLChen on 2020/10/20
 * ///1 逻辑回路号
 * ///2 整体亮度
 * ///3 颜色号 固定为 254
 * ///4 运行时间 高位
 * ///5 运行时间 低位
 * ///6 逻辑灯类型 1-5    //1单路 2CCT 3RGB 4RGBW 5RGBWY
 * ///7 逻辑回路 通道1的值 //RGB最大值是255 其它类为最大为100
 * ///8 逻辑回路 通道2的值 //RGB最大值是255 其它类为最大为100
 * ///9 逻辑回路 通道3的值 //RGB最大值是255 其它类为最大为100
 * ///10 逻辑回路 通道4的值 //RGB最大值是255 其它类为最大为100
 * ///11 逻辑回路 通道5的值 //RGB最大值是255 其它类为最大为100
 *
 * (7~11位数据)
 * 或CCT时:一般2000-7000K(高位在前、低位在后) 2BYTE+3BYTE(无效)   (5BYTE)
 * 或RGB时:R、G、B(0-255),        3BYTE+2BYTE(无效)            (5BYTE)
 */
public class RGBBackInfo {
 
    private AppliancesInfo appliancesInfo;
    private int brightness; //亮度
    private int lightType; //1-5//1单路 2CCT 3RGB 4RGBW 5RGBWY
    private int rStatus;    //R
    private int gStatus;    //G
    private int bStatus;    //B
    private byte[] curState;//控制回馈信息
 
    public RGBBackInfo() {
 
    }
 
    /**
     * GeothermalBackInfo
     *
     * @param mAppliancesInfo
     */
    public RGBBackInfo(AppliancesInfo mAppliancesInfo) {
        this.appliancesInfo = mAppliancesInfo;
        this.curState = mAppliancesInfo.getFeedbackState();
 
        if (this.curState == null) return;
 
        if (this.curState.length >= 9) {
            this.brightness = this.curState[1] & 0xFF;
            this.lightType = this.curState[5] & 0xFF;
            this.rStatus = this.curState[6] & 0xFF;
            this.gStatus = this.curState[7] & 0xFF;
            this.bStatus = this.curState[8] & 0xFF;
        }
    }
 
    public AppliancesInfo getAppliancesInfo() {
        return appliancesInfo;
    }
 
    public void setAppliancesInfo(AppliancesInfo appliancesInfo) {
        this.appliancesInfo = appliancesInfo;
    }
 
    public int getBrightness() {
        return brightness;
    }
 
    public void setBrightness(int brightness) {
        this.brightness = brightness;
    }
 
    public int getLightType() {
        return lightType;
    }
 
    public void setLightType(int lightType) {
        this.lightType = lightType;
    }
 
    public int getrStatus() {
        return rStatus;
    }
 
    public void setrStatus(int rStatus) {
        this.rStatus = rStatus;
    }
 
    public int getgStatus() {
        return gStatus;
    }
 
    public void setgStatus(int gStatus) {
        this.gStatus = gStatus;
    }
 
    public int getbStatus() {
        return bStatus;
    }
 
    public void setbStatus(int bStatus) {
        this.bStatus = bStatus;
    }
 
    public byte[] getCurState() {
        return curState;
    }
 
    public void setCurState(byte[] curState) {
        this.curState = curState;
    }
 
}