| 限定符和类型 | 字段和说明 |
|---|---|
static boolean |
CRC_SWITCH_DEFAULT_VALUE |
static int |
CRC_SWITCH_INDEX |
| 构造器和说明 |
|---|
ProtocolSwitch() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ProtocolSwitch |
create(int value)
create an instance of
ProtocolSwitch according to byte value |
static ProtocolSwitch |
create(int[] index)
create an instance of
ProtocolSwitch according to switch index |
boolean |
isOn(int index)
check switch whether on
|
static boolean |
isOn(int switchIndex,
int value)
check switch status whether on according to specified value
|
void |
setBs(BitSet bs)
Setter method for property bs.
|
static BitSet |
toBitSet(int value)
from byte to bit set
|
byte |
toByte()
generate byte value according to the bit set in ProtocolSwitchStatus
|
static byte |
toByte(BitSet bs)
from bit set to byte
|
void |
turnOff(int index)
api for user to turn off a feature
|
void |
turnOn(int index)
api for user to turn on a feature
|
public static final int CRC_SWITCH_INDEX
public static final boolean CRC_SWITCH_DEFAULT_VALUE
public void turnOn(int index)
Switchpublic void turnOff(int index)
Switchpublic boolean isOn(int index)
Switchpublic byte toByte()
public static boolean isOn(int switchIndex,
int value)
switchIndex - value - public static ProtocolSwitch create(int value)
ProtocolSwitch according to byte valuevalue - public static ProtocolSwitch create(int[] index)
ProtocolSwitch according to switch indexindex - the switch index which you want to set truepublic static byte toByte(BitSet bs)
bs - public static BitSet toBitSet(int value)
value - public void setBs(BitSet bs)
bs - value to be assigned to property bsCopyright © 2021. All rights reserved.