|
TinyRobotics
|
Reads stream and forwards messages to handler. More...
#include <MessageDispatcher.h>

Public Member Functions | |
| MessageDispatcher (MessageHandler &handler) | |
| MessageDispatcher (MessageHandler &handler, Stream &io) | |
| bool | begin () |
| void | end () |
| virtual bool | run () |
| void | setStream (Stream &io) |
| void | setHandler (MessageHandler &handler) |
Protected Attributes | |
| Stream * | p_stream = nullptr |
| bool | is_active = false |
| MessageHandler * | p_handler = nullptr |
Reads stream and forwards messages to handler.
The MessageDispatcher class reads messages from a communication stream (such as Serial, UDP, etc.) and dispatches them to the MessageHandler instance for processing. It handles message framing, validation, and error logging, providing a unified interface for remote control and telemetry.
Usage Example:
|
inlinevirtual |
Read messages from the stream and dispatch them to the vehicle for processing.