AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
SerialOutputAction Class Reference

Action that outputs text to serial console. More...

#include <serial_action.h>

Inheritance diagram for SerialOutputAction:
Action

Public Member Functions

 SerialOutputAction (std::string message)
 Constructs a SerialOutputAction.
 
void execute () override
 Executes the serial output action.
 
Action::Type getType () const override
 Gets the type of this action.
 
bool isSendAction () const override
 Checks if this action is a send action.
 
const std::string & getMessage () const
 Gets the message that will be output.
 
- Public Member Functions inherited from Action
void setName (const std::string &n)
 
const std::string & getName () const
 
bool hasName () const
 
virtual uint32_t getDelay () const
 
virtual bool isInProgress () const
 Returns true if the action is currently in progress (e.g.
 
virtual void getJsonProperties (JsonObject &json) const
 
virtual ~Action ()=default
 

Additional Inherited Members

- Public Types inherited from Action
enum class  Type : uint8_t {
  Unknown , SendString , SendChar , SendKey ,
  SendMediaKey , SerialOutput , Delayed
}
 

Detailed Description

Action that outputs text to serial console.

Example of a non-send action that demonstrates the extensibility of the Action hierarchy for debugging and logging purposes.

Definition at line 12 of file serial_action.h.

Constructor & Destructor Documentation

◆ SerialOutputAction()

SerialOutputAction::SerialOutputAction ( std::string  message)
explicit

Constructs a SerialOutputAction.

Constructs a SerialOutputAction with the specified message.

Parameters
messageThe message to output to serial console

Definition at line 11 of file serial_action.cpp.

Member Function Documentation

◆ execute()

void SerialOutputAction::execute ( )
overridevirtual

Executes the serial output action.

Outputs the configured message to the serial console.

Outputs the configured message to the serial console with an "ACTION: " prefix. This method handles both Arduino environment (Serial) and host test environment (std::cout).

Note
In Arduino environment, uses Serial.print/println
In host test environment, uses std::cout

Implements Action.

Definition at line 22 of file serial_action.cpp.

◆ getMessage()

const std::string & SerialOutputAction::getMessage ( ) const
inline

Gets the message that will be output.

Returns
The message string

Definition at line 55 of file serial_action.h.

◆ getType()

Action::Type SerialOutputAction::getType ( ) const
inlineoverridevirtual

Gets the type of this action.

Returns
Action type

Reimplemented from Action.

Definition at line 37 of file serial_action.h.

◆ isSendAction()

bool SerialOutputAction::isSendAction ( ) const
inlineoverridevirtual

Checks if this action is a send action.

Returns
false since this is not a send action

Reimplemented from Action.

Definition at line 48 of file serial_action.h.


The documentation for this class was generated from the following files: