The argument can be a directory (instead of a file). In this case, the method checks all the files of thedirectory recursively and returns the most recent compatible firmware. The following piece of codechecks whether there is a more recent firmware in the c:\tmp\ directory.YModule m = YModule.FirstModule();......string path = "c:\\tmp";string newfirm = m.checkFirmware(path, true);if (newfirm != "") {Console.WriteLine("firmware " + newfirm + " is compatible and newer");}...You can also give the "www.yoctopuce.com" string as argument to check whether there is a morerecent published firmware on Yoctopuce's web site. In this case, the method returns the firmwareURL. You can use this URL to download the firmware on your disk or use this URL when updatingthe firmware (see below). Obviously, this possibility works only if your machine is connected toInternet.YModule m = YModule.FirstModule();......string url = m.checkFirmware("www.yoctopuce.com", true);if (url != "") {Console.WriteLine("new firmware is available at " + url );}...Updating the firmwareA firmware update can take several minutes. That is why the update process is run as a backgroundtask and is driven by the user code thanks to the YFirmwareUdpate class.To update a Yoctopuce module, you must obtain an instance of the YFirmwareUdpate class withthe updateFirmware method of a YModule object. The only parameter of this method is the pathof the firmware that you want to install. This method does not immediately start the update, butreturns a YFirmwareUdpate object configured to update the module.string newfirm = m.checkFirmware("www.yoctopuce.com", true);.....YFirmwareUpdate fw_update = m.updateFirmware(newfirm);The startUpdate() method starts the update as a background task. This background taskautomatically takes care of1. saving the module parameters2. restarting the module in "update" mode3. updating the firmware4. starting the module with the new firmware version5. restoring the parametersThe get_progress() and get_progressMessage() methods enable you to follow theprogression of the update. get_progress() returns the progression as a percentage (100 =update complete). get_progressMessage() returns a character string describing the currentoperation (deleting, writing, rebooting, ...). If the get_progress method returns a negative value,the update process failed. In this case, the get_progressMessage() returns an error message.The following piece of code starts the update and displays the progress on the standard output.YFirmwareUpdate fw_update = m.updateFirmware(newfirm);....int status = fw_update.startUpdate();while (status < 100 && status >= 0) {18. Firmware Updatewww.yoctopuce.com 129