AcquisitionDevice: IPv4 address and UDP destination port is property of the device and not of a particular run

This commit is contained in:
2023-04-15 11:52:55 +02:00
parent 3319306b50
commit 32baaef1e4
24 changed files with 223 additions and 169 deletions
+12 -11
View File
@@ -146,7 +146,6 @@ void PCIExpressDevice::SetMACAddress(uint64_t mac_addr_network_order) {
if (ioctl(fd, IOCTL_JFJOCH_SET_MAC, &mac_addr_network_order) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed setting MAC address", errno);
}
void PCIExpressDevice::HW_GetStatus(ActionStatus *status) const {
@@ -199,14 +198,16 @@ void PCIExpressDevice::SetDefaultMAC() const {
"Failed setting default MAC", errno);
}
void PCIExpressDevice::SetIPv4Address(const std::string &ipv4_addr) {
ActionConfig config {
.fpga_ipv4_addr = IPv4AddressFromStr(ipv4_addr),
.nmodules = 1,
.one_over_energy = 1,
.frames_internal_packet_gen = 1,
.nstorage_cells = 1
};
HW_WriteActionRegister(&config);
void PCIExpressDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) {
if (ioctl(fd, IOCTL_JFJOCH_SET_IPV4, &ipv4_addr_network_order) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed setting IPv4 address", errno);
}
uint32_t PCIExpressDevice::HW_GetIPv4Address() const {
uint32_t tmp;
if (ioctl(fd, IOCTL_JFJOCH_GET_IPV4, &tmp) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed getting MAC address", errno);
return tmp;
}