mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-15 15:59:39 -05:00
Added weather station app with 18 protocol parsers (#1607)
* Added weather station app with 18 protocol parsers * Fix button and formatting * Set BW to 1.75m, changed to us in dsp part
This commit is contained in:
parent
c486572d3d
commit
02251eeeb4
32 changed files with 3428 additions and 0 deletions
78
firmware/baseband/fprotos/weatherprotos.hpp
Normal file
78
firmware/baseband/fprotos/weatherprotos.hpp
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
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 "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 <vector>
|
||||
#include <memory>
|
||||
#include "portapack_shared_memory.hpp"
|
||||
|
||||
#ifndef __FPROTO_PROTOLIST_H__
|
||||
#define __FPROTO_PROTOLIST_H__
|
||||
|
||||
class WeatherProtos {
|
||||
public:
|
||||
WeatherProtos() {
|
||||
// add protos
|
||||
protos.push_back(std::make_unique<FProtoWeatherNexusTH>()); // 1
|
||||
protos.push_back(std::make_unique<FProtoWeatherAcurite592TXR>()); // 2
|
||||
protos.push_back(std::make_unique<FProtoWeatherAcurite606TX>()); // 3
|
||||
protos.push_back(std::make_unique<FProtoWeatherAcurite609TX>()); // 4
|
||||
protos.push_back(std::make_unique<FProtoWeatherAmbient>()); // 5
|
||||
protos.push_back(std::make_unique<FProtoWeatherAuriolAhfl>()); // 6
|
||||
protos.push_back(std::make_unique<FProtoWeatherAuriolTh>()); // 7
|
||||
protos.push_back(std::make_unique<FProtoWeatherGTWT02>()); // 8
|
||||
protos.push_back(std::make_unique<FProtoWeatherGTWT03>()); // 9
|
||||
protos.push_back(std::make_unique<FProtoWeatherInfactory>()); // 10
|
||||
protos.push_back(std::make_unique<FProtoWeatherLaCrosseTx>()); // 11
|
||||
protos.push_back(std::make_unique<FProtoWeatherLaCrosseTx141thbv2>()); // 12
|
||||
protos.push_back(std::make_unique<FProtoWeatherOregon2>()); // 13
|
||||
protos.push_back(std::make_unique<FProtoWeatherOregon3>()); // 14
|
||||
protos.push_back(std::make_unique<FProtoWeatherOregonV1>()); // 15
|
||||
protos.push_back(std::make_unique<FProtoWeatherThermoProTx4>()); // 16
|
||||
protos.push_back(std::make_unique<FProtoWeatherTX8300>()); // 17
|
||||
protos.push_back(std::make_unique<FProtoWeatherWendoxW6726>()); // 18
|
||||
|
||||
// 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<std::unique_ptr<FProtoWeatherBase>> protos{};
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue