mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
remoove all
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
#include "Class/CallBackTest.h"
|
||||
|
||||
CallBackTest::CallBackTest(){};
|
||||
|
||||
void CallBackTest::loop() {
|
||||
count++;
|
||||
if (count > 5000) {
|
||||
// Проверяем что переменная содержит указатель - не пустая не null
|
||||
// и непосредственно вызываем то, на что это указывает
|
||||
// просто пишем имя - без () - это указатель на фунецию.
|
||||
// () - вызываем функцию - с пустым набором параметров
|
||||
|
||||
if (_cb != NULL) {
|
||||
_cb();
|
||||
}
|
||||
//или ровно тоже самое
|
||||
//if (_cb) _cb();
|
||||
|
||||
if (_pcb) {
|
||||
if (_pcb("SomeTextValue")) {
|
||||
Serial.println("Got true!");
|
||||
} else {
|
||||
Serial.println("Got false!");
|
||||
}
|
||||
}
|
||||
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//передаем внутрь класса функцию любую void функцию без агрументов
|
||||
void CallBackTest::setCallback(AsyncActionCb cb) {
|
||||
_cb = cb;
|
||||
}
|
||||
|
||||
//передаем внутрь класса функцию любую void функцию с аргументами
|
||||
void CallBackTest::setCallback(AsyncParamActionCb pcb) {
|
||||
_pcb = pcb;
|
||||
}
|
||||
//CallBackTest* CB;
|
||||
|
||||
//CB->setCallback([]() {
|
||||
// Serial.println("123");
|
||||
//});
|
||||
//
|
||||
//CB->setCallback([](const String str) {
|
||||
// Serial.println(str);
|
||||
// return true;
|
||||
//});
|
||||
@@ -1,2 +0,0 @@
|
||||
#include "Class/LineParsing.h"
|
||||
LineParsing myLineParsing;
|
||||
@@ -1,30 +0,0 @@
|
||||
#include "Class/NotAsync.h"
|
||||
|
||||
NotAsync::NotAsync(uint8_t size) {
|
||||
this->items = new NotAsyncItem[size];
|
||||
this->size = size;
|
||||
}
|
||||
|
||||
NotAsync::~NotAsync() {}
|
||||
|
||||
void NotAsync::add(uint8_t i, NotAsyncCb f, void* arg) {
|
||||
this->items[i].cb = f;
|
||||
this->items[i].cb_arg = arg;
|
||||
this->items[i].is_used = true;
|
||||
}
|
||||
|
||||
void NotAsync::loop() {
|
||||
if (this->items[task].is_used) {
|
||||
handle(this->items[task].cb, this->items[task].cb_arg);
|
||||
task = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void NotAsync::make(uint8_t task) {
|
||||
this->task = task;
|
||||
}
|
||||
|
||||
void NotAsync::handle(NotAsyncCb f, void* arg) {
|
||||
f(arg);
|
||||
}
|
||||
NotAsync* myNotAsyncActions;
|
||||
@@ -1,18 +0,0 @@
|
||||
#include "Class/ScenarioClass3.h"
|
||||
Scenario* myScenario;
|
||||
|
||||
//void eventGen(String event_name, String number) {
|
||||
// if (!jsonReadBool(configSetupJson, "scen")) {
|
||||
// return;
|
||||
// }
|
||||
// SerialPrint("", "", event_name);
|
||||
// eventBuf += event_name + number + ",";
|
||||
//}
|
||||
|
||||
void eventGen2(String eventName, String eventValue) {
|
||||
if (!jsonReadBool(configSetupJson, "scen")) {
|
||||
return;
|
||||
}
|
||||
//Serial.println(eventName + " " + eventValue);
|
||||
eventBuf += eventName + " " + eventValue + ",";
|
||||
}
|
||||
Reference in New Issue
Block a user