Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
YFirmwareUpdate Class Reference

#include <yocto_api.h>

Public Member Functions

virtual int _processMore (int newupdate)
 
virtual int get_progress (void)
 
virtual string get_progressMessage (void)
 
virtual int startUpdate (void)
 
 YFirmwareUpdate (string serialNumber, string path, string settings)
 
 YFirmwareUpdate (string serialNumber, string path, string settings, bool force)
 
 YFirmwareUpdate ()
 

Static Public Member Functions

static string CheckFirmware (string serial, string path, int minrelease)
 
static vector< string > GetAllBootLoaders (void)
 

Protected Attributes

string _firmwarepath
 
bool _force
 
int _progress
 
int _progress_c
 
string _progress_msg
 
int _restore_step
 
string _serial
 
string _settings
 

Detailed Description

YFirmwareUpdate Class: Control interface for the firmware update process

The YFirmwareUpdate class let you control the firmware update of a Yoctopuce module. This class should not be instantiate directly, instead the method updateFirmware should be called to get an instance of YFirmwareUpdate.

Definition at line 833 of file yocto_api.h.

Constructor & Destructor Documentation

YFirmwareUpdate::YFirmwareUpdate ( string  serialNumber,
string  path,
string  settings 
)

Definition at line 1106 of file yocto_api.cpp.

YFirmwareUpdate::YFirmwareUpdate ( string  serialNumber,
string  path,
string  settings,
bool  force 
)

Definition at line 1118 of file yocto_api.cpp.

YFirmwareUpdate::YFirmwareUpdate ( )

Definition at line 1132 of file yocto_api.cpp.

Member Function Documentation

int YFirmwareUpdate::_processMore ( int  newupdate)
virtual

Definition at line 1147 of file yocto_api.cpp.

string YFirmwareUpdate::CheckFirmware ( string  serial,
string  path,
int  minrelease 
)
static

Test if the byn file is valid for this module. It is possible to pass a directory instead of a file. In that case, this method returns the path of the most recent appropriate byn file. This method will ignore any firmware older than minrelease.

Parameters
serial: the serial number of the module to update
path: the path of a byn file or a directory that contains byn files
minrelease: a positive integer
Returns
: the path of the byn file to use, or an empty string if no byn files matches the requirement

On failure, returns a string that starts with "error:".

Definition at line 1272 of file yocto_api.cpp.

int YFirmwareUpdate::get_progress ( void  )
virtual

Returns the progress of the firmware update, on a scale from 0 to 100. When the object is instantiated, the progress is zero. The value is updated during the firmware update process until the value of 100 is reached. The 100 value means that the firmware update was completed successfully. If an error occurs during the firmware update, a negative value is returned, and the error message can be retrieved with get_progressMessage.

Returns
an integer in the range 0 to 100 (percentage of completion) or a negative error code in case of failure.

Definition at line 1315 of file yocto_api.cpp.

string YFirmwareUpdate::get_progressMessage ( void  )
virtual

Returns the last progress message of the firmware update process. If an error occurs during the firmware update process, the error message is returned

Returns
a string with the latest progress message, or the error message.

Definition at line 1329 of file yocto_api.cpp.

vector< string > YFirmwareUpdate::GetAllBootLoaders ( void  )
static

Returns a list of all the modules in "firmware update" mode. Only devices connected over USB are listed. For devices connected to a YoctoHub, you must connect yourself to the YoctoHub web interface.

Returns
an array of strings containing the serial numbers of devices in "firmware update" mode.

Definition at line 1224 of file yocto_api.cpp.

int YFirmwareUpdate::startUpdate ( void  )
virtual

Starts the firmware update process. This method starts the firmware update process in background. This method returns immediately. You can monitor the progress of the firmware update with the get_progress() and get_progressMessage() methods.

Returns
an integer in the range 0 to 100 (percentage of completion), or a negative error code in case of failure.

On failure returns a negative error code.

Definition at line 1344 of file yocto_api.cpp.

Member Data Documentation

string YFirmwareUpdate::_firmwarepath
protected

Definition at line 843 of file yocto_api.h.

bool YFirmwareUpdate::_force
protected

Definition at line 848 of file yocto_api.h.

int YFirmwareUpdate::_progress
protected

Definition at line 846 of file yocto_api.h.

int YFirmwareUpdate::_progress_c
protected

Definition at line 845 of file yocto_api.h.

string YFirmwareUpdate::_progress_msg
protected

Definition at line 844 of file yocto_api.h.

int YFirmwareUpdate::_restore_step
protected

Definition at line 847 of file yocto_api.h.

string YFirmwareUpdate::_serial
protected

Definition at line 841 of file yocto_api.h.

string YFirmwareUpdate::_settings
protected

Definition at line 842 of file yocto_api.h.


The documentation for this class was generated from the following files:


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13