Relocate 'input' folder.

This commit is contained in:
Balazs Kelemen 2022-01-13 14:06:10 +01:00
parent 33f08364e4
commit 41de8a1309
8 changed files with 10 additions and 10 deletions

View File

@ -6,9 +6,9 @@ InputBroker::InputBroker()
{ {
}; };
void InputBroker::registerOrigin(Observable<const InputEvent *> *origin) void InputBroker::registerSource(Observable<const InputEvent *> *source)
{ {
this->inputEventObserver.observe(origin); this->inputEventObserver.observe(source);
} }
int InputBroker::handleInputEvent(const InputEvent *event) int InputBroker::handleInputEvent(const InputEvent *event)

View File

@ -2,7 +2,7 @@
#include "Observer.h" #include "Observer.h"
typedef struct _InputEvent { typedef struct _InputEvent {
const char* origin; const char* source;
char inputEvent; char inputEvent;
} InputEvent; } InputEvent;
class InputBroker : class InputBroker :
@ -13,7 +13,7 @@ class InputBroker :
public: public:
InputBroker(); InputBroker();
void registerOrigin(Observable<const InputEvent *> *origin); void registerSource(Observable<const InputEvent *> *source);
protected: protected:
int handleInputEvent(const InputEvent *event); int handleInputEvent(const InputEvent *event);

View File

@ -40,7 +40,7 @@ int32_t RotaryEncoderInterruptBase::runOnce()
{ {
InputEvent e; InputEvent e;
e.inputEvent = InputEventChar_NULL; e.inputEvent = InputEventChar_NULL;
e.origin = this->_originName; e.source = this->_originName;
if (this->action == ROTARY_ACTION_PRESSED) if (this->action == ROTARY_ACTION_PRESSED)
{ {

View File

@ -34,7 +34,7 @@ void RotaryEncoderInterruptImpl1::init()
RotaryEncoderInterruptImpl1::handleIntA, RotaryEncoderInterruptImpl1::handleIntA,
RotaryEncoderInterruptImpl1::handleIntB, RotaryEncoderInterruptImpl1::handleIntB,
RotaryEncoderInterruptImpl1::handleIntPressed); RotaryEncoderInterruptImpl1::handleIntPressed);
inputBroker->registerOrigin(this); inputBroker->registerSource(this);
} }
void RotaryEncoderInterruptImpl1::handleIntA() void RotaryEncoderInterruptImpl1::handleIntA()

View File

@ -82,10 +82,10 @@ int CannedMessagePlugin::handleInputEvent(const InputEvent *event)
{ {
if ( if (
(strlen(radioConfig.preferences.canned_message_plugin_allow_input_origin) > 0) && (strlen(radioConfig.preferences.canned_message_plugin_allow_input_origin) > 0) &&
(strcmp(radioConfig.preferences.canned_message_plugin_allow_input_origin, event->origin) != 0) && (strcmp(radioConfig.preferences.canned_message_plugin_allow_input_origin, event->source) != 0) &&
(strcmp(radioConfig.preferences.canned_message_plugin_allow_input_origin, "_any") != 0)) (strcmp(radioConfig.preferences.canned_message_plugin_allow_input_origin, "_any") != 0))
{ {
// Event origin is not accepted. // Event source is not accepted.
return 0; return 0;
} }

View File

@ -1,4 +1,6 @@
#include "configuration.h" #include "configuration.h"
#include "input/InputBroker.h"
#include "input/RotaryEncoderInterruptImpl1.h"
#include "plugins/ExternalNotificationPlugin.h" #include "plugins/ExternalNotificationPlugin.h"
#include "plugins/NodeInfoPlugin.h" #include "plugins/NodeInfoPlugin.h"
#include "plugins/PositionPlugin.h" #include "plugins/PositionPlugin.h"
@ -9,8 +11,6 @@
#include "plugins/RoutingPlugin.h" #include "plugins/RoutingPlugin.h"
#include "plugins/AdminPlugin.h" #include "plugins/AdminPlugin.h"
#include "plugins/CannedMessagePlugin.h" #include "plugins/CannedMessagePlugin.h"
#include "plugins/input/InputBroker.h"
#include "plugins/input/RotaryEncoderInterruptImpl1.h"
#ifndef NO_ESP32 #ifndef NO_ESP32
#include "plugins/esp32/SerialPlugin.h" #include "plugins/esp32/SerialPlugin.h"
#include "plugins/esp32/EnvironmentalMeasurementPlugin.h" #include "plugins/esp32/EnvironmentalMeasurementPlugin.h"