mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
conflict resolved, changed to using hex() instead of str() in configuremac
This commit is contained in:
@ -31,8 +31,8 @@ class MacAddr {
|
||||
constexpr MacAddr(uint64_t mac) noexcept : addr_{mac} {}
|
||||
MacAddr(std::string mac);
|
||||
MacAddr(const char *address);
|
||||
std::string str() const { return to_hex(':'); }
|
||||
std::string hex() const { return to_hex(); }
|
||||
std::string str() const;
|
||||
std::string hex() const;
|
||||
constexpr bool operator==(const MacAddr &other) const noexcept { return addr_ == other.addr_; }
|
||||
constexpr bool operator!=(const MacAddr &other) const noexcept { return addr_ != other.addr_; }
|
||||
constexpr bool operator==(const uint64_t other) const noexcept { return addr_ == other; }
|
||||
|
@ -74,6 +74,8 @@ enum detFuncs{
|
||||
F_SOFTWARE_TRIGGER,/** < software trigger */
|
||||
F_LED, /** < switch on/off led */
|
||||
F_DIGITAL_IO_DELAY, /** < digital IO delay */
|
||||
F_COPY_DET_SERVER, /** < copy detector server & respawn */
|
||||
F_REBOOT_CONTROLLER, /** < reboot detector controller (blackfin/ powerpc) */
|
||||
NUM_DET_FUNCTIONS,
|
||||
|
||||
RECEIVER_ENUM_START = 128, /**< detector function should not exceed this (detector server should not compile anyway) */
|
||||
|
@ -19,7 +19,11 @@ namespace sls {
|
||||
IpAddr::IpAddr(const std::string &address) {
|
||||
inet_pton(AF_INET, address.c_str(), &addr_);
|
||||
}
|
||||
IpAddr::IpAddr(const char *address) { inet_pton(AF_INET, address, &addr_); }
|
||||
|
||||
IpAddr::IpAddr(const char *address) {
|
||||
inet_pton(AF_INET, address, &addr_);
|
||||
}
|
||||
|
||||
std::string IpAddr::str() const {
|
||||
char ipstring[INET_ADDRSTRLEN]{};
|
||||
inet_ntop(AF_INET, &addr_, ipstring, INET_ADDRSTRLEN);
|
||||
@ -57,6 +61,14 @@ std::string MacAddr::to_hex(const char delimiter) const {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
std::string MacAddr::str() const {
|
||||
return to_hex(':');
|
||||
}
|
||||
|
||||
std::string MacAddr::hex() const {
|
||||
return to_hex();
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const IpAddr &addr) {
|
||||
return out << addr.str();
|
||||
}
|
||||
|
Reference in New Issue
Block a user