Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
hardware_description.h
Go to the documentation of this file.
1#pragma once
2
3#include <expected>
4#include <nlohmann/json_fwd.hpp>
5#include <optional>
6#include <string>
7#include <string_view>
8#include <vector>
9
10namespace mm::node {
11
26
32 std::string name;
33 std::string version;
34 std::string serialNumber;
35};
36
47 std::string name;
48 std::string imageId;
49 std::string id;
50 std::string version;
51 std::string keyId;
52 std::string serialNumber;
53 std::string macAddress;
54 std::vector<HardwareComponent> components;
55
61 std::string buildDescriptor() const;
62};
63
71 std::string fileVersion;
73 std::optional<HardwareProduct> assembly;
74};
75
95std::expected<HardwareDescription, std::string> parseHardwareDescription(std::string_view content);
96
104void to_json(nlohmann::json& j, const HardwareComponent& component);
105void to_json(nlohmann::json& j, const HardwareProduct& product);
106void to_json(nlohmann::json& j, const HardwareDescription& description);
108
109} // namespace mm::node
std::string description
Catalogue description of the block.
Definition eni_request.cc:38
Definition bus_health_source.h:7
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< HardwareDescription, std::string > parseHardwareDescription(std::string_view content)
Decodes content as a .hardware_description file.
Definition hardware_description.cc:75
One item making up a device or assembly (specification §3.2.2.3).
Definition hardware_description.h:31
std::string version
Version of the hardware named above, e.g. "B.4".
Definition hardware_description.h:33
std::string serialNumber
Unique identifier for this component.
Definition hardware_description.h:34
std::string name
Human-understandable description, e.g. "Com EtherCAT".
Definition hardware_description.h:32
A parsed .hardware_description file (specification §3.2).
Definition hardware_description.h:70
std::string fileVersion
Format version, semver, e.g. "1.2.0".
Definition hardware_description.h:71
std::optional< HardwareProduct > assembly
The product it was built into, if any.
Definition hardware_description.h:73
HardwareProduct device
The SOMANET device storing this file. Required.
Definition hardware_description.h:72
A device or an assembly — the two are one shape (specification §3.2.2).
Definition hardware_description.h:46
std::string imageId
Names the product's picture, e.g. "9501-xx". Optional.
Definition hardware_description.h:48
std::vector< HardwareComponent > components
What this product is made of. Optional.
Definition hardware_description.h:54
std::string serialNumber
Identifies this particular unit. Optional.
Definition hardware_description.h:52
std::string version
firmwareVersion — revision of that product, e.g. "01".
Definition hardware_description.h:50
std::string keyId
Firmware encryption key burned to OTP, e.g. "4622". Device only.
Definition hardware_description.h:51
std::string buildDescriptor() const
The buildDescriptor: id and version joined by a dash, e.g. "9501-01".
Definition hardware_description.cc:73
std::string macAddress
MAC address of the Ethernet port. Device only, optional.
Definition hardware_description.h:53
std::string name
Human-readable description of the hardware. Required.
Definition hardware_description.h:47
std::string id
firmwareId — identifies the hardware product, e.g. "9501".
Definition hardware_description.h:49