int newstatus = fw_update.get_progress();if (newstatus != status) {Console.WriteLine(status + "% "+ fw_update.get_progressMessage());}YAPI.Sleep(500, ref errmsg);status = newstatus;}if (status < 0) {Console.WriteLine("Firmware Update failed: "+ fw_update.get_progressMessage());} else {Console.WriteLine("Firmware Updated Successfully!");}An Android characteristicYou can update a module firmware using the Android library. However, for modules connected byUSB, Android asks the user to authorize the application to access the USB port.During firmware update, the module restarts several times. Android interprets a USB device rebootas a disconnection and a reconnection to the USB port, and prevents all USB access as long as theuser has not closed the pop-up window. The use has to click on OK for the update process tocontinue correctly. You cannot update a module connected by USB to an Android devicewithout having the user interacting with the device.18.5. The "update" modeIf you want to erase all the parameters of a module or if your module does not start correctlyanymore, you can install a firmware from the "update" mode.To force the module to work in "update" mode, disconnect it, wait a few seconds, and reconnect itwhile maintaining the Yocto-button down. This will restart the module in "update" mode. This updatemode is protected against corruptions and is always available.In this mode, the module is not detected by the YModule objects anymore. To obtain the list ofconnected modules in "update" mode, you must use the YAPI.GetAllBootLoaders() function.This function returns a character string array with the serial numbers of the modules in "update"mode.List allBootLoader = YAPI.GetAllBootLoaders();The update process is identical to the standard case (see the preceding section), but you mustmanually instantiate the YFirmwareUpdate object instead of callingmodule.updateFirmware(). The constructor takes as argument three parameters: the moduleserial number, the path of the firmware to be installed, and a byte array with the parameters to berestored at the end of the update (or null to restore default parameters).YFirmwareUpdateupdate fw_update;fw_update = new YFirmwareUpdate(allBootLoader[0], newfirm, null);int status = fw_update.startUpdate();.....18. Firmware Update130 www.yoctopuce.com