|
TinyRobotics
|
Message handler that writes all received messages as raw binary to a Print stream. More...
#include <MessageHandlerPrint.h>


Public Member Functions | |
| MessageHandlerBinary (Print &printer) | |
| bool | onMessage (const Message< float > &msg) override |
| Handle an incoming message (pure virtual). | |
| bool | onMessage (const Message< Coordinate< float > > &msg) override |
| bool | onMessage (const Message< GPSCoordinate > &msg) override |
| bool | onMessage (const Message< MotionState3D > &msg) override |
| void | setOutput (Print &printer) |
| virtual bool | onMessage (const Message< float > &msg)=0 |
| Handle an incoming message (pure virtual). | |
| virtual bool | onMessage (const Message< Coordinate< float > > &msg) |
| virtual bool | onMessage (const Message< GPSCoordinate > &msg) |
| virtual bool | onMessage (const Message< MotionState3D > &msg) |
Protected Attributes | |
| Print & | printer_ |
Message handler that writes all received messages as raw binary to a Print stream.
This class implements the MessageHandler interface and outputs the content of all received messages (float, Coordinate<float>, GPSCoordinate) as raw binary data to the provided Print object (e.g., Serial, file, etc).
Example usage:
This is useful for efficient logging, binary protocols, or communication with systems that expect binary-encoded messages.
|
inlineoverridevirtual |
Reimplemented from MessageHandler.
|
inlineoverridevirtual |
Handle an incoming message (pure virtual).
This method should be implemented by derived classes to process messages.
| msg | The message to handle. |
Implements MessageHandler.
|
inlineoverridevirtual |
Reimplemented from MessageHandler.
|
inlineoverridevirtual |
Reimplemented from MessageHandler.