mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
clearer exceptions to help user fix the issue of localhost not getting mac address
This commit is contained in:
@ -1021,6 +1021,10 @@ void Module::setDestinationUDPIP(const IpAddr ip) {
|
|||||||
if (ip == 0) {
|
if (ip == 0) {
|
||||||
throw RuntimeError("Invalid destination udp ip address");
|
throw RuntimeError("Invalid destination udp ip address");
|
||||||
}
|
}
|
||||||
|
if (ip.str() == LOCALHOST_IP) {
|
||||||
|
throw RuntimeError("Invalid destination udp ip. Change rx_hostname "
|
||||||
|
"from localhost or change udp_dstip from auto?");
|
||||||
|
}
|
||||||
sendToDetector(F_SET_DEST_UDP_IP, ip, nullptr);
|
sendToDetector(F_SET_DEST_UDP_IP, ip, nullptr);
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
sls::MacAddr retval(0LU);
|
sls::MacAddr retval(0LU);
|
||||||
@ -1040,7 +1044,10 @@ void Module::setDestinationUDPIP2(const IpAddr ip) {
|
|||||||
if (ip == 0) {
|
if (ip == 0) {
|
||||||
throw RuntimeError("Invalid destination udp ip address2");
|
throw RuntimeError("Invalid destination udp ip address2");
|
||||||
}
|
}
|
||||||
|
if (ip.str() == LOCALHOST_IP) {
|
||||||
|
throw RuntimeError("Invalid destination udp ip. Change rx_hostname "
|
||||||
|
"from localhost or change udp_dstip from auto?");
|
||||||
|
}
|
||||||
sendToDetector(F_SET_DEST_UDP_IP2, ip, nullptr);
|
sendToDetector(F_SET_DEST_UDP_IP2, ip, nullptr);
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
sls::MacAddr retval(0LU);
|
sls::MacAddr retval(0LU);
|
||||||
@ -3330,9 +3337,9 @@ sls_detector_module Module::interpolateTrim(sls_detector_module *a,
|
|||||||
dacs_to_copy.end(),
|
dacs_to_copy.end(),
|
||||||
{E_SVP, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS});
|
{E_SVP, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS});
|
||||||
// interpolate vrf, vcmp, vcp
|
// interpolate vrf, vcmp, vcp
|
||||||
dacs_to_interpolate.insert(
|
dacs_to_interpolate.insert(dacs_to_interpolate.end(),
|
||||||
dacs_to_interpolate.end(),
|
{E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR,
|
||||||
{E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR, E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS});
|
E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS});
|
||||||
} else {
|
} else {
|
||||||
dacs_to_copy.insert(dacs_to_copy.end(),
|
dacs_to_copy.insert(dacs_to_copy.end(),
|
||||||
{M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT,
|
{M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT,
|
||||||
|
@ -1388,6 +1388,10 @@ int ClientInterface::set_read_n_rows(Interface &socket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sls::MacAddr ClientInterface::setUdpIp(sls::IpAddr arg) {
|
sls::MacAddr ClientInterface::setUdpIp(sls::IpAddr arg) {
|
||||||
|
if (arg.str() == LOCALHOST_IP) {
|
||||||
|
throw RuntimeError("Invalid destination udp ip. Change rx_hostname "
|
||||||
|
"from localhost or change udp_dstip from auto?");
|
||||||
|
}
|
||||||
LOG(logINFO) << "Received UDP IP: " << arg;
|
LOG(logINFO) << "Received UDP IP: " << arg;
|
||||||
// getting eth
|
// getting eth
|
||||||
std::string eth = sls::IpToInterfaceName(arg.str());
|
std::string eth = sls::IpToInterfaceName(arg.str());
|
||||||
@ -1426,6 +1430,10 @@ int ClientInterface::set_udp_ip(Interface &socket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sls::MacAddr ClientInterface::setUdpIp2(sls::IpAddr arg) {
|
sls::MacAddr ClientInterface::setUdpIp2(sls::IpAddr arg) {
|
||||||
|
if (arg.str() == LOCALHOST_IP) {
|
||||||
|
throw RuntimeError("Invalid destination udp ip. Change rx_hostname "
|
||||||
|
"from localhost or change udp_dstip from auto?");
|
||||||
|
}
|
||||||
LOG(logINFO) << "Received UDP IP2: " << arg;
|
LOG(logINFO) << "Received UDP IP2: " << arg;
|
||||||
// getting eth
|
// getting eth
|
||||||
std::string eth = sls::IpToInterfaceName(arg.str());
|
std::string eth = sls::IpToInterfaceName(arg.str());
|
||||||
|
@ -65,6 +65,8 @@
|
|||||||
#define DEFAULT_DET_MAC2 "00:aa:bb:cc:dd:ff"
|
#define DEFAULT_DET_MAC2 "00:aa:bb:cc:dd:ff"
|
||||||
#define DEFAULT_DET_IP2 "129.129.202.46"
|
#define DEFAULT_DET_IP2 "129.129.202.46"
|
||||||
|
|
||||||
|
#define LOCALHOST_IP "127.0.0.1"
|
||||||
|
|
||||||
/** default maximum string length */
|
/** default maximum string length */
|
||||||
#define MAX_STR_LENGTH 1000
|
#define MAX_STR_LENGTH 1000
|
||||||
#define SHORT_STR_LENGTH 20
|
#define SHORT_STR_LENGTH 20
|
||||||
@ -564,7 +566,7 @@ enum streamingInterface {
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
|
|
||||||
//operators needed in ToString
|
// operators needed in ToString
|
||||||
inline slsDetectorDefs::streamingInterface
|
inline slsDetectorDefs::streamingInterface
|
||||||
operator|(const slsDetectorDefs::streamingInterface &a,
|
operator|(const slsDetectorDefs::streamingInterface &a,
|
||||||
const slsDetectorDefs::streamingInterface &b) {
|
const slsDetectorDefs::streamingInterface &b) {
|
||||||
@ -579,8 +581,6 @@ operator&(const slsDetectorDefs::streamingInterface &a,
|
|||||||
static_cast<int32_t>(b));
|
static_cast<int32_t>(b));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Reference in New Issue
Block a user