?? portstatus.java
字號:
/*
* $Id: PortStatus.java,v 1.1 2003/11/25 11:42:24 epr Exp $
*/
package org.jnode.driver.usb.hub;
import org.jnode.driver.usb.USBPacket;
import org.jnode.util.NumberUtils;
/**
* @author Ewout Prangsma (epr@users.sourceforge.net)
*/
public class PortStatus extends USBPacket {
/**
* Initialize this instance
*/
public PortStatus() {
super(4);
}
/**
* Gets the wPortStatus field.
*/
public int getPortStatus() {
return getShort(0);
}
/**
* Are specific bits of the port status set.
* @param mask
* @return True if all of the mask bits have been set, false otherwise.
*/
public boolean getPortStatusBits(int mask) {
return ((getShort(0) & mask) == mask);
}
/**
* Gets the wPortChange field.
*/
public int getPortChange() {
return getShort(2);
}
/**
* Are specific bits of the port change set.
* @param mask
* @return True if all of the mask bits have been set, false otherwise.
*/
public boolean getPortChangeBits(int mask) {
return ((getShort(2) & mask) == mask);
}
public String toString() {
return "ST:" + NumberUtils.hex(getPortStatus(), 4) + ", CH:" + NumberUtils.hex(getPortChange(), 4);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -