Provides the entry point that validates and dispatches one inbound bridge payload. More...
Classes | |
| struct | DispatchResult |
| Represents the result of a dispatch operation. More... | |
Functions | |
| auto | deserializeAndDispatch (const JsonDocument &doc) -> DispatchResult |
| Main entry point for command processing. | |
Provides the entry point that validates and dispatches one inbound bridge payload.
| auto Deserializer::deserializeAndDispatch | ( | const JsonDocument & | doc | ) | -> DispatchResult |
Main entry point for command processing.
Consumes one decoded bridge document and immediately dispatches the corresponding action.
This function acts as a command dispatcher. It reads the command ID from the 'p' key and uses a switch statement for O(1) dispatching. It directly calls functions in other modules (Serializer, Actuators, NetworkClicks) to execute the command. This avoids intermediate state storage (like ResultsHolder) and multiple switch statements in the main loop, maximizing performance. The bridge runtime is intentionally semi-transparent and may raw-forward payloads it does not need to optimize locally, so this dispatcher is also the final semantic validation boundary for inbound LSH commands. Every scalar that matters semantically is validated explicitly so malformed bridge payloads are rejected here instead of being silently coerced by ArduinoJson conversions.
| doc | Parsed ArduinoJson document from BridgeSerial, regardless of the active wire codec. |

