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; public static byte[] getCurtainAddByte(int curtainNum, int state, int type){ 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, (byte) type}; return addBytes; } }