mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 13:25:03 +01:00
use mediator for internal messaging
This commit is contained in:
@@ -27,6 +27,11 @@ class MeshManPlugin : public Plugin {
|
||||
server->on("/mesh", HTTP_POST, std::bind(&MeshManPlugin::sendMsg, this, std::placeholders::_1));
|
||||
server->on("/mesh/nodeId", HTTP_GET, std::bind(&MeshManPlugin::getNodeId, this, std::placeholders::_1));
|
||||
server->on("/mesh/broadcast", HTTP_POST, std::bind(&MeshManPlugin::broadcast, this, std::placeholders::_1));
|
||||
|
||||
subscribe("mesh/heartbeat", std::bind(&MeshManPlugin::gotHeartbeat, this, std::placeholders::_1));
|
||||
}
|
||||
void gotHeartbeat(String msg){
|
||||
Serial.println(String("Got heartbeat: ") + msg);
|
||||
}
|
||||
void getMeshConnections(AsyncWebServerRequest *request) {
|
||||
request->send(200, "text/plain", net->mesh.subConnectionJson());
|
||||
|
||||
Reference in New Issue
Block a user