PCIExpressDevice: Get MAC/IPv4 Address for internal packet generator via ioctl

This commit is contained in:
2023-09-14 17:48:30 +02:00
parent 48ee2ca305
commit ab1a8fbfca

View File

@@ -106,8 +106,14 @@ void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment)
FrameGeneratorConfig config{};
config.frames = experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1;
config.modules = experiment.GetModulesNum(data_stream);
config.dest_ipv4_addr = ipv4_addr;
config.dest_mac_addr = mac_addr;
if (ioctl(fd, IOCTL_JFJOCH_GET_MAC, &config.dest_mac_addr) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed getting MAC address", errno);
if (ioctl(fd, IOCTL_JFJOCH_GET_IPV4, &config.dest_ipv4_addr) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed getting MAC address", errno);
if (ioctl(fd, IOCTL_JFJOCH_RUN_FRAME_GEN, &config) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting frame generator", errno);
}