|
using | Ptr = std::shared_ptr< SWUpdater > |
|
using | FlashStatusCb = std::function< void(float, const std::string &)> |
| Signature for user callback to receive status information about firmware flashing. More...
|
|
|
class IFM3D_NO_EXPORT | Impl |
|
◆ FlashStatusCb
Signature for user callback to receive status information about firmware flashing.
The first parameter is a percentage (0.0-1.0) indicating the status of uploading the file to the device.
The second parameter is a status message from the device during install.
◆ SWUpdater()
ifm3d::SWUpdater::SWUpdater |
( |
ifm3d::Device::Ptr |
cam, |
|
|
const ifm3d::SWUpdater::FlashStatusCb & |
cb = {} , |
|
|
const std::uint16_t |
swupdate_recovery_port = ifm3d::SWUPDATER_RECOVERY_PORT |
|
) |
| |
Ctor.
- Parameters
-
cam | Device object to manipulate |
cb | Optional user-defined callback to handle status updates |
swupdate_recovery_port | swupate recovery port for the device |
◆ FlashFirmware()
bool ifm3d::SWUpdater::FlashFirmware |
( |
const std::string & |
swu_file, |
|
|
long |
timeout_millis = 0 |
|
) |
| |
Uploads a firmware image to the device's recovery system.
Assumes device has already been rebooted to recovery mode.
- Parameters
-
[in] | swu_file | The firmware image file to flash to the device. |
[in] | timeout_millis | Timeout in millis to wait for the firmware upload to complete. If timeout_millis is set to 0, this function will block indefinitely. |
NOTE: Firmware uploading and flashing typically takes several minutes. The blocking version of the API (timeout_millis = 0) is recommended in most cases. If a timeout is truly required, it is recommended to use a value of at least 300000 (5 minutes).
- Exceptions
-
◆ RebootToProductive()
void ifm3d::SWUpdater::RebootToProductive |
( |
| ) |
|
Reboots the device from recovery to productive.
The function returns immediately, but the reboot process takes some time. The function WaitForProductive
may be used to poll for completion.
- Exceptions
-
◆ RebootToRecovery()
void ifm3d::SWUpdater::RebootToRecovery |
( |
| ) |
|
Reboots the device from productive to recovery.
The function returns immediately, but the reboot process takes some time. The function WaitForRecovery
may be used to poll for completion.
- Exceptions
-
◆ WaitForProductive()
bool ifm3d::SWUpdater::WaitForProductive |
( |
long |
timeout_millis = 0 | ) |
|
Polls on status of the device, waiting for it to present in productive mode.
Should be used following a call to RebootToProductive().
- Parameters
-
[in] | timeout_millis | Timeout in millis to wait for the device to become available. If timeout_millis is set to 0, this function will block indefinitely. If timeout_millis is set to -1, this function will check once and return immediately. |
- Returns
- true if the device became available w/in
timeout_millis
, false otherwise.
- Exceptions
-
◆ WaitForRecovery()
bool ifm3d::SWUpdater::WaitForRecovery |
( |
long |
timeout_millis = 0 | ) |
|
Polls on status of the device, waiting for it to present in recovery mode.
Should be used following a call to RebootToRecovery().
- Parameters
-
[in] | timeout_millis | Timeout in millis to wait for the recovery system to become available. If timeout_millis is set to 0, this function will block indefinitely. If timeout_millis is set to -1, this function will check once and return immediately. |
- Returns
- true if the recovery system became available w/in
timeout_millis
, false otherwise.
- Exceptions
-
The documentation for this class was generated from the following file: