WiFi Scan Application
Overview
This is a NetBurner WiFi scanning and management application that provides an interactive command-line interface for WiFi operations on embedded systems. The application demonstrates how to use the NetBurner WiFi driver to scan for access points, connect/disconnect from networks, and monitor connection status.
Features
- WiFi Network Scanning: Scan for available WiFi access points and display their details
- Connection Management: Connect to and disconnect from WiFi networks
- Network Status Monitoring: Display detailed WiFi and Ethernet interface information
- Security Information: Show security protocols (Open, WEP, WPA, WPA2, WPS) and cipher types
- Interactive Menu System: Serial command interface for real-time WiFi management
- System Diagnostics: Built-in diagnostic capabilities and system reset functions
Application Structure
Core Components
- main.cpp: Primary application file containing the WiFi management logic
- ReadMe.txt: Brief description indicating this is a WiFi scanning example
Key Functions
Network Scanning
DoSyncScan(): Performs synchronous WiFi network scan and displays results
WifiInitScanAndShow_SPI(): Initialize WiFi interface and perform initial scan
Status Display
DisplayWifiStatus(): Shows comprehensive WiFi connection and interface information
DisplaySecurity(): Converts security type codes to readable labels
DisplayCipher(): Converts cipher type codes to readable labels
DisplayWifiConfigRecordParameters(): Shows configured SSID and passphrase
Connection Management
- Connect/disconnect functionality through the NetBurner WiFi driver
- Interface number tracking and object management
Command Interface
The application provides an interactive serial menu with the following commands:
| Command | Function |
| C | Connect to WiFi network |
| D | Disconnect from current WiFi network |
| S | Perform WiFi network scan |
| W | Display WiFi status and configuration |
| X | Reset WiFi module |
| Z | System reboot |
Technical Details
Dependencies
- NetBurner HAL (Hardware Abstraction Layer)
- NetBurner WiFi driver libraries
- DSPI (Serial Peripheral Interface) support
- Standard C/C++ libraries
WiFi Security Support
- Open networks
- WEP encryption
- WPA/WPA2 security protocols
- WPS (WiFi Protected Setup)
- TKIP and AES cipher support
Network Information Displayed
- Interface Details: IP address, subnet mask, gateway, DNS servers
- MAC Addresses: Both Ethernet and WiFi interface MAC addresses
- WiFi Specific: SSID, BSSID, signal strength (RSSI), channel, security type
- Device Information: Hardware and firmware revision numbers
Usage
- Initialization: The application automatically initializes the network stack and performs an initial WiFi scan on startup
- Web Server: Starts an HTTP server on port 80 for additional functionality
- Interactive Control: Use the serial interface to send commands for WiFi management
- Network Waiting: Waits up to 5 seconds for DHCP address assignment
Configuration
The application reads WiFi configuration from stored settings including:
- Target SSID (network name)
- Passphrase/password
- Security settings
Error Handling
- Interface initialization validation
- Connection status verification
- Retry limit monitoring
- Graceful failure reporting
Notes
- The application is designed for development and testing purposes
- System diagnostics are enabled (should be disabled for production)
- Supports both Ethernet and WiFi interfaces simultaneously
- Uses C++ with NetBurner-specific namespaces and libraries