C++11 · HEADER LIBRARY · MIT LICENSED
Scan for WiFi networks from C++, on any desktop OS.
wifi-pc is a small library that triggers a WiFi scan and hands back the SSIDs it finds nearby - one class, one call, no platform-specific code in your project.
What it does
wifi_pc gives you a simple way to trigger a WiFi scan from your C++ program and get back the list of network names (SSIDs) found nearby. It wraps the OS-level WiFi APIs so your code doesn't have to know whether it's running on Windows, macOS, or Linux.
Before you start
- A C++ compiler with C++11 support or newer
- The
wifi_pc.hppheader available in your include path
That's the whole list. No package manager, no external runtime dependencies - just a header your compiler can see.
Add it to your project
Copy wifi_pc.hpp (and any accompanying source files) into your project, then include it like any other header.
Scan and print nearby networks
A basic example showing how to scan for nearby networks and print their names.
How it works
Create a wifi_pc::Scan object
Constructing it triggers a scan of nearby WiFi networks on the current platform.
Call network_names()
Returns the list of SSIDs the scan discovered.
Loop with size() and at(i)
Walk the returned list to access each network name in turn.
Notes
This project is still early, so the API surface is minimal right now. More features will be added as the library grows.