MoonTalkModule
Source:
MoonTalkModule.h
MoonTalkModule¶
src/core/system/MoonTalkModule.h:29Inherits:
MoonModule
A MoonCloud child with its own consent, sharing a chip model implying nothing more.
Everything sent is public and permanent: no private message, and no delete. The module never posts on its own, so a message exists because somebody typed it.
Public Methods¶
virtual inline void defineControls() override
: Declare the two consents, the message box, and the button that publishes.
virtual inline void setup() override
: Publish the consent explanation, a message being sent only when the button is pressed.
inline void refreshStatus()
: Say what this setting exchanges, on the status slot rather than only in the policy.
virtual inline void onControlChanged(const char * name) override
: Refresh the explanation on a consent change, and publish on the button.
inline const char * deviceName() const
: The device's name, read at send time so a rename takes effect on the next message.
inline bool consent() const
: Whether posting is allowed at all.
inline bool sharesName() const
: Whether the device name rides along, which needs both consents.
inline const char * message() const
: What is currently typed in the box.
inline void setConsentForTest(bool yes)
: Set the posting consent directly, so a test needs no UI write.
inline void setShareNameForTest(bool share)
: Set the name consent directly, so a test can walk the matrix.
inline void setMessageForTest(const char * text)
: Put text in the box the way a control write does, so a test can press send without a UI.
More info¶
Two consents govern it: one allows posting, the other shares the device name. The second is off by default, a name saying more than an identifier does. Without it a message carries the first characters of the installation id.
Reading sends no identifier, and happens only while consent is on. There is no authentication, so a sender id can be fabricated by hand. That is acceptable where nothing is gated on identity, and is stated in the policy.