33 const Ieee80211OFDMPLCPFrame *ofdmPhyFrame = check_and_cast<
const Ieee80211OFDMPLCPFrame *>(plcpHeader);
34 unsigned int byteLength = ofdmPhyFrame->getByteLength();
35 unsigned char *buf =
new unsigned char[byteLength];
36 for (
unsigned int i = 0; i < byteLength; i++)
38 Buffer
b(buf, byteLength);
41 hdr->length = ofdmPhyFrame->getLength();
42 hdr->rate = ofdmPhyFrame->getRate();
47 Ieee80211Frame *encapsulatedPacket = check_and_cast<Ieee80211Frame*>(ofdmPhyFrame->getEncapsulatedPacket());
48 Ieee80211Serializer ieee80211Serializer;
50 Buffer subBuffer(
b,
b.getRemainingSize());
52 ieee80211Serializer.serializePacket(encapsulatedPacket, subBuffer, c);
53 b.accessNBytes(subBuffer.getPos());
54 unsigned int numOfWrittenBytes =
b.getPos();
59 int pad = byteLength - numOfWrittenBytes;
61 serializedPacket->appendBit(
false, pad * 8);
62 serializedPacket->appendBit(0, 6);
Definition: Ieee80211PLCPHeaders.h:28
const value< double, compose< units::m, pow< units::s,-1 > > > c(299792458)
void writeToBitVector(unsigned char *buf, unsigned int bufSize, BitVector *bitVector) const
Definition: Ieee80211PhySerializer.cc:98
value< double, units::m > b
Definition: Units.h:1054
virtual short getType() const