Skip to content

Commit bced3a3

Browse files
committed
PcapRecorder: Added compile time guards for the case when the physical wireless feature is disabled.
1 parent 2d93f15 commit bced3a3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/inet/common/packet/recorder/PcapRecorder.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
#include "inet/common/StringFormat.h"
2020
#include "inet/linklayer/common/InterfaceTag_m.h"
2121
#include "inet/networklayer/common/InterfaceTable.h"
22+
23+
#ifdef INET_WITH_PHYSICALLAYERWIRELESSCOMMON
2224
#include "inet/physicallayer/common/Signal.h"
2325
#include "inet/physicallayer/wireless/common/contract/packetlevel/IReception.h"
2426
#include "inet/physicallayer/wireless/common/contract/packetlevel/ITransmission.h"
27+
#endif
2528

2629
namespace inet {
2730

@@ -185,14 +188,16 @@ void PcapRecorder::receiveSignal(cComponent *source, simsignal_t signalID, cObje
185188
auto i = signalList.find(signalID);
186189
ASSERT(i != signalList.end());
187190
Direction direction = i->second;
188-
if (auto signal = dynamic_cast<const physicallayer::Signal *>(obj))
189-
recordPacket(signal->getEncapsulatedPacket(), direction, source);
190-
else if (auto packet = dynamic_cast<cPacket *>(obj))
191+
if (auto packet = dynamic_cast<cPacket *>(obj))
191192
recordPacket(packet, direction, source);
193+
#ifdef INET_WITH_PHYSICALLAYERWIRELESSCOMMON
194+
else if (auto signal = dynamic_cast<const physicallayer::Signal *>(obj))
195+
recordPacket(signal->getEncapsulatedPacket(), direction, source);
192196
else if (auto transmission = dynamic_cast<const physicallayer::ITransmission *>(obj))
193197
recordPacket(transmission->getPacket(), direction, source);
194198
else if (auto reception = dynamic_cast<const physicallayer::IReception *>(obj))
195199
recordPacket(reception->getTransmission()->getPacket(), direction, source);
200+
#endif
196201
}
197202
}
198203

0 commit comments

Comments
 (0)