<< get_device_stringusb USB Device Enumeration USB Device Strings >>

USB Comunication Toolbox for Scilab >> Scilab Macros > USB Device Enumeration > next_deviceusb

next_deviceusb

Change the actual Hid Device enumerated for the next one

Calling Sequence

success_next=enumerateusb(comu_type)

Parameters

success_next
: This function returns 0 on success and -1 on error.
comu_type
: Comunication protocol comunication. This string identify which protocol use. HID, Bulk, Isochronous or CDC "hid", "bulk", "iso" and "cdc" respectively

Description

Change the current HID Device enumerated for the next one

This is a macro designed to use the hid_next_device

The "bulk", "iso" and "cdc" implementantion are missing

Examples

enum_success=enumerateusb("hid");
if( ~( enum_success < 0 ) ) then
    success_next = 0;
    M_Vendor=list();
    M_Product=list();
    i=0;
    while( ~( success_next < 0 ) ) 
       i=i+1;
       [success_dev,vendor_id,product_id]=get_device_stringusb("hid");
       M_Vendor($+1)=vendor_id;
       M_Product($+1)=product_id;
       success_next=next_deviceusb("hid"); 
    end
    free_success=free_enumerationusb("hid");
    Devices=zeros(i,2)
    for k=1:i
        Devices(k,1)=M_Vendor(k)
        Devices(k,2)=M_Product(k)
    end
    Devices=dec2hex(Devices);
    disp(Devices);
end

See Also

Authors

<< get_device_stringusb USB Device Enumeration USB Device Strings >>