mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-27 15:56:11 +02:00
included dev-control again
This commit is contained in:
parent
b34e5a7416
commit
5b39d38d86
4 changed files with 62 additions and 28 deletions
|
@ -15,6 +15,7 @@
|
|||
#include "../hms/hmsDefines.h"
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <functional>
|
||||
#include "../config/settings.h"
|
||||
|
||||
#include "radio.h"
|
||||
|
@ -180,6 +181,17 @@ class Inverter {
|
|||
// TODO: cleanup
|
||||
}
|
||||
|
||||
void tickSend(std::function<void(uint8_t cmd)> cb) {
|
||||
if((alarmLastId != alarmMesIndex) && (alarmMesIndex != 0))
|
||||
cb(AlarmData); // get last alarms
|
||||
else if(0 == getFwVersion())
|
||||
cb(InverterDevInform_All); // get firmware version
|
||||
else if(0 == getHwVersion())
|
||||
cb(InverterDevInform_Simple); // get hardware version
|
||||
else
|
||||
cb(RealTimeRunData_Debug); // get live data
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void enqueCommand(uint8_t cmd) {
|
||||
_commandQueue.push(std::make_shared<T>(cmd));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue