WiFi-PC

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.

01 - Overview

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.

02 - Requirements

Before you start

  • A C++ compiler with C++11 support or newer
  • The wifi_pc.hpp header available in your include path

That's the whole list. No package manager, no external runtime dependencies - just a header your compiler can see.

03 - Installation

Add it to your project

Copy wifi_pc.hpp (and any accompanying source files) into your project, then include it like any other header.

main.cppC++
#include <wifi_pc.hpp>
04 - Usage

Scan and print nearby networks

A basic example showing how to scan for nearby networks and print their names.

main.cppC++
#include <iostream> #include <wifi_pc.hpp> int main() { // Scanning all nearby wifi networks wifi_pc::Scan scan_result; // Obtaining scanned network name list auto network_names = scan_result.network_names(); // Printing names of scanned wifi for (int i = 0; i < network_names->size(); i++) { std::cout << network_names->at(i) << std::endl; } }
05 - Mechanics

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.

06 - Status

Notes

EARLY STAGE

This project is still early, so the API surface is minimal right now. More features will be added as the library grows.