v1.13.18 - Unified EventQueue 3-Layer Architecture (2025-12-11)¶
What Changed?¶
This release completes the architectural unification of EventQueue and CommandQueue by implementing a consistent 3-layer pipeline for all device output. The circular dependency issue in event_response.h has been resolved, and event serialization now follows the same layer pattern as command responses. This improves maintainability, reduces code duplication, and paves the way for future event validation enhancements.
What's New¶
Main Feature: Unified 3-Layer Event Processing Pipeline¶
What it does:
EventQueue now uses the same 3-layer architecture as CommandQueue:
- Layer 1 (Domain):
event_response_twith validation and metadata - Layer 2 (Transport):
DeviceResponse::from_event()converts to unified format - Layer 3 (Serialization):
DeviceResponse::send()produces JSON output
How to use it:
No changes required for users. Event output format remains unchanged. Developers using EventQueue::enqueue() will automatically benefit from the unified serialization pipeline.
Code example:
// Layer 1: Create event response (in detection_process)
event_t event = { .hit1 = 100, .hit2 = 85, ... };
event_response_t event_response = event_response_ok(&event);
event_response.sent_at = device_get_timestamp();
// Queue entry combines both
event_queue_entry_t entry = {
.response = event_response,
.event = event
};
EventQueue::enqueue(&entry);
// Layer 2 & 3: Automatic conversion and serialization in EventQueue::flush()
// Output: {"type":"event","status":"ok","sent_at":12345,"hit1":100,...}
Installation¶
Quick Start¶
# Get the release
git checkout v1.13.18
# Build
task build
# Upload
task upload
# Check it works
task monitor
What's Different from the Last Version?¶
β Added¶
event_response_tLayer 1 structure unified withcommand_response_tDeviceResponse::from_event()method for Layer 2 conversion- Progress documentation: EventQueueβCommandQueue symmetry analysis
- 3-layer serialization pipeline in
EventQueue::flush()
π§ Changed¶
- EventQueue now uses unified device response protocol throughout
- All 23 command handlers updated to use unified helper function names:
command_response_ok()for success responsescommand_response_error()for error responsesevent_queue.hincludes onlydevice_response_types.h(resolves circular dependency)- EventQueue serialization moved from
send_event_response_full()toDeviceResponse::send()
π Fixed¶
- β
Circular dependency between
event_response.handdevice_response.h - β
Build failure due to undefined
event_response_tinDeviceResponseclass - β Inconsistent error handling between command and event paths
β Removed¶
include/event_response.h(consolidated intoevent_queue.h)src/event_response.cpp(consolidated intoevent_queue.cpp)
Is It Safe to Upgrade?¶
Backward Compatible: Yes
- Event output format remains unchanged (same JSON structure)
EventQueueAPI unchanged (init(),enqueue(),flush()signatures identical)ENABLE_DEVICE_RESPONSE=0continues to work with legacy protocol- All existing command handlers remain compatible (function name changes internal only)
Tests Passed¶
- β Builds without errors (all 3 profiles: release, debug, next)
- β RAM usage: 36.2% (118,720 / 327,680 bytes)
- β Flash usage: 27.3% (357,765 / 1,310,720 bytes)
- β Pre-commit hooks: All passed (trailing whitespace, file endings, merge conflicts)
- β Build time: 5.34 seconds
Release Details¶
- Date: 2025-12-11
- Version: v1.13.18
- Commits: 7 (from v1.13.17)
- Files Changed: 29
- Lines Added: 1,232
- Lines Deleted: 530
Next Steps¶
Planned for v1.14.0¶
- CommandParser class for unified argument parsing
- Event validation layer (Layer 1.5) for sensor error handling
- Stream format options consolidation (STREAM_FORMAT unification)
Future Roadmap (v1.15.0+)¶
- Complete Doxygen documentation for
event_response_t - EventQueue and CommandQueue test suites
- Performance benchmarking and optimization
- Multi-threaded event handling exploration