Search code examples
c++cunixwifi

Scan for wifi networks using C


I'm attempting to create a C program that will scan for wifi networks. I'm not sure what the best ways to this are.

The one plausible idea I have so far is the following Use C to run the bash code for wifi scanning, then pipe the results back
Cons: might require use of sudo

At this point I'm hoping someone is more familiar with this type of problem and can offer a better/more elegant solution.

*I'm using Mac OSX, but I'll take a solution for any common unix system


Solution

  • You can try using the Apple CoreWLAN Framework. It is written for Objective-C (which is a superset of C) but I believe you can figure out a way to use it from within a C++ or a C program. Hope this helps.