Implement interface for plugins to have custom UI Frames

This commit is contained in:
Charles Crossan
2021-02-21 16:46:46 -05:00
parent 087945d7cb
commit ae76ce4024
5 changed files with 125 additions and 12 deletions

View File

@@ -75,4 +75,18 @@ void MeshPlugin::sendResponse(const MeshPacket &req) {
void setReplyTo(MeshPacket *p, const MeshPacket &to) {
p->to = to.from;
p->want_ack = to.want_ack;
}
}
std::vector<MeshPlugin *> MeshPlugin::GetMeshPluginsWithUIFrames() {
std::vector<MeshPlugin *> pluginsWithUIFrames;
for (auto i = plugins->begin(); i != plugins->end(); ++i) {
auto &pi = **i;
if ( pi.wantUIFrame()) {
DEBUG_MSG("Plugin wants a UI Frame\n");
pluginsWithUIFrames.push_back(&pi);
}
}
return pluginsWithUIFrames;
}