Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
monitoring.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <cstdint>
5#include <nlohmann/json_fwd.hpp>
6#include <optional>
7#include <string>
8#include <vector>
9
10namespace mm::node {
11
14 uint16_t devicePosition;
15 uint16_t index;
16 uint8_t subindex;
17};
18
28struct Monitoring {
29 std::string topic;
30 std::optional<std::string> name;
31 std::chrono::milliseconds interval;
32 std::vector<MonitoredParameter> parameters;
33};
34
36void to_json(nlohmann::json& j, const MonitoredParameter& p);
37
41void to_json(nlohmann::json& j, const Monitoring& m);
42
43} // namespace mm::node
Definition http_server.h:16
void to_json(nlohmann::json &j, const Device &d)
Serialises a Device to JSON.
Definition device.cc:924
One object a monitoring samples, addressed by bus position and CoE index.
Definition monitoring.h:13
uint16_t devicePosition
1-based bus position of the owning device.
Definition monitoring.h:14
uint16_t index
CoE object index.
Definition monitoring.h:15
uint8_t subindex
CoE object subindex.
Definition monitoring.h:16
A client-defined recording of a set of parameters streamed over time.
Definition monitoring.h:28
std::vector< MonitoredParameter > parameters
Objects to sample, in positional order.
Definition monitoring.h:32
std::optional< std::string > name
Optional human-readable label (display only).
Definition monitoring.h:30
std::chrono::milliseconds interval
Flush cadence (bounded [5 ms, 2000 ms]).
Definition monitoring.h:31
std::string topic
URL-safe unique id; also the WebSocket pub/sub topic.
Definition monitoring.h:29