20. High-level API Reference20.1. General functionsThese general functions should be used to initialize and configure the Yoctopuce library. In most cases,a simple call to function yRegisterHub() should be enough. The module-specific functionsyFind...() or yFirst...() should then be used to retrieve an object that provides interactionwith the module.In order to use the functions described here, you should include:js nodejs var yoctolib = require('yoctolib');var YAPI = yoctolib.YAPI;var YModule = yoctolib.YModule;cpp #include "yocto_api.h"m #import "yocto_api.h"pas uses yocto_api;vb yocto_api.vbcs yocto_api.csjava import com.yoctopuce.YoctoAPI.YModule;uwp import com.yoctopuce.YoctoAPI.YModule;py from yocto_api import *php require_once('yocto_api.php');es in HTML: in node.js: require('yoctolib-es2017/yocto_api.js');Global functionsyCheckLogicalName(name)Checks if a given string is valid as logical name for a module or a function.yDisableExceptions()Disables the use of exceptions to report runtime errors.yEnableExceptions()Re-enables the use of exceptions for runtime error handling.yEnableUSBHost(osContext)This function is used only on Android.yFreeAPI()Frees dynamically allocated memory blocks used by the Yoctopuce library.yGetAPIVersion()Returns the version identifier for the Yoctopuce library in use.yGetTickCount()Returns the current value of a monotone millisecond-based time counter.yHandleEvents(errmsg)Maintains the device-to-library communication channel.yInitAPI(mode, errmsg)Initializes the Yoctopuce programming library explicitly.yPreregisterHub(url, errmsg)Fault-tolerant alternative to RegisterHub().yRegisterDeviceArrivalCallback(arrivalCallback)Register a callback function, to be called each time a device is plugged.yRegisterDeviceRemovalCallback(removalCallback)Register a callback function, to be called each time a device is unplugged.138 www.yoctopuce.com