Prusa3d Marlin fork
Public Member Functions | Public Attributes | List of all members
modules::protocol::RequestMsg Struct Reference

A request message - requests are being sent by the printer into the MMU.

#include <mmu2_protocol.h>

Public Member Functions

constexpr uint8_t ComputeCRC8 () const
 
constexpr RequestMsg (RequestMsgCodes code, uint8_t value)
 
constexpr RequestMsg (RequestMsgCodes code, uint8_t address, uint16_t value)
 
constexpr uint8_t CRC () const
 

Public Attributes

RequestMsgCodes code
 code of the request message
 
uint8_t value
 value of the request message or address of variable to read/write
 
uint16_t value2
 in case or write messages - value to be written into the register
 
uint8_t crc8
 

Constructor & Destructor Documentation

◆ RequestMsg() [1/2]

constexpr modules::protocol::RequestMsg::RequestMsg ( RequestMsgCodes  code,
uint8_t  value 
)
inlineconstexpr
Parameters
codeof the request message
valueof the request message

◆ RequestMsg() [2/2]

constexpr modules::protocol::RequestMsg::RequestMsg ( RequestMsgCodes  code,
uint8_t  address,
uint16_t  value 
)
inlineconstexpr

Intended for write requests

Parameters
codeof the request message ('W')
addressof the register
valueto write into the register

Member Data Documentation

◆ crc8

uint8_t modules::protocol::RequestMsg::crc8

CRC8 check - please note we abuse this byte for CRC of ResponseMsgs as well. The crc8 byte itself is not added into the CRC computation (obviously ;) ) Beware - adding any members of this data structure may need changing the way CRC is being computed!


The documentation for this struct was generated from the following file: