How to print parameters?

59 views
Skip to first unread message

Marek Ciesla

unread,
Jul 30, 2017, 4:05:16 PM7/30/17
to ns-3-users
Hi,

I want to check if the channel assignation is done ok, Ive use a method from an example but it seems that it assigns the same channel for both devices. My main problem is that i dont understand very well the way of printing parameters. Can you help me with this? How can i print an ip or any parameter?  Is there any fast way to see if an AP is configured correctly?

Regards and thank you.
alpha02.cc

mn

unread,
Jul 31, 2017, 4:48:53 AM7/31/17
to ns-3-users
i did not catch your question. you want to get some information like AP ip address  and print it ?

Marek Ciesla

unread,
Jul 31, 2017, 11:56:49 AM7/31/17
to ns-3-users
Yes, i want to know how to see if the config that i made is ok. For example, from the line 176 to 181 im trying to get the frequency of both sta. The first sta is on channel 4 and the other one on channel 1, but from what its printing both have assigned the same channel 4. Another thing i want to do is to print the position of the devices, which im going to try to do now, but i dont understand too much how to get these parameters.

Thanks and regards.

mehrdad manoochehri

unread,
Jul 31, 2017, 12:04:58 PM7/31/17
to ns-3-...@googlegroups.com
for the second one you need a function in order to print the location of the node second by second for instance void getposition(Ptr<Node> node){

    Ptr<MobilityModel> mob = node->GetObject<MobilityModel>();
    mob->GetPosition();
    std::cout<<mob->GetPosition()<<std::endl;



    Simulator::Schedule(Seconds(1), &getposition, node);
}

and then schedule it in the main part.

for the first one i think you take out these such information from trace file

--
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 a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/DOY1jmvKzU0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
BR
Mehrdad

Marek Ciesla

unread,
Jul 31, 2017, 4:38:45 PM7/31/17
to ns-3-users
Thank you for your response.
My main proble is that from the code the channels are the same, so im doing wrong the retrieval of the channels, at least of the second device. From the pcaps i can see that the channel assignation is done correctly. What i want is to learn printing any possible parameter. Any idea where can i find the documentation about it?
Imágenes integradas 3


Imágenes integradas 1

Imágenes integradas 2



El lunes, 31 de julio de 2017, 18:04:58 (UTC+2), mn escribió:
for the second one you need a function in order to print the location of the node second by second for instance void getposition(Ptr<Node> node){

    Ptr<MobilityModel> mob = node->GetObject<MobilityModel>();
    mob->GetPosition();
    std::cout<<mob->GetPosition()<<std::endl;



    Simulator::Schedule(Seconds(1), &getposition, node);
}

and then schedule it in the main part.

for the first one i think you take out these such information from trace file
On Mon, Jul 31, 2017 at 4:56 PM, Marek Ciesla <mare...@gmail.com> wrote:
Yes, i want to know how to see if the config that i made is ok. For example, from the line 176 to 181 im trying to get the frequency of both sta. The first sta is on channel 4 and the other one on channel 1, but from what its printing both have assigned the same channel 4. Another thing i want to do is to print the position of the devices, which im going to try to do now, but i dont understand too much how to get these parameters.

Thanks and regards.


El lunes, 31 de julio de 2017, 10:48:53 (UTC+2), mn escribió:
i did not catch your question. you want to get some information like AP ip address  and print it ?

On Sunday, July 30, 2017 at 9:05:16 PM UTC+1, Marek Ciesla wrote:
Hi,

I want to check if the channel assignation is done ok, Ive use a method from an example but it seems that it assigns the same channel for both devices. My main problem is that i dont understand very well the way of printing parameters. Can you help me with this? How can i print an ip or any parameter?  Is there any fast way to see if an AP is configured correctly?

Regards and thank you.

--
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 a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/DOY1jmvKzU0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
BR
Mehrdad

mehrdad manoochehri

unread,
Aug 1, 2017, 6:22:34 AM8/1/17
to ns-3-...@googlegroups.com
would you attach your code here?

To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
BR
Mehrdad

Marek Ciesla

unread,
Aug 1, 2017, 12:20:33 PM8/1/17
to ns-3-users
Yes, its the same  as the one of the first post, at least  the part that im asking, but ill attach you the newest version.
alpha02.cc
Reply all
Reply to author
Forward
0 new messages