本文整理汇总了Java中com.rapplogic.xbee.util.ByteUtils.getBit方法的典型用法代码示例。如果您正苦于以下问题:Java ByteUtils.getBit方法的具体用法?Java ByteUtils.getBit怎么用?Java ByteUtils.getBit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapplogic.xbee.util.ByteUtils
的用法示例。
在下文中一共展示了ByteUtils.getBit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDigitalEnabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isDigitalEnabled(int pin) {
if (pin >=0 && pin <= 7) {
return ByteUtils.getBit(this.digitalChannelMaskLsb, pin + 1);
} else if (pin >=10 && pin <= 12) {
return ByteUtils.getBit(this.digitalChannelMaskMsb, pin - 7);
} else {
throw new IllegalArgumentException("Unsupported pin: " + pin);
}
}
示例2: isAnalogEnabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isAnalogEnabled(int pin) {
if (pin >=0 && pin <= 3) {
return ByteUtils.getBit(this.analogChannelMask, pin + 1);
} else {
throw new IllegalArgumentException("Unsupported pin: " + pin);
}
}
示例3: isDigitalOn
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
/**
* If digital I/O line (DIO0) is enabled: returns true if digital 0 is HIGH (ON); false if it is LOW (OFF).
* If digital I/O line is not enabled this method returns null as it has no value.
* <p/>
* Important: the pin number corresponds to the logical pin (e.g. D4), not the physical pin number.
* <p/>
* Digital I/O pins seem to report high when open circuit (unconnected)
*
* @return
*/
public Boolean isDigitalOn(int pin) {
if (this.isDigitalEnabled(pin)) {
if (pin >=0 && pin <= 7) {
return ByteUtils.getBit(dioLsb, pin + 1);
} else if (pin >=10 && pin <= 12) {
return ByteUtils.getBit(dioMsb, pin - 7);
}
}
return null;
}
示例4: isDigitalOn
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
/**
* Returns the digital value of the specified pin.
* Returns null if pin is not configured for Digital input
*
* @return
*/
public Boolean isDigitalOn(int pin) {
if (!parent.isDigitalEnabled(pin)) {
return null;
}
if (pin >= 0 && pin <= 7) {
return ByteUtils.getBit(dioLsb, pin + 1);
} else {
// pin 8
return ByteUtils.getBit(dioMsb, 1);
}
}
示例5: isDigitalEnabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isDigitalEnabled(int pin) {
if (pin >= 0 && pin <= 7) {
return ByteUtils.getBit(channelIndicator2, pin + 1);
} else if (pin == 8) {
return ByteUtils.getBit(channelIndicator1, 1);
} else {
throw new IllegalArgumentException("Unsupported pin: " + pin);
}
}
示例6: isAnalogEnabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isAnalogEnabled(int pin) {
if (pin >= 0 && pin <= 5) {
return ByteUtils.getBit(channelIndicator1, pin + 2);
} else {
throw new IllegalArgumentException("Unsupported pin: " + pin);
}
}
示例7: isAddressBroadcast
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isAddressBroadcast() {
return ByteUtils.getBit(options, 2);
}
示例8: isPanBroadcast
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isPanBroadcast() {
return ByteUtils.getBit(options, 3);
}
示例9: isD0Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isD0Enabled() {
return ByteUtils.getBit(channelIndicator2, 1);
}
示例10: isA2Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isA2Enabled() {
return ByteUtils.getBit(channelIndicator1, 4);
}
示例11: isD2Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isD2Enabled() {
return ByteUtils.getBit(channelIndicator2, 3);
}
示例12: isA4Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isA4Enabled() {
return ByteUtils.getBit(channelIndicator1, 6);
}
示例13: isD4Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isD4Enabled() {
return ByteUtils.getBit(channelIndicator2, 5);
}
示例14: isD5Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isD5Enabled() {
return ByteUtils.getBit(channelIndicator2, 6);
}
示例15: isD6Enabled
import com.rapplogic.xbee.util.ByteUtils; //导入方法依赖的package包/类
public boolean isD6Enabled() {
return ByteUtils.getBit(channelIndicator2, 7);
}