Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
example_logic.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <nlohmann/json.hpp>
5#include <string>
6#include <vector>
7
8namespace mm::node {
9class DeviceManager;
10} // namespace mm::node
11
19namespace mm::example {
20
25 uint16_t position{};
26 std::string name;
27 std::string vendorId;
28 std::string productCode;
29 uint32_t serialNumber{};
30};
31
34void to_json(nlohmann::json& j, const DeviceSummary& summary);
35
40std::vector<DeviceSummary> summarizeDevices(const mm::node::DeviceManager& deviceManager);
41
42} // namespace mm::example
Owns the fieldbus driver and node collection, and drives PDO exchange.
Definition device_manager.h:183
Example application namespace — the starting point for a C++ HTTP-endpoint plug-in.
Definition example_logic.cc:11
std::vector< DeviceSummary > summarizeDevices(const mm::node::DeviceManager &deviceManager)
Builds a summary row for every device currently known to deviceManager.
Definition example_logic.cc:21
void to_json(nlohmann::json &j, const DeviceSummary &summary)
Serialises a DeviceSummary to JSON. Lives next to the type (ADL-found by nlohmann) so a nlohmann::jso...
Definition example_logic.cc:13
Definition http_server.h:16
A trimmed, presentation-shaped view of one device — the kind of derived data an application-specific ...
Definition example_logic.h:24
std::string name
Device name as reported over the fieldbus.
Definition example_logic.h:26
uint16_t position
1-based slave position on the bus.
Definition example_logic.h:25
uint32_t serialNumber
Raw serial number.
Definition example_logic.h:29
std::string productCode
Product code, formatted as 0x.........
Definition example_logic.h:28
std::string vendorId
Vendor ID, formatted as 0x.........
Definition example_logic.h:27