Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
base.cc File Reference
#include "comm/base.h"
#include <spdlog/spdlog.h>
#include <algorithm>
#include <array>
#include <cctype>
#include <cstdio>
#include <nlohmann/json.hpp>
#include <optional>
#include <regex>
#include <string>
#include <vector>
#include "core/util.h"
#include <linux/if.h>
#include <netinet/in.h>
#include <soem/soem.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <cstring>
Include dependency graph for base.cc:

Namespaces

namespace  mm
 
namespace  mm::comm
 

Functions

void mm::comm::to_json (nlohmann::json &j, const NetworkAdapter &a)
 Serialises a NetworkAdapter to JSON.
 
bool mm::comm::isMacAddress (const std::string &s)
 Returns true if s is a MAC address in either Linux (:) or Windows (-) separator format.
 
std::string mm::comm::normalizeMac (const std::string &raw, char sep)
 Normalises a MAC address string to uppercase with the given separator.
 
std::optional< std::array< uint8_t, 6 > > mm::comm::parseMac (const std::string &s)
 Decodes a MAC address string into its six bytes, in wire order.
 
std::vector< NetworkAdaptermm::comm::enumerateNetworkAdapters ()
 Enumerates all network adapters visible to the OS.
 
std::expected< NetworkAdapter, std::string > mm::comm::resolveNetworkAdapter (const std::string &input)
 Resolves a network adapter specifier to a fully populated NetworkAdapter.