package com.hdl.sdk.ttl.HDLAppliances.HDLCurtain.Parser;
|
|
/**
|
* Created by Tommy on 2017/7/21.
|
*/
|
|
public class CurtainCtrlParser {
|
public static final int curtainPause = -1;//0
|
public static final int curtainOn = -2;//1
|
public static final int curtainOff = -3;//2
|
|
public static final int TYPE_STATE_PAUSE = 0;
|
public static final int TYPE_STATE_OPEN = 1;
|
public static final int TYPE_STATE_CLOSE = 2;
|
|
// //这个方法只处理了窗帘号小于17的情况
|
public static byte[] getCurtainAddByte(int curtainNum, int state){
|
byte[] addBytes;
|
int newState = state;
|
switch (state){
|
case curtainPause:
|
newState = 0;
|
break;
|
case curtainOn:
|
newState = 1;
|
break;
|
case curtainOff:
|
newState = 2;
|
break;
|
default:
|
break;
|
}
|
addBytes = new byte[]{(byte) curtainNum, (byte) newState};
|
return addBytes;
|
}
|
|
// //这个方法只处理了窗帘号小于17的情况
|
// public static byte[] getCurtainAddByte(int curtainNum, int state){
|
// return new byte[]{(byte) curtainNum, (byte) state};
|
// }
|
|
}
|