Messaging - lms-org/lms GitHub Wiki

Messaging is a framework feature that allows modules to communicate with each other by messages. Messages are not transferred immediately but instead are collected during one cycle and are then transmitted in the next cycle.

Messaging can be accessed with messaging() inside modules.

Send messages

messaging()->send("rc_mode", "true");

Receive messages

for(const std::string &msg : messaging()->receive("rc_mode")) {
  if(msg == "true") {
    logger.debug() << "RC mode on";
  } else if(msg == "false") {
    logger.debug() << "RC mode off";
  }
}