This commit is contained in:
2026-05-29 15:20:56 +02:00
parent 6d27021d3e
commit 553bbf4c35
2 changed files with 24 additions and 1 deletions
@@ -38,11 +38,18 @@ class MatterhornServer {
ReturnCode get_num_udp_interfaces(ServerInterface &socket);
ReturnCode get_update_mode(ServerInterface &socket);
ReturnCode get_source_udp_mac(ServerInterface &socket);
private:
static std::string getMatterhornServerVersion();
size_t num_udp_interfaces() const;
/// @brief TODO what is this?
bool updateMode{true};
private:
/// @brief @brief TCP/IP interface for communication with the client
std::unique_ptr<TCPInterface> tcpInterface;
@@ -62,8 +69,14 @@ class MatterhornServer {
}},
{detFuncs::F_INITIAL_CHECKS,
[this](ServerInterface &si) { return this->initial_checks(si); }},
{detFuncs::F_GET_NUM_INTERFACES, [this](ServerInterface &si) {
{detFuncs::F_GET_NUM_INTERFACES,
[this](ServerInterface &si) {
return this->get_num_udp_interfaces(si);
}},
{detFuncs::F_GET_UPDATE_MODE,
[this](ServerInterface &si) { return this->get_update_mode(si); }},
{detFuncs::F_GET_SOURCE_UDP_MAC, [this](ServerInterface &si) {
return this->get_source_udp_mac(si);
}}};
};
@@ -66,4 +66,14 @@ ReturnCode MatterhornServer::get_num_udp_interfaces(ServerInterface &socket) {
return static_cast<ReturnCode>(socket.sendResult(numUDPInterfaces));
}
ReturnCode MatterhornServer::get_update_mode(ServerInterface &socket) {
return static_cast<ReturnCode>(
socket.sendResult(static_cast<int>(updateMode)));
}
ReturnCode MatterhornServer::get_source_udp_mac(ServerInterface &socket) {
uint64_t srcMac = udpDetails[0].srcmac;
return static_cast<ReturnCode>(socket.sendResult(srcMac));
}
} // namespace sls