Home |
Function RTUEndpointPacketSize Function RTUEnumDevices |
Function RTUEnumDevicesRTUEnumDevices retrieves USB device handles to all currently attached devices: RTUDeviceHandle RTUEnumDevices(RTUDeviceHandle Parent, int Index); ParametersParentHandle of a hub device on which the device to be located is attached to. If NULL is specified, all root hubs are returned. If this parameter is not NULL and does not reference a hub device, NULL is returned. IndexZero-based down-stream port index to query. RTUSB-32 supports at most RTU_MAX_HUB_PORTS (32 by default) ports per hub, so this parameter should have a value in the range 0..(RTU_MAX_HUB_PORTS-1). If the hub has less ports than Index+1, NULL is returned. return valueIf a device is attached to the given hub and port, its handle is returned, and NULL otherwise. This function can be used to locate all currently attached devices by recursively enumerating through all devices and their child devices. To get device handles of the root hubs, specify NULL for parameter Parent. Calling RTUEnumDevices for non-hubs does no harm and returns NULL. Since devices can be attached and detached at any time, the returned handle may be invalid if used in a subsequent call (the device might have been removed in the mean time). To guard against device attachment and detachment while the application steps through the device tree, it is recommended to temporarily disable the RTUSB-32 internal Hub class driver using RTUSuspendHubs. Demo program UsbShow demonstrates how this function can be used.
|