Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
device_parameter.cc File Reference
#include "node/device_parameter.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <expected>
#include <format>
#include <nlohmann/json.hpp>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
#include <variant>
#include <vector>
#include "comm/object_data_types.h"
Include dependency graph for device_parameter.cc:

Namespaces

namespace  mm
 
namespace  mm::node
 

Functions

DeviceParameterValue mm::node::defaultValueForDataType (uint16_t dataType)
 Returns a zero-equivalent value for the given ETG.1020 dataType.
 
std::expected< DeviceParameterValue, std::string > mm::node::decodeSdoBytes (uint16_t dataType, std::span< const uint8_t > bytes)
 Decodes a raw SDO byte sequence according to an ETG.1020 data type code.
 
std::expected< std::vector< uint8_t >, std::string > mm::node::encodeSdoBytes (uint16_t dataType, const DeviceParameterValue &value)
 Serialises a DeviceParameterValue to raw SDO bytes — the inverse of decodeSdoBytes.
 
std::optional< double > mm::node::numericValue (const DeviceParameterValue &value)
 Coerces a DeviceParameterValue to a double, when it holds a number.
 
std::string_view mm::node::syncStateName (SyncState state)
 Returns the lowercase string form of state ("unknown" etc.).
 
void mm::node::to_json (nlohmann::json &j, const DeviceParameter &p)
 Serialises a DeviceParameter to JSON.