#include <firmware_update_trigger.hpp>
Application-specific firmware version checking logic. Refer to FirmwareUpdateTrigger for details.
Definition at line 23 of file firmware_update_trigger.hpp.
◆ FirmwareFilePath
This type is used to store path to firmware file that the target node will retrieve using the service uavcan.protocol.file.Read. Note that the maximum length is limited due to some specifics of libuavcan (MaxFirmwareFilePathLength), this is NOT a protocol-level limitation.
Definition at line 37 of file firmware_update_trigger.hpp.
◆ anonymous enum
This value is limited by the pool block size minus some extra data. Please refer to the Map<> documentation for details. If this size is set too high, the compilation will fail in the Map<> template.
Enumerator |
---|
MaxFirmwareFilePathLength | |
Definition at line 30 of file firmware_update_trigger.hpp.
◆ ~IFirmwareVersionChecker()
virtual uavcan::IFirmwareVersionChecker::~IFirmwareVersionChecker |
( |
| ) |
|
|
inlinevirtual |
◆ handleFirmwareUpdateConfirmation()
virtual void uavcan::IFirmwareVersionChecker::handleFirmwareUpdateConfirmation |
( |
NodeID |
node_id, |
|
|
const protocol::file::BeginFirmwareUpdate::Response & |
response |
|
) |
| |
|
inlinevirtual |
This node is invoked when the node responds to the update request with confirmation. Note that if by the time of arrival of the response the node is already removed, this method will not be called.
Implementation is optional; default one does nothing.
- Parameters
-
node_id | Node ID that confirmed the request. |
response | Actual response. |
Definition at line 89 of file firmware_update_trigger.hpp.
◆ shouldRequestFirmwareUpdate()
virtual bool uavcan::IFirmwareVersionChecker::shouldRequestFirmwareUpdate |
( |
NodeID |
node_id, |
|
|
const protocol::GetNodeInfo::Response & |
node_info, |
|
|
FirmwareFilePath & |
out_firmware_file_path |
|
) |
| |
|
pure virtual |
This method will be invoked when the class obtains a response to GetNodeInfo request.
- Parameters
-
node_id | Node ID that this GetNodeInfo response was received from. |
node_info | Actual node info structure; refer to uavcan.protocol.GetNodeInfo for details. |
out_firmware_file_path | The implementation should return the firmware image path via this argument. Note that this path must be reachable via uavcan.protocol.file.Read service. Refer to FileServer and BasicFileServer for details. |
- Returns
- True - the class will begin sending update requests. False - the node will be ignored, no request will be sent.
◆ shouldRetryFirmwareUpdate()
virtual bool uavcan::IFirmwareVersionChecker::shouldRetryFirmwareUpdate |
( |
NodeID |
node_id, |
|
|
const protocol::file::BeginFirmwareUpdate::Response & |
error_response, |
|
|
FirmwareFilePath & |
out_firmware_file_path |
|
) |
| |
|
pure virtual |
This method will be invoked when a node responds to the update request with an error. If the request simply times out, this method will not be invoked. Note that if by the time of arrival of the response the node is already removed, this method will not be called.
SPECIAL CASE: If the node responds with ERROR_IN_PROGRESS, the class will assume that further requesting is not needed anymore. This method will not be invoked.
- Parameters
-
node_id | Node ID that returned this error. |
error_response | Contents of the error response. It contains error code and text. |
out_firmware_file_path | New firmware path if a retry is needed. Note that this argument will be initialized with old path, so if the same path needs to be reused, this argument should be left unchanged. |
- Returns
- True - the class will continue sending update requests with new firmware path. False - the node will be forgotten, new requests will not be sent.
The documentation for this class was generated from the following file: