<< hid_exit HID Basic's commands hid_open >>

USB Comunication Toolbox for Scilab >> HIDAPI Library > HID Basic's commands > hid_init

hid_init

Initializes the HIDAPI Library

Calling Sequence

init_success = hid_init()

Parameters

init_success
: This function returns 0 on success and -1 on error.

Description

Initializes the HIDAPI library

This function initializes the HIDAPI library. Calling it is not strictly necessary, as it will be called automatically by hid_enumerate() and any of the hid_open_*() functions (internal funtions of the library), if it is needed. This function should be called at the beginning of execution however, if there is a chance of HIDAPI handles being opened by different threads simultaneously.

If the device its not closed once have been opened Scilab, eventualy, will crash down because a segmentation fault

Examples

init_success=hid_init();
if ( init_success < 0 ) then
   disp("unable to initialize the HIDAPI Library");
   return
else
   disp("HIDAPI Library initialized");
end
exit_success=hid_exit();
if ( init_success < 0 ) then
   disp("unable to free static data associated with HIDAPI Library");
   return
else
   disp("HIDAPI Library have been freed all of the static data associated");
end

See Also

Authors

<< hid_exit HID Basic's commands hid_open >>