Taking command line argument input in bsm-application.cc

15 views
Skip to first unread message

Sunny

unread,
Mar 10, 2020, 11:09:24 AM3/10/20
to ns-3-users
Hello everyone,
I want to take a command line argument as input in bsm-application.cc (For example, a path to a director) as it is done in any main program (e.g. vanet-routing-compare) but I have no idea how to do it. If someone has any idea please guide me.
Thank you in advance.

Sunny

unread,
Mar 12, 2020, 8:56:40 AM3/12/20
to ns-3-users
The problem is solved just I have added the required variable in the install function of the bsm-application.cc and its requisite file.

Adesoji Bello

unread,
Mar 12, 2020, 8:58:49 AM3/12/20
to ns-3-...@googlegroups.com
Hi Sunny,

Can you show a sample command you entered so I can adapt in my codebase.

Thanks.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/fb82a33d-6360-4d10-81f0-c10a422e14f1%40googlegroups.com.

Sunny

unread,
Mar 13, 2020, 8:00:05 AM3/13/20
to ns-3-users
Hello dear,
This is the modified script
void
BsmApplication::Setup (Ipv4InterfaceContainer & i,
                       int nodeId,
                       Time totalTime,
                       uint32_t wavePacketSize, // bytes
                       Time waveInterval,
                       double gpsAccuracyNs,
                       std::vector <double> rangesSq,           // m ^2        <<<<<<<<<< ------ Ranges Square
                       Ptr<WaveBsmStats> waveBsmStats,
                       std::vector<int> * nodesMoving,
                       int chAccessMode,
                       Time txMaxDelay,
                       std::string packetDataFile
                       )

In my case, I needed the "packetDataFile" variable as a parameter from my main code to be added in bsm-application.cc, so it is here and note that you should also add the new variable in bsm-application.h.
Hope this helps you.

On Thursday, March 12, 2020 at 1:58:49 PM UTC+1, Adesoji Bello wrote:
Hi Sunny,

Can you show a sample command you entered so I can adapt in my codebase.

Thanks.

On Thu, Mar 12, 2020, 8:56 AM Sunny <sanaull...@gmail.com> wrote:
The problem is solved just I have added the required variable in the install function of the bsm-application.cc and its requisite file.

On Tuesday, March 10, 2020 at 4:09:24 PM UTC+1, Sunny wrote:
Hello everyone,
I want to take a command line argument as input in bsm-application.cc (For example, a path to a director) as it is done in any main program (e.g. vanet-routing-compare) but I have no idea how to do it. If someone has any idea please guide me.
Thank you in advance.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages