Template Class MsgProcessor

Inheritance Relationships

Base Type

  • public Router

Class Documentation

template<typename Implementation, typename Router, typename MsgType>
class microparcel::MsgProcessor : public Router

A hardware abstracted implementation of a MessageProcessor. parse byte from hardware to route the message to the generated microparcel Router. (processXYZ(…) ) a send method makes the frame from message and send bytes via pure virtual sendFrame

sendFrame must be implemented, in Implementation. It sends data on the bus in microparcel format. all the processXYZ methods provided by the router must be implemented, in Implementation Implementation can also provide a way to poll data from a stream (eg UART) and call parse, in a run() for example

Usage: class ZeProcessor: public microparcel::MsgProcessor<ZeProcessor, ZeRouter, ZeMessage >{ virtual void sendFrame(uint8_t *buffer, uint8_t buffer_size){ // send data to the Bus, UART, etc… }

void run(){ parse(uart::getchar()); }

}

Public Functions

inline void send(const MsgType &inMsg)

Send a message generated via a Router::makeXYZ

inline void parse(uint8_t inByte)

interface for sending frame’s bytes Parse a byte with microparcel::Parser, and process it with the given Router