Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::node::FirmwareInstallationRequest Struct Reference

Where an install leaves the device, as an AL state. More...

#include <somanet_procedures.h>

Collaboration diagram for mm::node::FirmwareInstallationRequest:
[legend]

Public Attributes

std::vector< uint8_t > package
 The package zip's bytes.
 
std::string filename
 
std::optional< FirmwarePackageNamename
 
std::vector< std::string > skipFiles
 Entries not to write; defaults per the descriptor.
 
bool cachePackage = true
 Keep a copy under firmwareCacheDir when named.
 
mm::comm::EtherCatState finalState = mm::comm::EtherCatState::PreOp
 
std::chrono::milliseconds bootWarmUp {2000}
 

Detailed Description

Where an install leaves the device, as an AL state.

Deliberately mm::comm::EtherCatState rather than a firmware-specific enum, and deliberately the same integer encoding the rest of the API uses (POST /api/devices/state, and the alState every state read reports): one concept, one spelling. A parallel vocabulary here would mean a client holding two ways to say PRE-OP.

Any AL state is accepted, and the two worth knowing about are the ends:

  • PreOp is the default and the one that confirms the install. The SOMANET bootloader hands over to the newly written application on the transition out of BOOT, so reaching PRE-OP is the new firmware booting and answering. When no valid application is present the drive reports AL status 0x0014 ("No valid firmware") and falls back to INIT — a precise, decodable failure rather than a hang.
  • Boot leaves the device in the bootloader, which is the right choice when no application will be present: after erasing one, or between two installs, a PRE-OP transition has nothing to hand over to and would report a failure for an operation that succeeded.

SAFE-OP and OP climb through PRE-OP and re-map the whole bus on the way, briefly pausing every other device. That is a real cost but not a reason to withhold them — the same re-map happens when a caller reaches those states with POST /api/devices/state a moment later, so refusing would only split one operation into two.

The device's state before the install is deliberately not restored: it described a device running the old firmware, and it is a snapshot nothing protects, since the body holds no lock between steps.

One validated firmware installation request.

The package arrives as bytes, however it was named: parseFirmwareInstallationRequest resolves either the inline upload or a previously cached package into package, so the body never has to know which route the caller took.

Member Data Documentation

◆ bootWarmUp

std::chrono::milliseconds mm::node::FirmwareInstallationRequest::bootWarmUp {2000}

How long to wait after entering BOOT before the first file transfer.

Deliberately not advertised on the descriptor: it is a property of how long a SOMANET bootloader takes to start servicing file operations, not a choice a user should be asked to make, and the default is the figure that works. It is a field rather than a constant so a test can set it to zero — waiting two seconds per case would dominate the suite — and so a device that needs longer can be accommodated without a new release.

◆ cachePackage

bool mm::node::FirmwareInstallationRequest::cachePackage = true

Keep a copy under firmwareCacheDir when named.

◆ filename

std::string mm::node::FirmwareInstallationRequest::filename

As supplied; empty when the caller gave none.

◆ finalState

mm::comm::EtherCatState mm::node::FirmwareInstallationRequest::finalState = mm::comm::EtherCatState::PreOp

◆ name

std::optional<FirmwarePackageName> mm::node::FirmwareInstallationRequest::name

The decoded filename, present only when filename parses as a SOMANET package name. Its absence is what makes a package uncacheable — see cachePackage.

◆ package

std::vector<uint8_t> mm::node::FirmwareInstallationRequest::package

The package zip's bytes.

◆ skipFiles

std::vector<std::string> mm::node::FirmwareInstallationRequest::skipFiles

Entries not to write; defaults per the descriptor.


The documentation for this struct was generated from the following file: