DetectorSetup: Configure UDP interface count
This commit is contained in:
@@ -33,7 +33,10 @@ void DetectorWrapper::Configure(const JFJochProtoBuf::DetectorConfig &request) {
|
||||
"Discrepancy in module number between DAQ and detector");
|
||||
}
|
||||
|
||||
det.setNumberofUDPInterfaces(2);
|
||||
if ((request.udp_interface_count() != 1) && (request.udp_interface_count() != 2))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Only 1 and 2 are supported as UDP interface count");
|
||||
det.setNumberofUDPInterfaces(request.udp_interface_count());
|
||||
|
||||
for (int i = 0; i < request.modules_size(); i++) {
|
||||
logger.Info("Configure network for module {}", i);
|
||||
@@ -41,17 +44,19 @@ void DetectorWrapper::Configure(const JFJochProtoBuf::DetectorConfig &request) {
|
||||
auto &cfg = request.modules(i);
|
||||
|
||||
det.setSourceUDPIP(sls::IpAddr(cfg.ipv4_src_addr_1()), {i});
|
||||
det.setSourceUDPIP2(sls::IpAddr(cfg.ipv4_src_addr_2()), {i});
|
||||
det.setSourceUDPMAC(sls::MacAddr(BASE_DETECTOR_MAC + i * 2), {i});
|
||||
det.setSourceUDPMAC2(sls::MacAddr(BASE_DETECTOR_MAC + i * 2 + 1), {i});
|
||||
|
||||
det.setDestinationUDPPort (cfg.udp_dest_port_1(), i);
|
||||
det.setDestinationUDPPort2(cfg.udp_dest_port_2(), i);
|
||||
det.setDestinationUDPIP( sls::IpAddr(cfg.ipv4_dest_addr_1()), {i});
|
||||
det.setDestinationUDPIP2( sls::IpAddr(cfg.ipv4_dest_addr_2()), {i});
|
||||
det.setDestinationUDPMAC( sls::MacAddr(cfg.mac_addr_dest_1()), {i});
|
||||
det.setDestinationUDPMAC2(sls::MacAddr(cfg.mac_addr_dest_2()), {i});
|
||||
|
||||
if (request.udp_interface_count() == 2) {
|
||||
det.setSourceUDPIP2(sls::IpAddr(cfg.ipv4_src_addr_2()), {i});
|
||||
det.setSourceUDPMAC2(sls::MacAddr(BASE_DETECTOR_MAC + i * 2 + 1), {i});
|
||||
det.setDestinationUDPPort2(cfg.udp_dest_port_2(), i);
|
||||
det.setDestinationUDPIP2( sls::IpAddr(cfg.ipv4_dest_addr_2()), {i});
|
||||
det.setDestinationUDPMAC2(sls::MacAddr(cfg.mac_addr_dest_2()), {i});
|
||||
}
|
||||
uint32_t tmp = (cfg.module_id_in_data_stream() * 2) % UINT16_MAX;
|
||||
uint32_t column_id_register = ((tmp + 1) << 16) | tmp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user