⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbhubapi.java

📁 纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统
💻 JAVA
字号:
/*
 * $Id: USBHubAPI.java,v 1.1 2003/11/25 11:41:20 epr Exp $
 */
package org.jnode.driver.usb;

import org.jnode.driver.DeviceAPI;

/**
 * Generic interface for controlling an USB HUB.
 * 
 * @author Ewout Prangsma (epr@users.sourceforge.net)
 */
public interface USBHubAPI extends DeviceAPI {

	/**
	 * Gets the bus to which this HUB is connected.
	 */
	public USBBus getUSBBus();
	
	/**
	 * Gets the device for the given port.
	 * @param port
	 */
	public USBDevice getDevice(int port);
	
	/**
	 * Set the device for the given port.
	 * @param dev
	 * @param port
	 */
	public void setDevice(USBDevice dev, int port);
	
	/**
	 * Unset the device for the given port.
	 * @param port
	 */
	public void unsetDevice(int port);
	
	/**
	 * Gets the number of downstream ports connected to this HUB. 
	 */
	public int getNumPorts();
	
	/**
	 * Is the given port enabled.
	 */
	public boolean isPortEnabled(int port)
	throws USBException;
	
	/**
	 * Enable/disable a given port
	 * @param enabled
	 */
	public void setPortEnabled(int port, boolean enabled)
	throws USBException;
	
	/**
	 * Reset a given port
	 */
	public void resetPort(int port)
	throws USBException;
	
	/**
	 * Gets the port connection status.
	 * @return True if a device is connected, false otherwise
	 */
	public boolean isPortConnected(int port)
	throws USBException;
	
	/**
	 * Has the port connection status changed.
	 */
	public boolean isPortConnectionStatusChanged(int port)
	throws USBException;
	
	/**
	 * Clear the port connection status changed flag.
	 */
	public void clearPortConnectionStatusChanged(int port)
	throws USBException;
	
	/**
	 * Is a lowspeed device connected to the given port.
	 * This method is only relevant if the port connection status is true.
	 * @return True if a lowspeed device is connected, false otherwise (full or high speed)
	 */
	public boolean isPortConnectedToLowSpeed(int port)
	throws USBException;
	
	/**
	 * Is a highspeed device connected to the given port.
	 * This method is only relevant if the port connection status is true.
	 * @return True if a highspeed device is connected, false otherwise (low or full)
	 */
	public boolean isPortConnectedToHighSpeed(int port)
	throws USBException;
	
	/**
	 * Gets the status of the port.
	 * This method is here for debugging only.
	 * @param port
	 * @return Implementation dependent.
	 * @throws USBException
	 */
	public int getPortStatus(int port)
	throws USBException;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -