get OTA enabling working

This commit is contained in:
2018-08-22 11:09:42 +02:00
parent 77f1b278f4
commit 426d495fd9
10 changed files with 49 additions and 35 deletions

View File

@@ -34,8 +34,8 @@ class MeshSprocket : public Sprocket {
}
void dispatchMessageToPlugins(MeshMessage msg){
for(Plugin* p : plugins){
if(msg.type != MeshMessage::NONE){
if(msg.type != MeshMessage::NONE){ // baaaa
for(Plugin* p : plugins){
Serial.println("dispatch to plugins");
p->onMessage(msg);
}
@@ -55,10 +55,8 @@ class MeshSprocket : public Sprocket {
};
void dispatch( uint32_t from, String &msg ) {
// TODO handle OTA before passing to onMessage
MeshMessage mMsg;
mMsg.fromJsonString(msg);
if(mMsg.valid){
if(mMsg.fromJsonString(msg)){
dispatchMessageToPlugins(mMsg);
}
onMessage(from, msg);