Skip to content

Conversation

@davidchatting-bot
Copy link
Contributor

@davidchatting-bot davidchatting-bot commented Feb 9, 2026

Summary

  • Refactor: Move low-level 802.11 frame parsing out of Approximate into PacketSniffer and MAC address utilities into eth_addr.h/cpp. Approximate now only handles proximate interaction logic (ARRIVE/DEPART/SEND/RECEIVE) and delegates all frame parsing to PacketSniffer. Public API unchanged.
  • Fix 802.11n packets incorrectly parsed [was Payload limit for MacOS 10.15 devices (at least) - large payloads unseen] #22: Correct 802.11n AMPDU packet parsing by skipping 4-byte delimiter when Aggregation flag is set, and remove the arbitrary sig_mode == 1 && len > 512 type override hack
  • Fix Compilation fails: some functions are not declared #33: Replace deprecated tcpip_adapter API with esp_netif equivalents so the library compiles on modern ESP32 Arduino cores (v2.x and v3.x)
  • Fix if a callback is set with onceWifiStatus() then ARP scanning wouldn't get executed #32: Decouple ARP scanning from onceWifiStatus callback system so user callbacks can't silently override initialization
  • Bug fixes: getRSSI() return value, isLocal() operator precedence checking wrong bit, isGroup() precedence
  • Dependencies: Switch from davidchatting/Arduino-List fork to upstream luisllamasbinaburo/Arduino-List (case-sensitivity fix merged upstream)
  • CI: Add workflow_dispatch trigger, remove ESP32 version pin, use ListLib via required-libraries

Test plan

  • PlatformIO build passes for ESP32 and ESP8266
  • All examples compile on both platforms
  • Tested on physical Adafruit Feather ESP32 — channel scanning, management frame parsing, SSID extraction, and MAC address parsing all verified working
  • CI workflows pass on fork

🤖 Generated with Claude Code

Claude and others added 17 commits February 2, 2026 10:55
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Define control frame subtypes (wifi_ctrl_subtypes_t), data frame
subtypes (wifi_data_subtypes_t), ToDS/FromDS direction constants,
and dedicated C structs for management, control (RTS, ACK, BAR),
and data frame headers. Add Information Element (IE) struct and
common IE ID constants. Change fctl subtype field to unsigned to
support all frame types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parse IEEE 802.11 management frames (probe requests, beacons,
authentication, association, deauthentication) and control frames
(RTS, Block Ack, PS-Poll) to extract device MAC addresses and RSSI
for proximity detection. Add new PROBE DeviceEvent type. Change
PacketSniffer subtype parameter from wifi_mgmt_subtypes_t to int
to support all frame types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PlatformIO does not auto-generate function prototypes from .ino
files like the Arduino IDE does, so add explicit forward declarations
for all callback functions in existing examples.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ProbeDetect demonstrates the new PROBE event for detecting devices
via management frames. ProximityZones classifies devices into RSSI-
based zones. DeviceFilter shows OUI-based filtering with
addActiveDeviceFilter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add library.json for PlatformIO registry compatibility with
Arduino-List dependency. Add platformio.ini with ESP32 and ESP8266
environments for building examples with pio ci.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update library.properties version from 1.4 to 2.0.0 with updated
description noting management and control frame parsing. Upgrade
GitHub Actions workflows from actions/checkout@v2 to v4.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document new management/control frame parsing, PROBE event, new
examples, PlatformIO installation, and updated DeviceEvent types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Register ProbeDetect, ProximityZones, and DeviceFilter in the
examples array so PlatformIO surfaces them correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parse Information Elements in probe request management frames to
extract the SSID a device is scanning for. Adds ssid field to Device
with setSSID, getSSIDAsString, and hasSSID methods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parse IEEE 802.11 Country Information Element (IE id 7) from beacon and
probe response frames originating from the local BSSID, storing the
country code and environment character as static members with public
getters (getCountryCode, getCountryEnvironment, hasCountryInfo).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ffer

Move wifi_mgmt_frame_to_Device, wifi_ctrl_frame_to_Device,
wifi_promiscuous_pkt_to_Device, and wifi_csi_info_to_Channel from
Approximate into PacketSniffer as parseMgmtFrame, parseCtrlFrame,
parseDataFrame, and parseCSI. This separates reusable low-level 802.11
frame parsing from the proximate interaction logic.

Extract MAC address conversion utilities (MacAddr_to_eth_addr,
eth_addr_to_String, etc.) into free functions in eth_addr.h/cpp.
Approximate static methods are kept as thin wrappers for API
compatibility.

Move countryCode/countryEnvironment storage and localBSSID to
PacketSniffer. Device.cpp and Network.cpp now use free functions
directly instead of depending on Approximate.h.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow manual triggering of ESP32 and ESP8266 build workflows
in addition to push and pull_request events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The latest ESP32 Arduino Core (3.x) removed deprecated tcpip_adapter
and esp_event_loop_init APIs. Pin to 2.0.17 which is the last 2.x
release compatible with the existing codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use getFrameStart() to skip 4-byte AMPDU delimiter on ESP8266 when
the Aggregation flag is set in rx_ctrl. This ensures frame control
and MAC addresses are read from the correct offset for HT packets.
Remove the arbitrary sig_mode==1 && len>512 type override hack from
Approximate::parsePacket() since the type is now correctly determined
from the properly-offset frame control field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… and

decouple ARP scanning from onceWifiStatus callbacks (issue davidchatting#32)

Issue davidchatting#33: Replace deprecated tcpip_adapter_init(), esp_event_loop_init(),
and tcpip_adapter_dhcpc_start() with esp_netif equivalents in both
PacketSniffer.cpp and Approximate.cpp. Remove ESP32 core version pin
from CI workflow so it builds against the latest version.

Issue davidchatting#32: Move ARP scanning and packet sniffer initialization out of
the onceWifiStatus callback mechanism in begin(). Use a beginPending
flag handled directly in onWifiStatusChange() so user-registered
onceWifiStatus callbacks cannot silently override the initialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davidchatting-bot davidchatting-bot changed the title Move low-level packet parsing from Approximate to PacketSniffer Refactor packet parsing, fix issues #22/#32/#33, and modernize dependencies Feb 9, 2026
@davidchatting davidchatting merged commit 85a992c into davidchatting:master Feb 9, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants