Public Types | Public Member Functions | List of all members
uavcan::IFirmwareVersionChecker Class Referenceabstract

#include <firmware_update_trigger.hpp>

Inheritance diagram for uavcan::IFirmwareVersionChecker:
Inheritance graph
[legend]

Public Types

enum  { MaxFirmwareFilePathLength = 40 }
 
typedef MakeString< MaxFirmwareFilePathLength >::Type FirmwareFilePath
 

Public Member Functions

virtual void handleFirmwareUpdateConfirmation (NodeID node_id, const protocol::file::BeginFirmwareUpdate::Response &response)
 
virtual bool shouldRequestFirmwareUpdate (NodeID node_id, const protocol::GetNodeInfo::Response &node_info, FirmwareFilePath &out_firmware_file_path)=0
 
virtual bool shouldRetryFirmwareUpdate (NodeID node_id, const protocol::file::BeginFirmwareUpdate::Response &error_response, FirmwareFilePath &out_firmware_file_path)=0
 
virtual ~IFirmwareVersionChecker ()
 

Detailed Description

Application-specific firmware version checking logic. Refer to FirmwareUpdateTrigger for details.

Definition at line 23 of file firmware_update_trigger.hpp.

Member Typedef Documentation

◆ 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.

Member Enumeration Documentation

◆ anonymous enum

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.

Constructor & Destructor Documentation

◆ ~IFirmwareVersionChecker()

virtual uavcan::IFirmwareVersionChecker::~IFirmwareVersionChecker ( )
inlinevirtual

Definition at line 96 of file firmware_update_trigger.hpp.

Member Function Documentation

◆ 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_idNode ID that confirmed the request.
responseActual 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_idNode ID that this GetNodeInfo response was received from.
node_infoActual node info structure; refer to uavcan.protocol.GetNodeInfo for details.
out_firmware_file_pathThe 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_idNode ID that returned this error.
error_responseContents of the error response. It contains error code and text.
out_firmware_file_pathNew 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:


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04