Jump to content
  • Advertisement
Sign in to follow this  
nightrayy

C code to get the same information like iwlist wlan scan

This topic is 569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

Another option would be to avoid duplicating the code but instead to create a pipe(), fork() your process, then in the child set stdin / stdout to use the pipe and finally exec() the iwlist program so that the parent process can read the output from the pipe and parse it.

This is essentially what happens when you use the unix "|" on the command line to pipe the output of one process to the input of another.

Share this post


Link to post
Share on other sites
I agree; those tools are written in C, so you can do whatever they do.

I don't know what your install options are. For example, if you need to be able to build and install for systems where you can't guarantee that iwlist is installed, you may want to include the equivalent code instead. Else, just use pipe/fork/exec, or even the simplistic popen() function.

Note that some functions may need root privileges, so may not be great for using in a piece of software you ship to end users.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!