<< enumerateusb USB Device Enumeration get_device_stringusb >>

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

free_enumerationusb

Free an enumeration Linked List

Calling Sequence

free_success=free_enumerationusb(comu_type);

Parameters

free_success
: 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

Free an enumeration Linked List

This is a macro designed to use the hid_free_enumeration

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

<< enumerateusb USB Device Enumeration get_device_stringusb >>