Skip to content

v1.13.7 - EventQueue Complete Implementation (2025-12-09)

What Changed?

This release completes the EventQueue implementation by ensuring all detection event payload data is properly buffered and transmitted through the unified device response protocol. Previously, EventQueue was only queuing the response envelope without the actual sensor data (hit1, hit2, hit3, adc), causing detection events to be incomplete. This fix ensures complete event data including all optional fields (hit_type, adc_raw, adc_mv, environmental sensors, timestamps, GNSS) flows through the queue system.


What's New

Main Feature: Complete Event Buffering with Unified Protocol

What it does: EventQueue now queues complete event_queue_entry_t structures containing both the response envelope and the full event payload. All sensor readings and optional fields are preserved through the buffering pipeline and transmitted as complete JSONL messages with all data intact.

How to use it: When ENABLE_DEVICE_RESPONSE=1, detection events are automatically captured with all sensor data and transmitted as unified JSON-formatted messages. All optional fields based on compile-time flags (ENABLE_HITTYPE, ENABLE_ADCMV, ENABLE_BME280, ENABLE_TIMESTAMP, ENABLE_RTC, ENABLE_GNSS) are included in the output.

Example output:

{"type":"event","status":"ok","sent_at":100001,"hit1":100,"hit2":100,"hit3":100,"adc":1535,
 "hit_type":7,"adc_raw":1535,"adc_mv":1379,"tmp_c":25.3,"atm_pa":101325,"hmd_pct":45,
 "uptime_ms":24497,"timedelta_us":9999931,"unix_timestamp":100001,
 "gnss_latitude":37.77,"gnss_longitude":-122.41,"gnss_altitude":50,"gnss_satellites":12,
 "gnss_fix_quality":2,"gnss_hdop":1.5,"gnss_fix_valid":true}

Installation

Quick Start

# Get the release
git checkout v1.13.7

# Build
task build

# Upload
task upload

# Check it works
task monitor

What's Different from the Last Version?

✅ Added

  • Complete event payload buffering in EventQueue - all sensor data now flows through the queue
  • send_event_response_full() function in event_response.cpp for complete event serialization
  • event_queue_entry_t structure combining response envelope and event payload

🔧 Changed

  • EventQueue buffer allocation changed from sizeof(device_response_t) to sizeof(event_queue_entry_t)
  • EventQueue::enqueue() signature updated to accept const event_queue_entry_t* instead of const device_response_t*
  • EventQueue::flush() refactored to call send_event_response_full() for complete event serialization
  • main.cpp detection_process() now creates complete event_t structure with all fields including core and optional data

🐛 Fixed

  • Critical Fix: Detection events now include complete payload data (hit1, hit2, hit3, adc) instead of envelope-only
  • All optional fields are now properly transmitted based on compile-time flags
  • Complete data flow: detection_process() → event_t → event_queue_entry_t → send_event_response_full() → JSON JSONL output

Is It Safe to Upgrade?

Backward Compatible: Yes (when ENABLE_DEVICE_RESPONSE=1)

  • When ENABLE_DEVICE_RESPONSE=1: Complete fix with no breaking changes - detection events now include all data
  • When ENABLE_DEVICE_RESPONSE=0: Legacy path unchanged, zero impact on binary protocol users
  • No changes to user-facing API or command interface

Tests Passed

  • ✅ esp32dev-dev build: SUCCESS (28.8KB RAM / 348KB Flash)
  • ✅ esp32dev-release build: SUCCESS (22.7KB RAM / 306KB Flash)
  • ✅ esp32dev-next build: SUCCESS (98.2KB RAM / 322KB Flash)
  • ✅ Complete event serialization verified with all optional fields
  • ✅ Serial output confirms all payload fields present in JSON

Release Details

  • Date: 2025-12-09
  • Version: v1.13.7
  • Files Changed: 4 (main.cpp, event_queue.h, event_queue.cpp, event_response.cpp)
  • Commit: 97bf430

Next Steps

Phase 4 DeviceResponse implementation complete. Future phases will focus on:

  • CommandParser class for unified command argument parsing
  • Expanded diagnostics and monitoring capabilities
  • Performance optimization for high-frequency detection scenarios