Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1#pragma once
2
3#include <expected>
4#include <nlohmann/json_fwd.hpp>
5#include <string>
6#include <vector>
7
8namespace mm::comm {
9
17 std::string macLinux;
18 std::string macWindows;
19 std::string name;
20};
21
29void to_json(nlohmann::json& j, const NetworkAdapter& a);
30
39bool isMacAddress(const std::string& s);
40
50std::string normalizeMac(const std::string& raw, char sep);
51
79std::vector<NetworkAdapter> enumerateNetworkAdapters();
80
93std::expected<NetworkAdapter, std::string> resolveNetworkAdapter(const std::string& input);
94
95} // namespace mm::comm
Definition al_status_codes.cc:5
void to_json(nlohmann::json &j, const AlStatusCode &c)
Serialises an AlStatusCode to JSON.
Definition al_status_codes.cc:7
bool isMacAddress(const std::string &s)
Returns true if s is a MAC address in either Linux (:) or Windows (-) separator format.
Definition base.cc:59
std::expected< NetworkAdapter, std::string > resolveNetworkAdapter(const std::string &input)
Resolves a network adapter specifier to a fully populated NetworkAdapter.
Definition base.cc:188
std::vector< NetworkAdapter > enumerateNetworkAdapters()
Enumerates all network adapters visible to the OS.
Definition base.cc:80
std::string normalizeMac(const std::string &raw, char sep)
Normalises a MAC address string to uppercase with the given separator.
Definition base.cc:67
Definition base.h:16
std::string macLinux
Colon-separated uppercase MAC, e.g. "AA:BB:CC:DD:EE:FF".
Definition base.h:17
std::string name
OS interface name, e.g. "eth0" or "\\Device\\NPF_{GUID}".
Definition base.h:19
std::string macWindows
Dash-separated uppercase MAC, e.g. "AA-BB-CC-DD-EE-FF".
Definition base.h:18