mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 15:27:13 +02:00
working on removing undefined beaviour in configureMAC
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
#include "string_utils.h"
|
||||
#include "container_utils.h"
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
namespace sls{
|
||||
|
||||
|
||||
@ -37,5 +38,17 @@ std::string concatenateIfDifferent(std::vector<std::string> container)
|
||||
}
|
||||
}
|
||||
|
||||
std::string stringIpToHex(const std::string& ip)
|
||||
{
|
||||
std::istringstream iss(ip);
|
||||
std::ostringstream oss;
|
||||
std::string item;
|
||||
while (std::getline(iss, item, '.'))
|
||||
{
|
||||
oss << std::setw(2) << std::setfill('0') << std::hex << std::stoi(item);
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
}; // namespace sls
|
Reference in New Issue
Block a user