/* This is the protocol list handler. It holds an instance of all known protocols. So include here the .hpp, and add a new element to the protos vector in the constructor. That's all you need to do here if you wanna add a new proto. @htotoo */ #include "fprotolistgeneral.hpp" #include "w-nexus-th.hpp" #include "w-acurite592txr.hpp" #include "w-acurite606tx.hpp" #include "w-acurite609tx.hpp" #include "w-ambient.hpp" #include "w-auriol-ahfl.hpp" #include "w-auriol-th.hpp" #include "w-gt-wt-02.hpp" #include "w-gt-wt-03.hpp" #include "w-infactory.hpp" #include "w-lacrosse-tx.hpp" #include "w-lacrosse-tx141thbv2.hpp" #include "w-oregon2.hpp" #include "w-oregon3.hpp" #include "w-oregonv1.hpp" #include "w-thermoprotx4.hpp" #include "w-tx8300.hpp" #include "w-wendox-w6726.hpp" #include "w-acurite986.hpp" #include #include #include "portapack_shared_memory.hpp" #ifndef __FPROTO_PROTOLISTWTH_H__ #define __FPROTO_PROTOLISTWTH_H__ class WeatherProtos : public FProtoListGeneral { public: WeatherProtos() { // add protos protos.push_back(std::make_unique()); // 1 protos.push_back(std::make_unique()); // 2 protos.push_back(std::make_unique()); // 3 protos.push_back(std::make_unique()); // 4 protos.push_back(std::make_unique()); // 5 protos.push_back(std::make_unique()); // 6 protos.push_back(std::make_unique()); // 7 protos.push_back(std::make_unique()); // 8 protos.push_back(std::make_unique()); // 9 protos.push_back(std::make_unique()); // 10 protos.push_back(std::make_unique()); // 11 protos.push_back(std::make_unique()); // 12 protos.push_back(std::make_unique()); // 13 protos.push_back(std::make_unique()); // 14 protos.push_back(std::make_unique()); // 15 protos.push_back(std::make_unique()); // 16 protos.push_back(std::make_unique()); // 17 protos.push_back(std::make_unique()); // 18 protos.push_back(std::make_unique()); // 19 // set callback for them for (const auto& obj : protos) { obj->setCallback(callbackTarget); } } static void callbackTarget(FProtoWeatherBase* instance) { WeatherDataMessage packet_message{instance->getSensorType(), instance->getSensorId(), instance->getTemp(), instance->getHumidity(), instance->getBattLow(), instance->getChannel(), instance->getButton()}; shared_memory.application_queue.push(packet_message); } void feed(bool level, uint32_t duration) { for (const auto& obj : protos) { obj->feed(level, duration); } } protected: std::vector> protos{}; }; #endif