19 std::list<std::pair<uint, TSTRING>>
log;
22 for (JsonObject doc : jsonObj[
"log"].as<JsonArray>()) {
23 std::pair<uint, TSTRING> pr(doc[
"first"], doc[
"second"]);
28 JsonObject
addTo(JsonObject&& jsonObj)
const {
30 JsonArray arr = jsonObj[
"log"].to<JsonArray>();
31 for (
auto&& pr :
log) {
33 obj[
"first"] = pr.first;
34 obj[
"second"] = pr.second;
42void begin(T& mesh, uint32_t destination,
double frequency = 120,
44 auto sendPkg = std::make_shared<RemotePackage>();
45 sendPkg->from = mesh.getNodeId();
46 sendPkg->dest = destination;
47 mesh.addTask(frequency * TASK_SECOND, TASK_FOREVER, [sendPkg, &mesh]() {
48 Log.
remote(
"Memory %u and stability %u\n", ESP.getFreeHeap(),
54 if (!sendPkg->log.empty()) mesh.sendPackage(sendPkg.get());
58 mesh.onPackage(sendPkg->type, callback);
void remote(const char *format...)
Definition logger.hpp:160
std::list< std::pair< uint32_t, TSTRING > > & get_remote_queue()
Definition logger.hpp:177
JsonObject addTo(JsonObject &&jsonObj) const
Definition plugin.hpp:60
std::list< std::pair< uint, TSTRING > > log
Definition remote.hpp:19
RemotePackage(JsonObject jsonObj)
Definition remote.hpp:21
RemotePackage()
Definition remote.hpp:20
JsonObject addTo(JsonObject &&jsonObj) const
Definition remote.hpp:28
Definition protocol.hpp:481
void begin(T &mesh, uint32_t destination, double frequency=120, std::function< bool(protocol::Variant &)> callback=nullptr)
Definition remote.hpp:42
painlessmesh::logger::LogClass Log
Definition wifi.cpp:2
painlessmesh::logger::LogClass Log
Definition wifi.cpp:2