Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
hardware_description.h File Reference

The .hardware_description file: what a SOMANET product says it is, and the descriptor that decides which firmware fits it. More...

#include <expected>
#include <nlohmann/json_fwd.hpp>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for hardware_description.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mm::node::HardwareComponent
 One item making up a device or assembly (specification §3.2.2.3). More...
 
struct  mm::node::HardwareProduct
 A device or an assembly — the two are one shape (specification §3.2.2). More...
 
struct  mm::node::HardwareDescription
 A parsed .hardware_description file (specification §3.2). More...
 

Namespaces

namespace  mm
 
namespace  mm::node
 

Functions

std::expected< HardwareDescription, std::string > mm::node::parseHardwareDescription (std::string_view content)
 Decodes content as a .hardware_description file.
 
void mm::node::to_json (nlohmann::json &j, const HardwareComponent &component)
 Serialises a component, a product and a whole description.
 
void mm::node::to_json (nlohmann::json &j, const HardwareProduct &product)
 
void mm::node::to_json (nlohmann::json &j, const HardwareDescription &description)
 

Detailed Description

The .hardware_description file: what a SOMANET product says it is, and the descriptor that decides which firmware fits it.

Pure transform over text — no fieldbus, no filesystem, no HTTP — so the rule that decides whether a firmware package belongs on a device is unit-testable against real files without hardware. Reading the file off a drive is SomanetDrive::readHardwareDescription; matching a package against it is checkFirmwareCompatibility in firmware_package.h.

Every name here is the one the Hardware description specification (v1.5, format 1.2.0) uses, including its §3.3 clarifying names — firmwareId for a product's id, firmwareVersion for its version, buildDescriptor for the two joined, fullFirmwareDescriptor for the whole thing. Source code elsewhere in the ecosystem calls some of these something else (the descriptor was also called an "API identifier" and an "FWID"); those names are not used here.