1.1 --- a/src/common/pcap-writer.cc Wed Jun 03 17:42:13 2009 +0200
1.2 +++ b/src/common/pcap-writer.cc Wed Jun 03 17:42:22 2009 +0200
1.3 @@ -169,7 +169,9 @@
1.4 }
1.5
1.6
1.7 -void PcapWriter::WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm)
1.8 +void PcapWriter::WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz,
1.9 + uint32_t rate, bool isShortPreamble, bool isTx,
1.10 + double signalDbm, double noiseDbm)
1.11 {
1.12 NS_LOG_FUNCTION (this << packet->GetSize() << channelFreqMhz << rate << isShortPreamble << isTx << signalDbm << noiseDbm);
1.13
1.14 @@ -264,7 +266,7 @@
1.15 // (which stands for Received Signal Strength Indicator) but it is
1.16 // rather a Signal to Noise Ratio (SNR), of course in dB.
1.17 // Anyway, in the end we calculate the value exactly as madwifi does.
1.18 - Write32(round(signalDbm - noiseDbm));
1.19 + Write32((uint32_t)round(signalDbm - noiseDbm));
1.20
1.21 // SQ field not used. I would expect a PRISM_STATUS_ABSENT to be
1.22 // needed here, but if you look at the prism header that madwifi
1.23 @@ -278,12 +280,12 @@
1.24 Write32(PRISM_DID_SIGNAL);
1.25 Write16(PRISM_STATUS_PRESENT);
1.26 Write16(PRISM_ITEM_LENGTH);
1.27 - Write32(round(signalDbm));
1.28 + Write32((uint32_t)round(signalDbm));
1.29
1.30 Write32(PRISM_DID_NOISE);
1.31 Write16(PRISM_STATUS_PRESENT);
1.32 Write16(PRISM_ITEM_LENGTH);
1.33 - Write32(round(noiseDbm));
1.34 + Write32((uint32_t)round(noiseDbm));
1.35
1.36 Write32(PRISM_DID_RATE);
1.37 Write16(PRISM_STATUS_PRESENT);