AcquisitionDevice: refactor to make it less FPGA dependent

This commit is contained in:
2023-06-03 18:37:56 +02:00
parent 7d88017d51
commit e1e46f411f
18 changed files with 260 additions and 344 deletions
+4 -4
View File
@@ -125,12 +125,12 @@ void PCIExpressDevice::HW_ReadActionRegister(ActionConfig *config) {
"Failed reading config", errno);
}
uint64_t PCIExpressDevice::HW_GetMACAddress() const {
std::string PCIExpressDevice::GetMACAddress() const {
uint64_t tmp;
if (ioctl(fd, IOCTL_JFJOCH_GET_MAC, &tmp) != 0)
throw JFJochException(JFJochExceptionCategory::PCIeError,
"Failed getting MAC address", errno);
return tmp;
return MacAddressToStr(tmp);
}
void PCIExpressDevice::SetMACAddress(uint64_t mac_addr_network_order) {
@@ -195,10 +195,10 @@ void PCIExpressDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) {
"Failed setting IPv4 address", errno);
}
uint32_t PCIExpressDevice::HW_GetIPv4Address() const {
std::string PCIExpressDevice::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;
return IPv4AddressToStr(tmp);
}