DSF USB External Hub Simulator (SoftUSBHub)

The SoftUSBHub object (ISoftUSBHub) implements an external USB hub simulator. Because the USB specification defines an external hub as a USB device, SoftUSBHub uses a SoftUSBDevice object (ISoftUSBDevice) and associated objects just as any device simulator. The SoftUSBHub::SoftUSBDevice property references this object. The following diagram describes the SoftUSBHub object model.

 

Diagram illustrating the SoftUSBHub object model

 

The SoftUSBHub::Ports property references a collection of SoftUSBHubPort objects (ISoftUSBHubPort) that represent the set of ports on the hub. You can attach devices to the hub or remove devices from the hub by using the SoftUSBHubPort::HotPlug and SoftUSBHub::Unplug methods. You can set the SoftUSBHub::NbrPorts property when a SoftUSBHub object is created to determine the number of ports on the hub. The creation of a SoftUSBHub object automatically populates the SoftUSBHub::Ports property with the specified number of SoftUSBHubPort objects.

SoftUSBHub exposes properties that comprise the hub descriptor. The SoftUSBHub::Status property returns the current hub status that the host sees. The SoftUSBHubPort::Status property returns the current port status that the host sees, and SoftUSBHubPort also has individual properties such as Enabled and Suspend that reflect the various bits of port status. When a test application has finished using a hub, it must call the SoftUSBHub::Destroy method to clean up any resources that are allocated during its operation.

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010