diff --git a/FlippR-Driver/contrib/Input_Config.json b/FlippR-Driver/contrib/Input_Config.json index 7a3fdd0..a8f54ea 100644 --- a/FlippR-Driver/contrib/Input_Config.json +++ b/FlippR-Driver/contrib/Input_Config.json @@ -25,3 +25,4 @@ }, "data" : 13 } +} \ No newline at end of file diff --git a/FlippR-Driver/contrib/Input_Matrix_Config.json b/FlippR-Driver/contrib/Input_Matrix_Config.json index a0c9766..be59ce7 100644 --- a/FlippR-Driver/contrib/Input_Matrix_Config.json +++ b/FlippR-Driver/contrib/Input_Matrix_Config.json @@ -189,3 +189,4 @@ }, } } +} \ No newline at end of file diff --git a/FlippR-Driver/include/Event.h b/FlippR-Driver/include/Event.h index 657342e..4d615c2 100644 --- a/FlippR-Driver/include/Event.h +++ b/FlippR-Driver/include/Event.h @@ -12,32 +12,29 @@ #include -namespace FlippR_Driver -{ -namespace Input -{ +namespace FlippR_Driver { + namespace Input { -class Event -{ -public: - Event(char address, int priority, std::string name); + class Event { + public: + Event(char address, int priority, std::string name); + + friend bool operator==(const Event &left, const Event &right); + + friend bool operator<(const Event &left, const Event &right) { + return left.priority < right.priority; + } + + + public: + std::string name; + char address; + int priority; + }; + + bool operator==(const Event &left, const Event &right); - friend bool operator==(const Event& left, const Event& right); - friend bool operator<(const Event& left, const Event& right) - { - return left.priority < right.priority; } - -public: - std::string name; - char address; - int priority; -}; - -bool operator==(const Event& left, const Event& right); - } - - #endif /* INPUTEVENT_H_ */ diff --git a/FlippR-Driver/include/IInputDriver.h b/FlippR-Driver/include/IInputDriver.h index c72959d..f1491a2 100644 --- a/FlippR-Driver/include/IInputDriver.h +++ b/FlippR-Driver/include/IInputDriver.h @@ -11,19 +11,19 @@ #include "IEventHandler.h" #include -namespace FlippR_Driver -{ -namespace Input { +namespace FlippR_Driver { + namespace Input { -class IInputDriver -{ -public: - virtual ~IInputDriver(){}; - virtual void register_event_handler(IEventHandler* handler) = 0; - virtual void unregister_event_handler(IEventHandler* handler) = 0; + class IInputDriver { + public: + virtual ~IInputDriver() {}; - virtual std::shared_ptr get_event(std::string name) = 0; -}; + virtual void register_event_handler(IEventHandler *handler) = 0; + + virtual void unregister_event_handler(IEventHandler *handler) = 0; + + virtual std::shared_ptr get_event(std::string name) = 0; + }; + } } - #endif /* SRC_INPUT_IINPUTDRIVER_H_ */ diff --git a/FlippR-Driver/lib/wiringPi/ads1115.c b/FlippR-Driver/lib/wiringPi/ads1115.c index 648e612..b142373 100644 --- a/FlippR-Driver/lib/wiringPi/ads1115.c +++ b/FlippR-Driver/lib/wiringPi/ads1115.c @@ -291,3 +291,4 @@ int ads1115Setup (const int pinBase, int i2cAddr) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/bmp180.c b/FlippR-Driver/lib/wiringPi/bmp180.c index bad4bb3..9c7019e 100644 --- a/FlippR-Driver/lib/wiringPi/bmp180.c +++ b/FlippR-Driver/lib/wiringPi/bmp180.c @@ -235,3 +235,4 @@ int bmp180Setup (const int pinBase) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/drcNet.c b/FlippR-Driver/lib/wiringPi/drcNet.c index 0964ff7..1149316 100644 --- a/FlippR-Driver/lib/wiringPi/drcNet.c +++ b/FlippR-Driver/lib/wiringPi/drcNet.c @@ -403,3 +403,4 @@ int drcSetupNet (const int pinBase, const int numPins, const char *ipAddress, co return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/drcSerial.c b/FlippR-Driver/lib/wiringPi/drcSerial.c index db7cc09..0ceac2d 100644 --- a/FlippR-Driver/lib/wiringPi/drcSerial.c +++ b/FlippR-Driver/lib/wiringPi/drcSerial.c @@ -194,3 +194,4 @@ int drcSetupSerial (const int pinBase, const int numPins, const char *device, co return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/ds18b20.c b/FlippR-Driver/lib/wiringPi/ds18b20.c index 533398e..2acb39d 100644 --- a/FlippR-Driver/lib/wiringPi/ds18b20.c +++ b/FlippR-Driver/lib/wiringPi/ds18b20.c @@ -144,3 +144,4 @@ int ds18b20Setup (const int pinBase, const char *deviceId) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/htu21d.c b/FlippR-Driver/lib/wiringPi/htu21d.c index 46c0fcb..de4af37 100644 --- a/FlippR-Driver/lib/wiringPi/htu21d.c +++ b/FlippR-Driver/lib/wiringPi/htu21d.c @@ -148,3 +148,4 @@ int htu21dSetup (const int pinBase) return (status == 0x02) ? TRUE : FALSE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/max31855.c b/FlippR-Driver/lib/wiringPi/max31855.c index d86cabd..f6acead 100644 --- a/FlippR-Driver/lib/wiringPi/max31855.c +++ b/FlippR-Driver/lib/wiringPi/max31855.c @@ -97,3 +97,4 @@ int max31855Setup (const int pinBase, int spiChannel) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/max5322.c b/FlippR-Driver/lib/wiringPi/max5322.c index e56b085..5fd6c5c 100644 --- a/FlippR-Driver/lib/wiringPi/max5322.c +++ b/FlippR-Driver/lib/wiringPi/max5322.c @@ -82,3 +82,4 @@ int max5322Setup (const int pinBase, int spiChannel) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp23008.c b/FlippR-Driver/lib/wiringPi/mcp23008.c index 71757a8..eddf43f 100644 --- a/FlippR-Driver/lib/wiringPi/mcp23008.c +++ b/FlippR-Driver/lib/wiringPi/mcp23008.c @@ -147,3 +147,4 @@ int mcp23008Setup (const int pinBase, const int i2cAddress) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp23016.c b/FlippR-Driver/lib/wiringPi/mcp23016.c index 928d9e5..dfcb4a4 100644 --- a/FlippR-Driver/lib/wiringPi/mcp23016.c +++ b/FlippR-Driver/lib/wiringPi/mcp23016.c @@ -162,3 +162,4 @@ int mcp23016Setup (const int pinBase, const int i2cAddress) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp23017.c b/FlippR-Driver/lib/wiringPi/mcp23017.c index 4c3952d..994e4e3 100644 --- a/FlippR-Driver/lib/wiringPi/mcp23017.c +++ b/FlippR-Driver/lib/wiringPi/mcp23017.c @@ -193,3 +193,4 @@ int mcp23017Setup (const int pinBase, const int i2cAddress) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp23s08.c b/FlippR-Driver/lib/wiringPi/mcp23s08.c index f293f3a..e3452f3 100644 --- a/FlippR-Driver/lib/wiringPi/mcp23s08.c +++ b/FlippR-Driver/lib/wiringPi/mcp23s08.c @@ -186,3 +186,4 @@ int mcp23s08Setup (const int pinBase, const int spiPort, const int devId) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp23s17.c b/FlippR-Driver/lib/wiringPi/mcp23s17.c index 42b0358..262b75a 100644 --- a/FlippR-Driver/lib/wiringPi/mcp23s17.c +++ b/FlippR-Driver/lib/wiringPi/mcp23s17.c @@ -233,3 +233,4 @@ int mcp23s17Setup (const int pinBase, const int spiPort, const int devId) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp3002.c b/FlippR-Driver/lib/wiringPi/mcp3002.c index 9ebf3e4..335c34a 100644 --- a/FlippR-Driver/lib/wiringPi/mcp3002.c +++ b/FlippR-Driver/lib/wiringPi/mcp3002.c @@ -74,3 +74,4 @@ int mcp3002Setup (const int pinBase, int spiChannel) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp3004.c b/FlippR-Driver/lib/wiringPi/mcp3004.c index be8383e..582ae8c 100644 --- a/FlippR-Driver/lib/wiringPi/mcp3004.c +++ b/FlippR-Driver/lib/wiringPi/mcp3004.c @@ -74,3 +74,4 @@ int mcp3004Setup (const int pinBase, int spiChannel) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp3422.c b/FlippR-Driver/lib/wiringPi/mcp3422.c index be14db6..5a5afcd 100644 --- a/FlippR-Driver/lib/wiringPi/mcp3422.c +++ b/FlippR-Driver/lib/wiringPi/mcp3422.c @@ -123,3 +123,4 @@ int mcp3422Setup (int pinBase, int i2cAddress, int sampleRate, int gain) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/mcp4802.c b/FlippR-Driver/lib/wiringPi/mcp4802.c index ef104ed..0cd2ac1 100644 --- a/FlippR-Driver/lib/wiringPi/mcp4802.c +++ b/FlippR-Driver/lib/wiringPi/mcp4802.c @@ -74,3 +74,4 @@ int mcp4802Setup (const int pinBase, int spiChannel) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/pcf8574.c b/FlippR-Driver/lib/wiringPi/pcf8574.c index e0b686a..399eb73 100644 --- a/FlippR-Driver/lib/wiringPi/pcf8574.c +++ b/FlippR-Driver/lib/wiringPi/pcf8574.c @@ -124,3 +124,4 @@ int pcf8574Setup (const int pinBase, const int i2cAddress) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/pcf8591.c b/FlippR-Driver/lib/wiringPi/pcf8591.c index 66c6255..a9c25fd 100644 --- a/FlippR-Driver/lib/wiringPi/pcf8591.c +++ b/FlippR-Driver/lib/wiringPi/pcf8591.c @@ -88,3 +88,4 @@ int pcf8591Setup (const int pinBase, const int i2cAddress) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/piHiPri.c b/FlippR-Driver/lib/wiringPi/piHiPri.c index d2f3b4e..9318e46 100644 --- a/FlippR-Driver/lib/wiringPi/piHiPri.c +++ b/FlippR-Driver/lib/wiringPi/piHiPri.c @@ -49,3 +49,4 @@ int piHiPri (const int pri) return sched_setscheduler (0, SCHED_RR, &sched) ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/pseudoPins.c b/FlippR-Driver/lib/wiringPi/pseudoPins.c index c2bf5e0..cf9c812 100644 --- a/FlippR-Driver/lib/wiringPi/pseudoPins.c +++ b/FlippR-Driver/lib/wiringPi/pseudoPins.c @@ -93,3 +93,4 @@ int pseudoPinsSetup (const int pinBase) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/rht03.c b/FlippR-Driver/lib/wiringPi/rht03.c index 1129cfd..05a5890 100644 --- a/FlippR-Driver/lib/wiringPi/rht03.c +++ b/FlippR-Driver/lib/wiringPi/rht03.c @@ -250,3 +250,4 @@ int rht03Setup (const int pinBase, const int piPin) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/sn3218.c b/FlippR-Driver/lib/wiringPi/sn3218.c index d9b9113..c8cb272 100644 --- a/FlippR-Driver/lib/wiringPi/sn3218.c +++ b/FlippR-Driver/lib/wiringPi/sn3218.c @@ -73,3 +73,4 @@ int sn3218Setup (const int pinBase) return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/softPwm.c b/FlippR-Driver/lib/wiringPi/softPwm.c index d99fa00..cb887f3 100644 --- a/FlippR-Driver/lib/wiringPi/softPwm.c +++ b/FlippR-Driver/lib/wiringPi/softPwm.c @@ -181,3 +181,4 @@ void softPwmStop (int pin) } } } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/softServo.c b/FlippR-Driver/lib/wiringPi/softServo.c index 9de9f4f..1b7082c 100644 --- a/FlippR-Driver/lib/wiringPi/softServo.c +++ b/FlippR-Driver/lib/wiringPi/softServo.c @@ -209,3 +209,4 @@ int softServoSetup (int p0, int p1, int p2, int p3, int p4, int p5, int p6, int return piThreadCreate (softServoThread) ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/softTone.c b/FlippR-Driver/lib/wiringPi/softTone.c index e2fb737..60b295c 100644 --- a/FlippR-Driver/lib/wiringPi/softTone.c +++ b/FlippR-Driver/lib/wiringPi/softTone.c @@ -148,3 +148,4 @@ void softToneStop (int pin) digitalWrite (pin, LOW) ; } } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/sr595.c b/FlippR-Driver/lib/wiringPi/sr595.c index 8280618..86c06f9 100644 --- a/FlippR-Driver/lib/wiringPi/sr595.c +++ b/FlippR-Driver/lib/wiringPi/sr595.c @@ -107,3 +107,4 @@ int sr595Setup (const int pinBase, const int numPins, return TRUE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/wiringPi.c b/FlippR-Driver/lib/wiringPi/wiringPi.c index bd1a369..c6d896c 100644 --- a/FlippR-Driver/lib/wiringPi/wiringPi.c +++ b/FlippR-Driver/lib/wiringPi/wiringPi.c @@ -2371,3 +2371,4 @@ int wiringPiSetupSys (void) return 0 ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/wiringPiI2C.c b/FlippR-Driver/lib/wiringPi/wiringPiI2C.c index b0ee5d3..d0dafb8 100644 --- a/FlippR-Driver/lib/wiringPi/wiringPiI2C.c +++ b/FlippR-Driver/lib/wiringPi/wiringPiI2C.c @@ -231,3 +231,4 @@ int wiringPiI2CSetup (const int devId) return wiringPiI2CSetupInterface (device, devId) ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/wiringPiSPI.c b/FlippR-Driver/lib/wiringPi/wiringPiSPI.c index 022b99f..121bd08 100644 --- a/FlippR-Driver/lib/wiringPi/wiringPiSPI.c +++ b/FlippR-Driver/lib/wiringPi/wiringPiSPI.c @@ -135,3 +135,4 @@ int wiringPiSPISetup (int channel, int speed) { return wiringPiSPISetupMode (channel, speed, 0) ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/wiringSerial.c b/FlippR-Driver/lib/wiringPi/wiringSerial.c index e1587ad..6f7efa6 100644 --- a/FlippR-Driver/lib/wiringPi/wiringSerial.c +++ b/FlippR-Driver/lib/wiringPi/wiringSerial.c @@ -223,3 +223,4 @@ int serialGetchar (const int fd) return ((int)x) & 0xFF ; } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/wiringShift.c b/FlippR-Driver/lib/wiringPi/wiringShift.c index 3df94e8..73437cb 100644 --- a/FlippR-Driver/lib/wiringPi/wiringShift.c +++ b/FlippR-Driver/lib/wiringPi/wiringShift.c @@ -81,3 +81,4 @@ void shiftOut (uint8_t dPin, uint8_t cPin, uint8_t order, uint8_t val) digitalWrite (cPin, LOW) ; } } +} \ No newline at end of file diff --git a/FlippR-Driver/lib/wiringPi/wpiExtensions.c b/FlippR-Driver/lib/wiringPi/wpiExtensions.c index 53fafc0..1d5d03d 100644 --- a/FlippR-Driver/lib/wiringPi/wpiExtensions.c +++ b/FlippR-Driver/lib/wiringPi/wpiExtensions.c @@ -926,3 +926,4 @@ int loadWPiExtension (char *progName, char *extensionData, int printErrors) fprintf (stderr, "%s: extension %s not found", progName, extension) ; return FALSE ; } +} \ No newline at end of file diff --git a/FlippR-Driver/src/input/Detector.cpp b/FlippR-Driver/src/input/Detector.cpp index d71fae6..3868d1c 100644 --- a/FlippR-Driver/src/input/Detector.cpp +++ b/FlippR-Driver/src/input/Detector.cpp @@ -67,3 +67,4 @@ bool Detector::check_inputs(char& address) } } +} \ No newline at end of file diff --git a/FlippR-Driver/src/input/Detector.h b/FlippR-Driver/src/input/Detector.h index 4a33e14..03c6357 100644 --- a/FlippR-Driver/src/input/Detector.h +++ b/FlippR-Driver/src/input/Detector.h @@ -52,7 +52,5 @@ private: }; } - - - -#endif /* DETECTOR_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/ErrorEvent.hpp b/FlippR-Driver/src/input/ErrorEvent.hpp index a451381..55353a4 100644 --- a/FlippR-Driver/src/input/ErrorEvent.hpp +++ b/FlippR-Driver/src/input/ErrorEvent.hpp @@ -10,18 +10,15 @@ #include "Event.h" -namespace FlippR_Driver -{ -namespace Input -{ +namespace FlippR_Driver { + namespace Input { -class ErrorEvent : public Event -{ -public: - ErrorEvent() : - Event(0, 0, "ERROR") - {} -}; + class ErrorEvent : public Event { + public: + ErrorEvent() : + Event(0, 0, "ERROR") {} + }; + } } -#endif /* SRC_INPUT_ERROREVENT_HPP_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/Event.cpp b/FlippR-Driver/src/input/Event.cpp index 8e3a199..c4e525f 100644 --- a/FlippR-Driver/src/input/Event.cpp +++ b/FlippR-Driver/src/input/Event.cpp @@ -25,3 +25,4 @@ bool operator==(const Event& left, const Event& right) } } +} \ No newline at end of file diff --git a/FlippR-Driver/src/input/EventHandler.cpp b/FlippR-Driver/src/input/EventHandler.cpp index a268bb2..c053113 100644 --- a/FlippR-Driver/src/input/EventHandler.cpp +++ b/FlippR-Driver/src/input/EventHandler.cpp @@ -33,3 +33,4 @@ namespace Input } } +} \ No newline at end of file diff --git a/FlippR-Driver/src/input/EventHandler.h b/FlippR-Driver/src/input/EventHandler.h index 8a7a6a7..3711653 100644 --- a/FlippR-Driver/src/input/EventHandler.h +++ b/FlippR-Driver/src/input/EventHandler.h @@ -36,4 +36,5 @@ private: } -#endif /* INPUTEVENTHANDLER_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/EventNotifier.cpp b/FlippR-Driver/src/input/EventNotifier.cpp index e9254e9..a948689 100644 --- a/FlippR-Driver/src/input/EventNotifier.cpp +++ b/FlippR-Driver/src/input/EventNotifier.cpp @@ -82,3 +82,4 @@ void EventNotifier::notify() } } +} \ No newline at end of file diff --git a/FlippR-Driver/src/input/EventNotifier.h b/FlippR-Driver/src/input/EventNotifier.h index 322c887..62427bc 100644 --- a/FlippR-Driver/src/input/EventNotifier.h +++ b/FlippR-Driver/src/input/EventNotifier.h @@ -53,4 +53,5 @@ private: -#endif /* SRC_INPUT_EVENTNOTIFIER_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/IDetector.h b/FlippR-Driver/src/input/IDetector.h index c74e0bb..65966ac 100644 --- a/FlippR-Driver/src/input/IDetector.h +++ b/FlippR-Driver/src/input/IDetector.h @@ -23,4 +23,5 @@ public: } -#endif /* SRC_INPUT_IDETECTOR_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/IEventNotifier.h b/FlippR-Driver/src/input/IEventNotifier.h index fa3fc6f..2b3fa7a 100644 --- a/FlippR-Driver/src/input/IEventNotifier.h +++ b/FlippR-Driver/src/input/IEventNotifier.h @@ -29,4 +29,5 @@ public: }; } -#endif /* SRC_INPUT_IEVENTNOTIFIER_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/InputDriver.cpp b/FlippR-Driver/src/input/InputDriver.cpp index e0d478c..3d81544 100644 --- a/FlippR-Driver/src/input/InputDriver.cpp +++ b/FlippR-Driver/src/input/InputDriver.cpp @@ -10,42 +10,36 @@ #include -namespace FlippR_Driver -{ -namespace Input -{ +namespace FlippR_Driver { + namespace Input { -InputDriver::InputDriver(std::shared_ptr event_notifier, std::unique_ptr detector, std::map> events) : - event_notifier(event_notifier), - detector(std::move(detector)), - events(events) -{ - CLOG(INFO, INPUT_LOGGER) << "Created InputDriver"; -} + InputDriver::InputDriver(std::shared_ptr event_notifier, std::unique_ptr detector, + std::map> events) : + event_notifier(event_notifier), + detector(std::move(detector)), + events(events) { + CLOG(INFO, INPUT_LOGGER) << "Created InputDriver"; + } -void InputDriver::register_event_handler(IEventHandler* handler) -{ - this->event_notifier->register_event_handler(handler); -} + void InputDriver::register_event_handler(IEventHandler *handler) { + this->event_notifier->register_event_handler(handler); + } -void InputDriver::unregister_event_handler(IEventHandler* handler) -{ - this->event_notifier->unregister_event_handler(handler); -} + void InputDriver::unregister_event_handler(IEventHandler *handler) { + this->event_notifier->unregister_event_handler(handler); + } -std::shared_ptr InputDriver::get_event(std::string name) -{ - std::shared_ptr event(new ErrorEvent()); - try - { - event = this->events.at(name); + std::shared_ptr InputDriver::get_event(std::string name) { + std::shared_ptr event(new ErrorEvent()); + try { + event = this->events.at(name); + } + catch (std::out_of_range &e) { + CLOG_N_TIMES(1, WARNING, OUTPUT_LOGGER) << "Did not found event " << name << " please check config file!"; + } + + return event; + } } - catch(std::out_of_range& e) - { - CLOG_N_TIMES(1, WARNING, OUTPUT_LOGGER) << "Did not found event " << name << " please check config file!"; - } - - return event; -} } diff --git a/FlippR-Driver/src/input/InputDriver.h b/FlippR-Driver/src/input/InputDriver.h index 2ea3f14..02e27de 100644 --- a/FlippR-Driver/src/input/InputDriver.h +++ b/FlippR-Driver/src/input/InputDriver.h @@ -38,4 +38,5 @@ private: } -#endif /* SRC_INPUT_INPUTDRIVER_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/input/InputDriverFactory.cpp b/FlippR-Driver/src/input/InputDriverFactory.cpp index 4bdb52a..c78a8a3 100644 --- a/FlippR-Driver/src/input/InputDriverFactory.cpp +++ b/FlippR-Driver/src/input/InputDriverFactory.cpp @@ -66,3 +66,4 @@ namespace Input { } } } +} \ No newline at end of file diff --git a/FlippR-Driver/src/input/InputDriverFactory.h b/FlippR-Driver/src/input/InputDriverFactory.h index d4435ff..6b285f4 100644 --- a/FlippR-Driver/src/input/InputDriverFactory.h +++ b/FlippR-Driver/src/input/InputDriverFactory.h @@ -32,4 +32,5 @@ private: static void create_input_events(nlohmann::json matrix_config, std::map> address_event_map, std::map> name_event_map); }; } -#endif /* INPUTFACTORY_H_ */ +} +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/CabinetItem.h b/FlippR-Driver/src/output/CabinetItem.h index b06f78c..a857538 100644 --- a/FlippR-Driver/src/output/CabinetItem.h +++ b/FlippR-Driver/src/output/CabinetItem.h @@ -30,4 +30,4 @@ protected: } /* namespace output */ -#endif /* _SRC_OUTPUT_CABINETITEM_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/Display.h b/FlippR-Driver/src/output/Display.h index 0cd7444..c7c18df 100644 --- a/FlippR-Driver/src/output/Display.h +++ b/FlippR-Driver/src/output/Display.h @@ -30,4 +30,4 @@ private: } /* namespace output */ -#endif /* _SRC_OUTPUT_DISPLAY_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/DisplayController.cpp b/FlippR-Driver/src/output/DisplayController.cpp index 1c27f99..66df9fa 100644 --- a/FlippR-Driver/src/output/DisplayController.cpp +++ b/FlippR-Driver/src/output/DisplayController.cpp @@ -20,3 +20,4 @@ DisplayController::~DisplayController() { } } + diff --git a/FlippR-Driver/src/output/DisplayController.h b/FlippR-Driver/src/output/DisplayController.h index 4fffdda..ca10701 100644 --- a/FlippR-Driver/src/output/DisplayController.h +++ b/FlippR-Driver/src/output/DisplayController.h @@ -27,4 +27,4 @@ private: }; } -#endif /* _SRC_OUTPUT_DISPLAYCONTROLLER_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/ICabinetItem.h b/FlippR-Driver/src/output/ICabinetItem.h index 316c23f..cda9643 100644 --- a/FlippR-Driver/src/output/ICabinetItem.h +++ b/FlippR-Driver/src/output/ICabinetItem.h @@ -18,4 +18,4 @@ class ICabinetItem }; -#endif /* _SRC_OUTPUT_ICABINETITEM_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/IDisplay.h b/FlippR-Driver/src/output/IDisplay.h index 8f75ccc..2afd4fd 100644 --- a/FlippR-Driver/src/output/IDisplay.h +++ b/FlippR-Driver/src/output/IDisplay.h @@ -22,4 +22,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_IDISPLAY_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/IDisplayController.h b/FlippR-Driver/src/output/IDisplayController.h index 70cf80a..d05f85f 100644 --- a/FlippR-Driver/src/output/IDisplayController.h +++ b/FlippR-Driver/src/output/IDisplayController.h @@ -18,4 +18,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_IDISPLAYCONTROLLER_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/ILamp.h b/FlippR-Driver/src/output/ILamp.h index e246896..3e067f2 100644 --- a/FlippR-Driver/src/output/ILamp.h +++ b/FlippR-Driver/src/output/ILamp.h @@ -14,4 +14,4 @@ class ILamp }; -#endif /* _SRC_OUTPUT_ILAMP_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/IOutputDriver.h b/FlippR-Driver/src/output/IOutputDriver.h index caf50db..f77d71c 100644 --- a/FlippR-Driver/src/output/IOutputDriver.h +++ b/FlippR-Driver/src/output/IOutputDriver.h @@ -18,4 +18,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_IOUTPUTDRIVER_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/ISolenoid.h b/FlippR-Driver/src/output/ISolenoid.h index dbae012..8407ecd 100644 --- a/FlippR-Driver/src/output/ISolenoid.h +++ b/FlippR-Driver/src/output/ISolenoid.h @@ -15,4 +15,4 @@ class ISolenoid -#endif /* _SRC_OUTPUT_ISOLENOID_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/ISound.h b/FlippR-Driver/src/output/ISound.h index fa8ac60..b2964e3 100644 --- a/FlippR-Driver/src/output/ISound.h +++ b/FlippR-Driver/src/output/ISound.h @@ -20,4 +20,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_ISOUND_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/Lamp.h b/FlippR-Driver/src/output/Lamp.h index d3cb2dd..1792fdb 100644 --- a/FlippR-Driver/src/output/Lamp.h +++ b/FlippR-Driver/src/output/Lamp.h @@ -20,4 +20,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_LAMP_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/OutputDriver.h b/FlippR-Driver/src/output/OutputDriver.h index 7a87704..9b9b60d 100644 --- a/FlippR-Driver/src/output/OutputDriver.h +++ b/FlippR-Driver/src/output/OutputDriver.h @@ -20,4 +20,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_OUTPUTDRIVER_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/Solenoid.h b/FlippR-Driver/src/output/Solenoid.h index bb7bc10..87de4c7 100644 --- a/FlippR-Driver/src/output/Solenoid.h +++ b/FlippR-Driver/src/output/Solenoid.h @@ -20,4 +20,4 @@ public: } /* namespace output */ -#endif /* _SRC_OUTPUT_SOLENOID_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/output/Sound.h b/FlippR-Driver/src/output/Sound.h index 04f3ebc..a797d02 100644 --- a/FlippR-Driver/src/output/Sound.h +++ b/FlippR-Driver/src/output/Sound.h @@ -27,4 +27,4 @@ private: } /* namespace output */ -#endif /* _SRC_OUTPUT_SOUND_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/BlockingQueue.hpp b/FlippR-Driver/src/utilities/BlockingQueue.hpp index 5d431e5..c76c6af 100644 --- a/FlippR-Driver/src/utilities/BlockingQueue.hpp +++ b/FlippR-Driver/src/utilities/BlockingQueue.hpp @@ -46,4 +46,4 @@ public: -#endif /* SRC_UTILITIES_BLOCKINGQUEUE_HPP_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/GPIOInterface.h b/FlippR-Driver/src/utilities/GPIOInterface.h index b854252..7907d37 100644 --- a/FlippR-Driver/src/utilities/GPIOInterface.h +++ b/FlippR-Driver/src/utilities/GPIOInterface.h @@ -15,7 +15,6 @@ #include #include -//#include "config.h" class GPIOInterface { @@ -39,4 +38,4 @@ public: -#endif /* SRC_UTILITIES_GPIOINTERFACE_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/IBlockingQueue.h b/FlippR-Driver/src/utilities/IBlockingQueue.h index aa38e68..20b0777 100644 --- a/FlippR-Driver/src/utilities/IBlockingQueue.h +++ b/FlippR-Driver/src/utilities/IBlockingQueue.h @@ -19,4 +19,4 @@ public: }; -#endif /* SRC_UTILITIES_IBLOCKINGQUEUE_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/IInputGPIOInterface.h b/FlippR-Driver/src/utilities/IInputGPIOInterface.h index 67c878a..e40a7b3 100644 --- a/FlippR-Driver/src/utilities/IInputGPIOInterface.h +++ b/FlippR-Driver/src/utilities/IInputGPIOInterface.h @@ -17,6 +17,4 @@ public: virtual bool read_data(char pin) = 0; }; - - -#endif /* SRC_UTILITIES_INPUTGPIOINTERFACE_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/InputGPIOInterface.h b/FlippR-Driver/src/utilities/InputGPIOInterface.h index 4bb6cc7..f2f7d4a 100644 --- a/FlippR-Driver/src/utilities/InputGPIOInterface.h +++ b/FlippR-Driver/src/utilities/InputGPIOInterface.h @@ -34,4 +34,4 @@ private: char data_address; }; -#endif /* SRC_UTILITIES_INPUTGPIOINTERFACE_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/LoggerFactory.h b/FlippR-Driver/src/utilities/LoggerFactory.h index ccc500a..b596a4e 100644 --- a/FlippR-Driver/src/utilities/LoggerFactory.h +++ b/FlippR-Driver/src/utilities/LoggerFactory.h @@ -15,4 +15,4 @@ namespace LoggerFactory void CreateInputLogger(); }; -#endif /* SRC_UTILITIES_LOGGERFACTORY_HPP_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/src/utilities/OutputGPIOInterface.h b/FlippR-Driver/src/utilities/OutputGPIOInterface.h index 705ccdc..0c54199 100644 --- a/FlippR-Driver/src/utilities/OutputGPIOInterface.h +++ b/FlippR-Driver/src/utilities/OutputGPIOInterface.h @@ -16,4 +16,4 @@ class OutputGPIOInterface : GPIOInterface }; -#endif /* SRC_UTILITIES_OUTPUTGPIOINTERFACE_H_ */ +#endif \ No newline at end of file diff --git a/FlippR-Driver/tests/input/TestDetector.cpp b/FlippR-Driver/tests/input/TestDetector.cpp index f6340ba..f64dc74 100644 --- a/FlippR-Driver/tests/input/TestDetector.cpp +++ b/FlippR-Driver/tests/input/TestDetector.cpp @@ -23,9 +23,8 @@ using namespace fakeit; -using namespace FlippR_Driver -{ -namespace Input; +using namespace FlippR_Driver; +using namespace Input; SCENARIO("Creating a Detector object", "") diff --git a/FlippR-Driver/tests/input/TestEventNotifier.cpp b/FlippR-Driver/tests/input/TestEventNotifier.cpp index df81f12..508c66f 100644 --- a/FlippR-Driver/tests/input/TestEventNotifier.cpp +++ b/FlippR-Driver/tests/input/TestEventNotifier.cpp @@ -20,9 +20,8 @@ #include "input/EventNotifier.h" -using namespace FlippR_Driver -{ -namespace Input; +using namespace FlippR_Driver; +using namespace Input; using namespace fakeit; SCENARIO("An EventNotifier gets created", "[construction]") diff --git a/FlippR-Driver/tests/input/TestInputDriver.cpp b/FlippR-Driver/tests/input/TestInputDriver.cpp index 2c6038d..3677acb 100644 --- a/FlippR-Driver/tests/input/TestInputDriver.cpp +++ b/FlippR-Driver/tests/input/TestInputDriver.cpp @@ -19,9 +19,8 @@ using namespace fakeit; -using namespace FlippR_Driver -{ -namespace Input; +using namespace FlippR_Driver; +using namespace Input; SCENARIO("An InputDriver gets created", "[construction}") { diff --git a/FlippR-Driver/tests/input/TestInputDriverFactory.cpp b/FlippR-Driver/tests/input/TestInputDriverFactory.cpp deleted file mode 100644 index 1630632..0000000 --- a/FlippR-Driver/tests/input/TestInputDriverFactory.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * TestInputDriverFactory.cpp - * - * Created on: Jul 11, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Oliver Martin, Dr. Franca Rupprecht - */ - -#include "catch.hpp" -#include "fakeit.hpp" - -#include "utilities/LoggerFactory.h" - - -// testing purposes -#define private public - -#include "input/EventNotifier.h" - -using namespace FlippR_Driver -{ -namespace Input; -using namespace fakeit; - -SCENARIO("The factory creates a InputDriver") -{ - -} diff --git a/FlippR-Driver/tests/input/mocks/EventHandlerMock.hpp b/FlippR-Driver/tests/input/mocks/EventHandlerMock.hpp deleted file mode 100644 index 452637f..0000000 --- a/FlippR-Driver/tests/input/mocks/EventHandlerMock.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * EventHandlerMock.hpp - * - * Created on: May 31, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#ifndef SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_ -#define SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_ - -namespace FlippR_Driver -{ -namespace Input -{ -class EventHandler; -class Event; - -class EventHandlerMock : EventHandler -{ -public: - void handle(Event& event) override - { - - } -}; - -} - -#endif /* SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_ */ diff --git a/FlippR-Driver/tests/input/mocks/EventNotifierMock.hpp b/FlippR-Driver/tests/input/mocks/EventNotifierMock.hpp deleted file mode 100644 index 6a8ccb5..0000000 --- a/FlippR-Driver/tests/input/mocks/EventNotifierMock.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * EventNotfierMock.hpp - * - * Created on: May 31, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#ifndef SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_ -#define SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_ - -namespace FlippR_Driver -{ -namespace Input -{ -class EventNotifier; -class EventHandler; - -class EventNotifierMock : EventNotifier -{ -public: - EventNotifierMock() : - registered(false) - {} - - void register_event_handler(EventHandler* handler) override - { - registered = true; - } - - void unregister_event_handler(EventHandler* handler) override - { - registered = false; - } - -public: - bool registered; -}; - -} - -#endif /* SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_ */ diff --git a/FlippR-Driver/tests/input/mocks/InputDriverMock.hpp b/FlippR-Driver/tests/input/mocks/InputDriverMock.hpp deleted file mode 100644 index e03d254..0000000 --- a/FlippR-Driver/tests/input/mocks/InputDriverMock.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * InputDriverMock.hpp - * - * Created on: May 31, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#ifndef SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_ -#define SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_ - -namespace FlippR_Driver -{ -namespace Input -{ -class InputDriver; -class EventHandler; - -class InputDriverMock : InputDriver -{ -public: - InputDriverMock() : - registered(false) - {} - - void register_event_handler(EventHandler* handler) - { - registered = true; - } - -public: - bool registered; -}; - -} - -#endif /* SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_ */