Given that my need is to list all Mass Storage Devices, I don't know
their VID & PID in advance.
So I based my code on your example, adding tests deleting all devices
without SN and those that I'm sure they are not Mass Storage:
Sub ScanUSBBus()
// iterate over all devices without recursion and count devices
dim devices(-1) as MacUSBDeviceMBS
dim count as integer = -1 // do not count Mac itself
devices.Append MacUSBDeviceMBS.root
while UBound(devices)>=0
dim dev as MacUSBDeviceMBS = devices.Pop
count = count + 1
for each child as MacUSBDeviceMBS in dev.children
devices.Append child
If Child.SerialNumber="" Or InStr(child.ProductName,"Camera")<>0
Or InStr(child.ProductName,"Host Controller")<>0 Or
InStr(child.ProductName,"Card Reader")<>0 Then
continue For
Else
USBDisk.Append child
End If
next
wend
End Sub
Jean-Luc
Le 28/03/2014 20:46, Christian Schmitz a écrit :
> On 28 Mar 2014, at 17:13, Jean-Luc Arnaud <[email protected]> wrote:
>
>> Unfortunately no.
>>
>> Devices as different as IR Receiver, Card Reader, KeyPad and, of course,
>> USB sticks or USB disks appear as DeviceClass 0, ClassName IOUSBDevice.
> Well, the plugin just passes what it knows about the devices.
> And more or less, I bet most of them are just generic devices which talk to
> their drivers.
> And drivers are matched by ProductID/VendorID.
>
> Sincerely
> Christian
>
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info