Dear All,
I currently have this code, in order to provide packet sending on my simulation:
auto packet = new inet::Packet(msgName);
const auto& payload = inet::makeShared<inet::ByteCountChunk>(inet::B(*packetLengthPar));
auto now = omnetpp::simTime();
bool dummy = now < startTime+warmUpDuration || (numPackets != -1 && numSent >= numPackets);
packet->addPar("dummy") = dummy;
packet->insertAtBack(payload);
auto destAddr = chooseDestAddr();
auto addressType = destAddr.getAddressType();
packet->addTagIfAbsent<inet::PacketProtocolTag>()->setProtocol(protocol);//protocol
packet->addTagIfAbsent<inet::DispatchProtocolReq>()->setProtocol(addressType->getNetworkProtocol());
packet->addTagIfAbsent<inet::L3AddressReq>()->setDestAddress(destAddr);
EV_WARN << "Sending packet: ";
printPacket(packet);
addRecorderAndEmit(sentPkTo,sentPkToSignals,destAddr,packet);
emit(inet::packetSentSignal, packet);
send(packet, "ipOut");
The "dummy" parameter, i have no interest in keeping for my application. How can I add a "container" in my packet that represents a real value? i.e I have a variable updated locally that I want to send within this packet.
Best regards,