0

I have been migrating my routing protocol code from INET 3 to INET 4 and I got An error code 139 and after running the debug mode ,the debug pointer referred to the command :

Coord senderPos=mobility->getCurrentPosition();

Note: I am using veins-inet Mobility in veins-5.1-i2

Dalia Adly
  • 53
  • 6

1 Answers1

2

Try including the below-mentioned code lines in your application's .h file.

#include "veins_inet/veins_inet.h"
#include "veins_inet/VeinsInetMobility.h"

veins::VeinsInetMobility* mobility;
veins::TraCICommandInterface* traci;
veins::TraCICommandInterface::Vehicle* traciVehicle; 

And, the below-mentioned code lines in your application's .cc file.

mobility = veins::VeinsInetMobilityAccess().get(getParentModule());
traci = mobility->getCommandInterface();
traciVehicle = mobility->getVehicleCommandInterface();
  • thanks for your reply . I have checked my code and realized that the command : mobility = check_and_cast(host->getSubmodule("mobility")); is missing . may be I deleted it by mistake. – Dalia Adly Oct 24 '21 at 09:37