diff --git a/asam_cmp_capture_module/src/capture_fb.cpp b/asam_cmp_capture_module/src/capture_fb.cpp index 3244d6e..092f8b0 100644 --- a/asam_cmp_capture_module/src/capture_fb.cpp +++ b/asam_cmp_capture_module/src/capture_fb.cpp @@ -114,17 +114,11 @@ void CaptureFb::statusLoop() ethernetWrapper->sendPacket(e); }; - - auto encodedData = encoders.encode(1, captureStatus.getPacket(), encoderContext); - for (const auto& e : encodedData) - ethernetWrapper->sendPacket(e); - - + encodeAndSend(captureStatus.getPacket()); + for (SizeT i = 0; i < captureStatus.getInterfaceStatusCount(); ++i) { - encodedData = encoders.encode(1, captureStatus.getInterfaceStatus(i).getPacket(), encoderContext); - for (const auto& e : encodedData) - ethernetWrapper->sendPacket(e); + encodeAndSend(captureStatus.getInterfaceStatus(i).getPacket()); } } } diff --git a/asam_cmp_common_lib/src/ethernet_pcpp_impl.cpp b/asam_cmp_common_lib/src/ethernet_pcpp_impl.cpp index 0470645..a899eae 100644 --- a/asam_cmp_common_lib/src/ethernet_pcpp_impl.cpp +++ b/asam_cmp_common_lib/src/ethernet_pcpp_impl.cpp @@ -50,7 +50,7 @@ void setFilters(pcpp::PcapLiveDevice* device) pcpp::PcapLiveDevice* EthernetPcppImpl::getPcapLiveDevice(const StringPtr& deviceName) const { - auto pcapLiveDevice = pcapDeviceList.getPcapLiveDeviceByName(deviceName); + auto pcapLiveDevice = pcapDeviceList.getDeviceByName(deviceName); if (!pcapLiveDevice) { std::string err = fmt::format("Can't find device {}", deviceName); @@ -115,7 +115,7 @@ void EthernetPcppImpl::sendPacket(const std::vector& data) pcpp::PayloadLayer payloadLayer(data.data(), data.size()); // create a packet with initial capacity of 100 bytes (will grow automatically if needed) pcpp::Packet newPacket(100); - bool res = newPacket.addLayer(&newEthernetLayer); + [[maybe_unused]] bool res = newPacket.addLayer(&newEthernetLayer); assert(res); res = newPacket.addLayer(&payloadLayer); assert(res);