6#include <nlohmann/json_fwd.hpp>
43 "SOMANET_CiA_402.xml.zip",
44 "stack_image.svg.zip",
74 std::optional<std::string>
keyId;
119 std::optional<FirmwarePackageFile>
sii;
139 std::span<const uint8_t> zip, std::span<const std::string> skipFiles);
213 const FirmwarePackageName& packageName,
214 const IntegroVariant* variant =
nullptr);
230 std::string_view hardwareDescriptionContent, std::string_view packageFilename,
231 const IntegroVariant* variant =
nullptr);
238void to_json(nlohmann::json& j,
const FullFirmwareDescriptors& descriptors);
239void to_json(nlohmann::json& j,
const FirmwareCompatibility& compatibility);
std::string description
Catalogue description of the block.
Definition eni_request.cc:38
std::string name
Catalogue name, e.g. "sm2".
Definition eni_request.cc:37
The .hardware_description file: what a SOMANET product says it is, and the descriptor that decides wh...
The .variant file: which features a SOMANET Integro was licensed with, and the fieldbus character its...
Definition bus_health_source.h:7
std::string_view toString(FirmwareMatch match)
What a match is called, for a message or a JSON body: "none", "assembly", "device".
Definition firmware_package.cc:295
FullFirmwareDescriptors fullFirmwareDescriptors(const HardwareDescription &description, const IntegroVariant *variant)
Assembles the descriptors description accepts, appending variant's fieldbus character when there is o...
Definition firmware_package.cc:270
std::expected< FirmwarePackageName, std::string > parseFirmwarePackageName(std::string_view filename)
Decodes filename as a SOMANET firmware package name.
Definition firmware_package.cc:110
constexpr std::array< std::string_view, 2 > kDefaultSkippedFirmwareFiles
The entries an install skips unless the request names a different set.
Definition firmware_package.h:42
void to_json(nlohmann::json &j, const Cia402Status &s)
Serialises a Cia402Status. Emits state/modeName as human-readable strings alongside the numeric statu...
Definition cia402_drive.cc:13
std::expected< FirmwarePackage, std::string > openFirmwarePackage(std::span< const uint8_t > zip, std::span< const std::string > skipFiles)
Reads a firmware package zip held in memory, dropping the entries named in skipFiles.
Definition firmware_package.cc:162
FirmwareCompatibility checkFirmwareCompatibility(const HardwareDescription &description, const FirmwarePackageName &packageName, const IntegroVariant *variant)
Decides whether packageName belongs on the hardware description describes.
Definition firmware_package.cc:307
FirmwareMatch
Which of a device's descriptors a package matched.
Definition firmware_package.h:174
@ kDevice
The device descriptor: the generic build for the hardware itself.
@ kNone
Neither — the package is for other hardware.
@ kAssembly
The assembly descriptor: firmware customised for the assembled product.
The verdict on one package against one device.
Definition firmware_package.h:184
FirmwarePackageName packageName
The package's decoded filename.
Definition firmware_package.h:186
std::string explanation
Definition firmware_package.h:192
FirmwareMatch match
What matched, if anything.
Definition firmware_package.h:185
FullFirmwareDescriptors deviceDescriptors
What the device accepts.
Definition firmware_package.h:187
bool compatible() const
Definition firmware_package.h:194
One entry of a package, extracted.
Definition firmware_package.h:106
std::vector< uint8_t > content
Decompressed bytes.
Definition firmware_package.h:108
std::string name
Entry name as it appears in the zip.
Definition firmware_package.h:107
A SOMANET firmware package filename, broken into the five fields the naming convention defines (Hardw...
Definition firmware_package.h:54
std::string softwareVersion
Its version including the leading 'v', e.g. "v5.6.10".
Definition firmware_package.h:59
std::optional< std::string > buildDescriptor() const
The buildDescriptor — firmwareId and firmwareVersion joined, e.g. "8500-04".
Definition firmware_package.cc:155
std::string softwareName
Firmware or software name, e.g. "motion-drive".
Definition firmware_package.h:58
std::optional< std::string > firmwareVersion
Hardware revision, e.g. "04".
Definition firmware_package.h:73
std::optional< std::string > keyId
Firmware encryption key id, e.g. "2332".
Definition firmware_package.h:74
std::string fullFirmwareDescriptor
The hardware this is built for, e.g. "8500-04-2332".
Definition firmware_package.h:57
std::optional< std::string > fieldbusProtocol
Hexadecimal character; "1" = EtherCAT.
Definition firmware_package.h:75
std::optional< std::string > firmwareId
e.g. "8500".
Definition firmware_package.h:72
std::string hardwareName
Human-readable hardware name, e.g. "SOMANET-Circulo-7".
Definition firmware_package.h:56
std::string description
Always "package" for a firmware bundle.
Definition firmware_package.h:55
A firmware package's contents, sorted by where each entry is going.
Definition firmware_package.h:116
std::vector< FirmwarePackageFile > extras
Everything else — stored on flash as-is.
Definition firmware_package.h:120
std::optional< FirmwarePackageFile > sii
*.sii — written to the ESC EEPROM.
Definition firmware_package.h:119
std::optional< FirmwarePackageFile > comBinary
com_*.bin — flashed in BOOT over FoE.
Definition firmware_package.h:118
std::optional< FirmwarePackageFile > appBinary
app_*.bin — flashed in BOOT over FoE.
Definition firmware_package.h:117
std::vector< std::string > skipped
Entry names the skip list removed, in order.
Definition firmware_package.h:121
The full firmware descriptors one device accepts firmware under (specification §3....
Definition firmware_package.h:147
std::string device
Definition firmware_package.h:156
std::optional< std::string > assembly
Definition firmware_package.h:152
A parsed .hardware_description file (specification §3.2).
Definition hardware_description.h:70
A parsed .variant file.
Definition integro_variant.h:123