diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 237e08c9f..4e7fb0638 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -69,7 +69,7 @@ uint32_t dopThresholds[5] = {2000, 1000, 500, 200, 100}; // At some point, we're going to ask all of the modules if they would like to display a screen frame // we'll need to hold onto pointers for the modules that can draw a frame. -std::vector pluginFrames; +std::vector moduleFrames; // Stores the last 4 of our hardware ID, to make finding the device for pairing easier static char ourId[5]; @@ -194,7 +194,7 @@ static void drawPluginFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int // DEBUG_MSG("Screen is not in transition. Frame: %d\n\n", module_frame); } // DEBUG_MSG("Drawing Module Frame %d\n\n", module_frame); - MeshPlugin &pi = *pluginFrames.at(module_frame); + MeshPlugin &pi = *moduleFrames.at(module_frame); pi.drawFrame(display, state, x, y); } @@ -824,8 +824,8 @@ void Screen::setup() powerStatusObserver.observe(&powerStatus->onNewStatus); gpsStatusObserver.observe(&gpsStatus->onNewStatus); nodeStatusObserver.observe(&nodeStatus->onNewStatus); - if (textMessagePlugin) - textMessageObserver.observe(textMessagePlugin); + if (textMessageModule) + textMessageObserver.observe(textMessageModule); // Modules can notify screen about refresh MeshPlugin::observeUIEvents(&uiFrameEventObserver); @@ -976,9 +976,9 @@ void Screen::setFrames() DEBUG_MSG("showing standard frames\n"); showingNormalScreen = true; - pluginFrames = MeshPlugin::GetMeshPluginsWithUIFrames(); - DEBUG_MSG("Showing %d module frames\n", pluginFrames.size()); - int totalFrameCount = MAX_NUM_NODES + NUM_EXTRA_FRAMES + pluginFrames.size(); + moduleFrames = MeshPlugin::GetMeshPluginsWithUIFrames(); + DEBUG_MSG("Showing %d module frames\n", moduleFrames.size()); + int totalFrameCount = MAX_NUM_NODES + NUM_EXTRA_FRAMES + moduleFrames.size(); DEBUG_MSG("Total frame count: %d\n", totalFrameCount); // We don't show the node info our our node (if we have it yet - we should) @@ -994,7 +994,7 @@ void Screen::setFrames() // and then we'll just assume that the state->currentFrame value // is the same offset into the moduleFrames vector // so that we can invoke the module's callback - for (auto i = pluginFrames.begin(); i != pluginFrames.end(); ++i) { + for (auto i = moduleFrames.begin(); i != moduleFrames.end(); ++i) { normalFrames[numframes++] = drawPluginFrame; } diff --git a/src/mesh/MeshPlugin.cpp b/src/mesh/MeshPlugin.cpp index 48c081807..77d647562 100644 --- a/src/mesh/MeshPlugin.cpp +++ b/src/mesh/MeshPlugin.cpp @@ -69,7 +69,7 @@ MeshPacket *MeshPlugin::allocErrorResponse(Routing_Error err, const MeshPacket * void MeshPlugin::callPlugins(const MeshPacket &mp, RxSource src) { // DEBUG_MSG("In call modules\n"); - bool pluginFound = false; + bool moduleFound = false; // We now allow **encrypted** packets to pass through the modules bool isDecoded = mp.which_payloadVariant == MeshPacket_decoded_tag; @@ -98,7 +98,7 @@ void MeshPlugin::callPlugins(const MeshPacket &mp, RxSource src) if (wantsPacket) { DEBUG_MSG("Module '%s' wantsPacket=%d\n", pi.name, wantsPacket); - pluginFound = true; + moduleFound = true; /// received channel (or NULL if not decoded) Channel *ch = isDecoded ? &channels.getByIndex(mp.channel) : NULL; @@ -173,11 +173,11 @@ void MeshPlugin::callPlugins(const MeshPacket &mp, RxSource src) // SECURITY NOTE! I considered sending back a different error code if we didn't find the psk (i.e. !isDecoded) // but opted NOT TO. Because it is not a good idea to let remote nodes 'probe' to find out which PSKs were "good" vs // bad. - routingPlugin->sendAckNak(Routing_Error_NO_RESPONSE, getFrom(&mp), mp.id, mp.channel); + routingModule->sendAckNak(Routing_Error_NO_RESPONSE, getFrom(&mp), mp.id, mp.channel); } } - if (!pluginFound) + if (!moduleFound) DEBUG_MSG("No modules interested in portnum=%d, src=%s\n", mp.decoded.portnum, (src == RX_SRC_LOCAL) ? "LOCAL":"REMOTE"); @@ -225,17 +225,17 @@ void setReplyTo(MeshPacket *p, const MeshPacket &to) std::vector MeshPlugin::GetMeshPluginsWithUIFrames() { - std::vector pluginsWithUIFrames; + std::vector modulesWithUIFrames; if (modules) { for (auto i = modules->begin(); i != modules->end(); ++i) { auto &pi = **i; if (pi.wantUIFrame()) { DEBUG_MSG("Module wants a UI Frame\n"); - pluginsWithUIFrames.push_back(&pi); + modulesWithUIFrames.push_back(&pi); } } } - return pluginsWithUIFrames; + return modulesWithUIFrames; } void MeshPlugin::observeUIEvents( @@ -260,7 +260,7 @@ AdminMessageHandleResult MeshPlugin::handleAdminMessageForAllPlugins(const MeshP if (modules) { for (auto i = modules->begin(); i != modules->end(); ++i) { auto &pi = **i; - AdminMessageHandleResult h = pi.handleAdminMessageForPlugin(mp, request, response); + AdminMessageHandleResult h = pi.handleAdminMessageForModule(mp, request, response); if (h == AdminMessageHandleResult::HANDLED_WITH_RESPONSE) { // In case we have a response it always has priority. diff --git a/src/mesh/MeshPlugin.h b/src/mesh/MeshPlugin.h index 047482308..97f9e6474 100644 --- a/src/mesh/MeshPlugin.h +++ b/src/mesh/MeshPlugin.h @@ -160,7 +160,7 @@ class MeshPlugin * HANDLED if message was handled * HANDLED_WITH_RESPONSE if a response is also prepared and to be sent. */ - virtual AdminMessageHandleResult handleAdminMessageForPlugin( + virtual AdminMessageHandleResult handleAdminMessageForModule( const MeshPacket &mp, AdminMessage *request, AdminMessage *response) { return AdminMessageHandleResult::NOT_HANDLED; }; private: diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index d9de5f52d..863c6333a 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -115,10 +115,10 @@ void MeshService::reloadOwner() // DEBUG_MSG("reloadOwner()\n"); // update our local data directly nodeDB.updateUser(nodeDB.getNodeNum(), owner); - assert(nodeInfoPlugin); + assert(nodeInfoModule); // update everyone else - if (nodeInfoPlugin) - nodeInfoPlugin->sendOurNodeInfo(); + if (nodeInfoModule) + nodeInfoModule->sendOurNodeInfo(); nodeDB.saveToDisk(); } @@ -175,14 +175,14 @@ void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies) assert(node); if (node->has_position) { - if (positionPlugin) { + if (positionModule) { DEBUG_MSG("Sending position ping to 0x%x, wantReplies=%d\n", dest, wantReplies); - positionPlugin->sendOurPosition(dest, wantReplies); + positionModule->sendOurPosition(dest, wantReplies); } } else { - if (nodeInfoPlugin) { + if (nodeInfoModule) { DEBUG_MSG("Sending nodeinfo ping to 0x%x, wantReplies=%d\n", dest, wantReplies); - nodeInfoPlugin->sendOurNodeInfo(dest, wantReplies); + nodeInfoModule->sendOurNodeInfo(dest, wantReplies); } } } diff --git a/src/mesh/MeshService.h b/src/mesh/MeshService.h index eecfbdf64..3abae8efe 100644 --- a/src/mesh/MeshService.h +++ b/src/mesh/MeshService.h @@ -91,7 +91,7 @@ class MeshService /// Handle a packet that just arrived from the radio. This method does _ReliableRouternot_ free the provided packet. If it /// needs to keep the packet around it makes a copy int handleFromRadio(const MeshPacket *p); - friend class RoutingPlugin; + friend class RoutingModule; }; extern MeshService service; diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 3fce80d83..7f0dbd51f 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -132,7 +132,7 @@ MeshPacket *Router::allocForSending() */ void Router::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex) { - routingPlugin->sendAckNak(err, to, idFrom, chIndex); + routingModule->sendAckNak(err, to, idFrom, chIndex); } void Router::abortSendAndNak(Routing_Error err, MeshPacket *p) diff --git a/src/mesh/Router.h b/src/mesh/Router.h index 65ee5f4fc..3f079d92c 100644 --- a/src/mesh/Router.h +++ b/src/mesh/Router.h @@ -71,7 +71,7 @@ class Router : protected concurrency::OSThread void enqueueReceivedMessage(MeshPacket *p); protected: - friend class RoutingPlugin; + friend class RoutingModule; /** * Send a packet on a suitable interface. This routine will @@ -85,7 +85,7 @@ class Router : protected concurrency::OSThread /** * Should this incoming filter be dropped? * - * FIXME, move this into the new RoutingPlugin and do the filtering there using the regular module logic + * FIXME, move this into the new RoutingModule and do the filtering there using the regular module logic * * Called immedately on receiption, before any further processing. * @return true to abandon the packet diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 5123a93c8..41acfeeed 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -10,7 +10,7 @@ #include "unistd.h" #endif -AdminPlugin *adminPlugin; +AdminModule *adminModule; /// A special reserved string to indicate strings we can not share with external nodes. We will use this 'reserved' word instead. /// Also, to make setting work correctly, if someone tries to set a string to this reserved value we assume they don't really want a change. @@ -30,7 +30,7 @@ static void writeSecret(char *buf, const char *currentVal) { } } -void AdminPlugin::handleGetChannel(const MeshPacket &req, uint32_t channelIndex) +void AdminModule::handleGetChannel(const MeshPacket &req, uint32_t channelIndex) { if (req.decoded.want_response) { // We create the reply here @@ -41,7 +41,7 @@ void AdminPlugin::handleGetChannel(const MeshPacket &req, uint32_t channelIndex) } } -void AdminPlugin::handleGetRadio(const MeshPacket &req) +void AdminModule::handleGetRadio(const MeshPacket &req) { if (req.decoded.want_response) { // We create the reply here @@ -61,7 +61,7 @@ void AdminPlugin::handleGetRadio(const MeshPacket &req) } } -bool AdminPlugin::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) +bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) { // if handled == false, then let others look at this message also if they want bool handled = false; @@ -143,7 +143,7 @@ bool AdminPlugin::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) return handled; } -void AdminPlugin::handleSetOwner(const User &o) +void AdminModule::handleSetOwner(const User &o) { int changed = 0; @@ -173,7 +173,7 @@ void AdminPlugin::handleSetOwner(const User &o) service.reloadOwner(); } -void AdminPlugin::handleSetChannel(const Channel &cc) +void AdminModule::handleSetChannel(const Channel &cc) { channels.setChannel(cc); @@ -187,7 +187,7 @@ void AdminPlugin::handleSetChannel(const Channel &cc) } } -void AdminPlugin::handleSetRadio(RadioConfig &r) +void AdminModule::handleSetRadio(RadioConfig &r) { writeSecret(r.preferences.wifi_password, radioConfig.preferences.wifi_password); radioConfig = r; @@ -195,7 +195,7 @@ void AdminPlugin::handleSetRadio(RadioConfig &r) service.reloadConfig(); } -AdminPlugin::AdminPlugin() : ProtobufPlugin("Admin", PortNum_ADMIN_APP, AdminMessage_fields) +AdminModule::AdminModule() : ProtobufPlugin("Admin", PortNum_ADMIN_APP, AdminMessage_fields) { // restrict to the admin channel for rx boundChannel = Channels::adminChannel; diff --git a/src/modules/AdminModule.h b/src/modules/AdminModule.h index 4c4b956cc..98af9a677 100644 --- a/src/modules/AdminModule.h +++ b/src/modules/AdminModule.h @@ -2,15 +2,15 @@ #include "ProtobufPlugin.h" /** - * Routing plugin for router control messages + * Routing module for router control messages */ -class AdminPlugin : public ProtobufPlugin +class AdminModule : public ProtobufPlugin { public: /** Constructor * name is for debugging output */ - AdminPlugin(); + AdminModule(); protected: /** Called to handle a particular incoming message @@ -28,4 +28,4 @@ class AdminPlugin : public ProtobufPlugin void handleGetRadio(const MeshPacket &req); }; -extern AdminPlugin *adminPlugin; +extern AdminModule *adminModule; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index dbb12bd40..204330e8f 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -28,10 +28,10 @@ CannedMessageModule::CannedMessageModule() { if (radioConfig.preferences.canned_message_module_enabled) { - this->loadProtoForPlugin(); + this->loadProtoForModule(); if(this->splitConfiguredMessages() <= 0) { - DEBUG_MSG("CannedMessageModule: No messages are configured. Plugin is disabled\n"); + DEBUG_MSG("CannedMessageModule: No messages are configured. Module is disabled\n"); this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED; } else @@ -313,7 +313,7 @@ void CannedMessageModule::drawFrame( } } -void CannedMessageModule::loadProtoForPlugin() +void CannedMessageModule::loadProtoForModule() { if (!loadProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size, sizeof(cannedMessagesConfigFile), CannedMessageModuleConfig_fields, &cannedMessageModuleConfig)) { installDefaultCannedMessageModuleConfig(); @@ -326,7 +326,7 @@ void CannedMessageModule::loadProtoForPlugin() * @return true On success. * @return false On error. */ -bool CannedMessageModule::saveProtoForPlugin() +bool CannedMessageModule::saveProtoForModule() { bool okay = true; @@ -351,7 +351,7 @@ void CannedMessageModule::installDefaultCannedMessageModuleConfig() } /** - * @brief An admin message arrived to AdminPlugin. We are asked whether we want to handle that. + * @brief An admin message arrived to AdminModule. We are asked whether we want to handle that. * * @param mp The mesh packet arrived. * @param request The AdminMessage request extracted from the packet. @@ -359,7 +359,7 @@ void CannedMessageModule::installDefaultCannedMessageModuleConfig() * @return AdminMessageHandleResult HANDLED if message was handled * HANDLED_WITH_RESULT if a result is also prepared. */ -AdminMessageHandleResult CannedMessageModule::handleAdminMessageForPlugin( +AdminMessageHandleResult CannedMessageModule::handleAdminMessageForModule( const MeshPacket &mp, AdminMessage *request, AdminMessage *response) { AdminMessageHandleResult result; @@ -485,7 +485,7 @@ void CannedMessageModule::handleSetCannedMessageModulePart1(const char *from_msg if (changed) { - this->saveProtoForPlugin(); + this->saveProtoForModule(); } } @@ -501,7 +501,7 @@ void CannedMessageModule::handleSetCannedMessageModulePart2(const char *from_msg if (changed) { - this->saveProtoForPlugin(); + this->saveProtoForModule(); } } @@ -517,7 +517,7 @@ void CannedMessageModule::handleSetCannedMessageModulePart3(const char *from_msg if (changed) { - this->saveProtoForPlugin(); + this->saveProtoForModule(); } } @@ -533,6 +533,6 @@ void CannedMessageModule::handleSetCannedMessageModulePart4(const char *from_msg if (changed) { - this->saveProtoForPlugin(); + this->saveProtoForModule(); } } diff --git a/src/modules/CannedMessageModule.h b/src/modules/CannedMessageModule.h index c38c4aceb..3a33b6acf 100644 --- a/src/modules/CannedMessageModule.h +++ b/src/modules/CannedMessageModule.h @@ -66,11 +66,11 @@ class CannedMessageModule : virtual Observable* getUIFrameObservable() override { return this; } virtual void drawFrame( OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override; - virtual AdminMessageHandleResult handleAdminMessageForPlugin( + virtual AdminMessageHandleResult handleAdminMessageForModule( const MeshPacket &mp, AdminMessage *request, AdminMessage *response) override; - void loadProtoForPlugin(); - bool saveProtoForPlugin(); + void loadProtoForModule(); + bool saveProtoForModule(); void installDefaultCannedMessageModuleConfig(); diff --git a/src/modules/ModuleDev.h b/src/modules/ModuleDev.h index df2e449a5..da8de3e9c 100644 --- a/src/modules/ModuleDev.h +++ b/src/modules/ModuleDev.h @@ -6,5 +6,5 @@ * */ -// Enable development more for StoreForwardPlugin +// Enable development more for StoreForwardModule bool StoreForward_Dev = false; \ No newline at end of file diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index e01b374b3..fda285ed6 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -25,21 +25,21 @@ void setupModules() { inputBroker = new InputBroker(); - adminPlugin = new AdminPlugin(); - nodeInfoPlugin = new NodeInfoPlugin(); - positionPlugin = new PositionPlugin(); - textMessagePlugin = new TextMessagePlugin(); + adminModule = new AdminModule(); + nodeInfoModule = new NodeInfoModule(); + positionModule = new PositionModule(); + textMessageModule = new TextMessageModule(); // Note: if the rest of meshtastic doesn't need to explicitly use your module, you do not need to assign the instance // to a global variable. - new RemoteHardwarePlugin(); - new ReplyPlugin(); + new RemoteHardwareModule(); + new ReplyModule(); rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); rotaryEncoderInterruptImpl1->init(); cannedMessageModule = new CannedMessageModule(); #ifndef PORTDUINO - new TelemetryPlugin(); + new TelemetryModule(); #endif #ifndef NO_ESP32 // Only run on an esp32 based device. @@ -47,15 +47,14 @@ void setupModules() /* Maintained by MC Hamster (Jm Casler) jm@casler.org */ - new SerialPlugin(); + new SerialModule(); new ExternalNotificationModule(); - storeForwardPlugin = new StoreForwardPlugin(); + storeForwardModule = new StoreForwardModule(); new RangeTestModule(); - // new StoreForwardPlugin(); #endif // NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra acks - routingPlugin = new RoutingPlugin(); + routingModule = new RoutingModule(); } \ No newline at end of file diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index 83056d268..9994d314f 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -6,9 +6,9 @@ #include "Router.h" #include "main.h" -NodeInfoPlugin *nodeInfoPlugin; +NodeInfoModule *nodeInfoModule; -bool NodeInfoPlugin::handleReceivedProtobuf(const MeshPacket &mp, User *pptr) +bool NodeInfoModule::handleReceivedProtobuf(const MeshPacket &mp, User *pptr) { auto p = *pptr; @@ -27,7 +27,7 @@ bool NodeInfoPlugin::handleReceivedProtobuf(const MeshPacket &mp, User *pptr) return false; // Let others look at this message also if they want } -void NodeInfoPlugin::sendOurNodeInfo(NodeNum dest, bool wantReplies) +void NodeInfoModule::sendOurNodeInfo(NodeNum dest, bool wantReplies) { // cancel any not yet sent (now stale) position packets if (prevPacketId) // if we wrap around to zero, we'll simply fail to cancel in that rare case (no big deal) @@ -42,7 +42,7 @@ void NodeInfoPlugin::sendOurNodeInfo(NodeNum dest, bool wantReplies) service.sendToMesh(p); } -MeshPacket *NodeInfoPlugin::allocReply() +MeshPacket *NodeInfoModule::allocReply() { User &u = owner; @@ -50,15 +50,15 @@ MeshPacket *NodeInfoPlugin::allocReply() return allocDataProtobuf(u); } -NodeInfoPlugin::NodeInfoPlugin() - : ProtobufPlugin("nodeinfo", PortNum_NODEINFO_APP, User_fields), concurrency::OSThread("NodeInfoPlugin") +NodeInfoModule::NodeInfoModule() + : ProtobufPlugin("nodeinfo", PortNum_NODEINFO_APP, User_fields), concurrency::OSThread("NodeInfoModule") { isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others setIntervalFromNow(30 * 1000); // Send our initial owner announcement 30 seconds after we start (to give network time to setup) } -int32_t NodeInfoPlugin::runOnce() +int32_t NodeInfoModule::runOnce() { static uint32_t currentGeneration; diff --git a/src/modules/NodeInfoModule.h b/src/modules/NodeInfoModule.h index 39ae1f6b0..9030a83a9 100644 --- a/src/modules/NodeInfoModule.h +++ b/src/modules/NodeInfoModule.h @@ -4,7 +4,7 @@ /** * NodeInfo module for sending/receiving NodeInfos into the mesh */ -class NodeInfoPlugin : public ProtobufPlugin, private concurrency::OSThread +class NodeInfoModule : public ProtobufPlugin, private concurrency::OSThread { /// The id of the last packet we sent, to allow us to cancel it if we make something fresher PacketId prevPacketId = 0; @@ -14,7 +14,7 @@ class NodeInfoPlugin : public ProtobufPlugin, private concurrency::OSThrea /** Constructor * name is for debugging output */ - NodeInfoPlugin(); + NodeInfoModule(); /** * Send our NodeInfo into the mesh @@ -36,4 +36,4 @@ class NodeInfoPlugin : public ProtobufPlugin, private concurrency::OSThrea virtual int32_t runOnce() override; }; -extern NodeInfoPlugin *nodeInfoPlugin; +extern NodeInfoModule *nodeInfoModule; diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 0f52d1865..1deabae0f 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -7,16 +7,16 @@ #include "configuration.h" #include "gps/GeoCoord.h" -PositionPlugin *positionPlugin; +PositionModule *positionModule; -PositionPlugin::PositionPlugin() - : ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionPlugin") +PositionModule::PositionModule() + : ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionModule") { isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others setIntervalFromNow(60 * 1000); // Send our initial position 60 seconds after we start (to give GPS time to setup) } -bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, Position *pptr) +bool PositionModule::handleReceivedProtobuf(const MeshPacket &mp, Position *pptr) { auto p = *pptr; @@ -53,7 +53,7 @@ bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, Position *pptr return false; // Let others look at this message also if they want } -MeshPacket *PositionPlugin::allocReply() +MeshPacket *PositionModule::allocReply() { NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position assert(node->has_position); @@ -109,7 +109,7 @@ MeshPacket *PositionPlugin::allocReply() return allocDataProtobuf(p); } -void PositionPlugin::sendOurPosition(NodeNum dest, bool wantReplies) +void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies) { // cancel any not yet sent (now stale) position packets if (prevPacketId) // if we wrap around to zero, we'll simply fail to cancel in that rare case (no big deal) @@ -124,7 +124,7 @@ void PositionPlugin::sendOurPosition(NodeNum dest, bool wantReplies) service.sendToMesh(p); } -int32_t PositionPlugin::runOnce() +int32_t PositionModule::runOnce() { NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum()); diff --git a/src/modules/PositionModule.h b/src/modules/PositionModule.h index 91d76b72f..8fbc5865c 100644 --- a/src/modules/PositionModule.h +++ b/src/modules/PositionModule.h @@ -5,7 +5,7 @@ /** * Position module for sending/receiving positions into the mesh */ -class PositionPlugin : public ProtobufPlugin, private concurrency::OSThread +class PositionModule : public ProtobufPlugin, private concurrency::OSThread { /// The id of the last packet we sent, to allow us to cancel it if we make something fresher PacketId prevPacketId = 0; @@ -24,7 +24,7 @@ class PositionPlugin : public ProtobufPlugin, private concurrency::OST /** Constructor * name is for debugging output */ - PositionPlugin(); + PositionModule(); /** * Send our position into the mesh @@ -47,4 +47,4 @@ class PositionPlugin : public ProtobufPlugin, private concurrency::OST virtual int32_t runOnce() override; }; -extern PositionPlugin *positionPlugin; +extern PositionModule *positionModule; diff --git a/src/modules/RemoteHardwareModule.cpp b/src/modules/RemoteHardwareModule.cpp index 1068e9cca..7ceaffeab 100644 --- a/src/modules/RemoteHardwareModule.cpp +++ b/src/modules/RemoteHardwareModule.cpp @@ -46,13 +46,13 @@ static uint64_t digitalReads(uint64_t mask) return res; } -RemoteHardwarePlugin::RemoteHardwarePlugin() +RemoteHardwareModule::RemoteHardwareModule() : ProtobufPlugin("remotehardware", PortNum_REMOTE_HARDWARE_APP, HardwareMessage_fields), concurrency::OSThread( "remotehardware") { } -bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, HardwareMessage *pptr) +bool RemoteHardwareModule::handleReceivedProtobuf(const MeshPacket &req, HardwareMessage *pptr) { auto p = *pptr; DEBUG_MSG("Received RemoteHardware typ=%d\n", p.typ); @@ -111,7 +111,7 @@ bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, Hardwar return false; } -int32_t RemoteHardwarePlugin::runOnce() +int32_t RemoteHardwareModule::runOnce() { if (watchGpios) { uint32_t now = millis(); diff --git a/src/modules/RemoteHardwareModule.h b/src/modules/RemoteHardwareModule.h index 9fa4bb0df..19811705a 100644 --- a/src/modules/RemoteHardwareModule.h +++ b/src/modules/RemoteHardwareModule.h @@ -6,7 +6,7 @@ /** * A module that provides easy low-level remote access to device hardware. */ -class RemoteHardwarePlugin : public ProtobufPlugin, private concurrency::OSThread +class RemoteHardwareModule : public ProtobufPlugin, private concurrency::OSThread { /// The current set of GPIOs we've been asked to watch for changes uint64_t watchGpios = 0; @@ -20,7 +20,7 @@ class RemoteHardwarePlugin : public ProtobufPlugin, private con /** Constructor * name is for debugging output */ - RemoteHardwarePlugin(); + RemoteHardwareModule(); protected: /** Called to handle a particular incoming message @@ -40,4 +40,4 @@ class RemoteHardwarePlugin : public ProtobufPlugin, private con virtual int32_t runOnce() override; }; -extern RemoteHardwarePlugin remoteHardwarePlugin; +extern RemoteHardwareModule remoteHardwareModule; diff --git a/src/modules/ReplyModule.cpp b/src/modules/ReplyModule.cpp index d6f5dd10d..af7232895 100644 --- a/src/modules/ReplyModule.cpp +++ b/src/modules/ReplyModule.cpp @@ -5,7 +5,7 @@ #include -MeshPacket *ReplyPlugin::allocReply() +MeshPacket *ReplyModule::allocReply() { assert(currentRequest); // should always be !NULL auto req = *currentRequest; diff --git a/src/modules/ReplyModule.h b/src/modules/ReplyModule.h index 4686e8145..af17224a6 100644 --- a/src/modules/ReplyModule.h +++ b/src/modules/ReplyModule.h @@ -5,13 +5,13 @@ /** * A simple example module that just replies with "Message received" to any message it receives. */ -class ReplyPlugin : public SinglePortPlugin +class ReplyModule : public SinglePortPlugin { public: /** Constructor * name is for debugging output */ - ReplyPlugin() : SinglePortPlugin("reply", PortNum_REPLY_APP) {} + ReplyModule() : SinglePortPlugin("reply", PortNum_REPLY_APP) {} protected: diff --git a/src/modules/RoutingModule.cpp b/src/modules/RoutingModule.cpp index e87f8ca85..070231032 100644 --- a/src/modules/RoutingModule.cpp +++ b/src/modules/RoutingModule.cpp @@ -5,9 +5,9 @@ #include "Router.h" #include "main.h" -RoutingPlugin *routingPlugin; +RoutingModule *routingModule; -bool RoutingPlugin::handleReceivedProtobuf(const MeshPacket &mp, Routing *r) +bool RoutingModule::handleReceivedProtobuf(const MeshPacket &mp, Routing *r) { printPacket("Routing sniffing", &mp); router->sniffReceived(&mp, r); @@ -22,7 +22,7 @@ bool RoutingPlugin::handleReceivedProtobuf(const MeshPacket &mp, Routing *r) return false; // Let others look at this message also if they want } -MeshPacket *RoutingPlugin::allocReply() +MeshPacket *RoutingModule::allocReply() { assert(currentRequest); @@ -34,14 +34,14 @@ MeshPacket *RoutingPlugin::allocReply() return NULL; } -void RoutingPlugin::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex) +void RoutingModule::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex) { auto p = allocAckNak(err, to, idFrom, chIndex); router->sendLocal(p); // we sometimes send directly to the local node } -RoutingPlugin::RoutingPlugin() : ProtobufPlugin("routing", PortNum_ROUTING_APP, Routing_fields) +RoutingModule::RoutingModule() : ProtobufPlugin("routing", PortNum_ROUTING_APP, Routing_fields) { isPromiscuous = true; } diff --git a/src/modules/RoutingModule.h b/src/modules/RoutingModule.h index ae2088475..66a326c7b 100644 --- a/src/modules/RoutingModule.h +++ b/src/modules/RoutingModule.h @@ -5,13 +5,13 @@ /** * Routing module for router control messages */ -class RoutingPlugin : public ProtobufPlugin +class RoutingModule : public ProtobufPlugin { public: /** Constructor * name is for debugging output */ - RoutingPlugin(); + RoutingModule(); void sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex); @@ -32,4 +32,4 @@ class RoutingPlugin : public ProtobufPlugin virtual bool wantPacket(const MeshPacket *p) override { return true; } }; -extern RoutingPlugin *routingPlugin; +extern RoutingModule *routingModule; diff --git a/src/modules/Telemetry/Telemetry.cpp b/src/modules/Telemetry/Telemetry.cpp index 7758667c5..e01981924 100644 --- a/src/modules/Telemetry/Telemetry.cpp +++ b/src/modules/Telemetry/Telemetry.cpp @@ -42,7 +42,7 @@ MCP9808Sensor mcp9808Sensor; #define FONT_HEIGHT_MEDIUM fontHeight(FONT_MEDIUM) -int32_t TelemetryPlugin::runOnce() +int32_t TelemetryModule::runOnce() { #ifndef PORTDUINO /* @@ -155,7 +155,7 @@ int32_t TelemetryPlugin::runOnce() #endif } -bool TelemetryPlugin::wantUIFrame() +bool TelemetryModule::wantUIFrame() { return radioConfig.preferences.telemetry_module_screen_enabled; } @@ -185,12 +185,12 @@ uint32_t GetTimeSinceMeshPacket(const MeshPacket *mp) return delta; } -float TelemetryPlugin::CelsiusToFarenheit(float c) +float TelemetryModule::CelsiusToFarenheit(float c) { return (c * 9) / 5 + 32; } -void TelemetryPlugin::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +void TelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_MEDIUM); @@ -225,7 +225,7 @@ void TelemetryPlugin::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, display->drawString(x, y += fontHeight(FONT_SMALL),"Press: " + String(lastMeasurement.barometric_pressure, 0) + "hPA"); } -bool TelemetryPlugin::handleReceivedProtobuf(const MeshPacket &mp, Telemetry *p) +bool TelemetryModule::handleReceivedProtobuf(const MeshPacket &mp, Telemetry *p) { if (!(radioConfig.preferences.telemetry_module_measurement_enabled || radioConfig.preferences.telemetry_module_screen_enabled)) { @@ -246,7 +246,7 @@ bool TelemetryPlugin::handleReceivedProtobuf(const MeshPacket &mp, Telemetry *p) return false; // Let others look at this message also if they want } -bool TelemetryPlugin::sendOurTelemetry(NodeNum dest, bool wantReplies) +bool TelemetryModule::sendOurTelemetry(NodeNum dest, bool wantReplies) { Telemetry m; m.barometric_pressure = 0; diff --git a/src/modules/Telemetry/Telemetry.h b/src/modules/Telemetry/Telemetry.h index 177ad0ce1..40da90986 100644 --- a/src/modules/Telemetry/Telemetry.h +++ b/src/modules/Telemetry/Telemetry.h @@ -4,11 +4,11 @@ #include #include -class TelemetryPlugin : private concurrency::OSThread, public ProtobufPlugin +class TelemetryModule : private concurrency::OSThread, public ProtobufPlugin { public: - TelemetryPlugin() - : concurrency::OSThread("TelemetryPlugin"), + TelemetryModule() + : concurrency::OSThread("TelemetryModule"), ProtobufPlugin("Telemetry", PortNum_TELEMETRY_APP, &Telemetry_msg) { lastMeasurementPacket = nullptr; diff --git a/src/modules/TextMessageModule.cpp b/src/modules/TextMessageModule.cpp index bd6aea770..abccc0ae8 100644 --- a/src/modules/TextMessageModule.cpp +++ b/src/modules/TextMessageModule.cpp @@ -3,9 +3,9 @@ #include "NodeDB.h" #include "PowerFSM.h" -TextMessagePlugin *textMessagePlugin; +TextMessageModule *textMessageModule; -ProcessMessage TextMessagePlugin::handleReceived(const MeshPacket &mp) +ProcessMessage TextMessageModule::handleReceived(const MeshPacket &mp) { auto &p = mp.decoded; DEBUG_MSG("Received text msg from=0x%0x, id=0x%x, msg=%.*s\n", mp.from, mp.id, p.payload.size, p.payload.bytes); diff --git a/src/modules/TextMessageModule.h b/src/modules/TextMessageModule.h index d730c3ae4..184bb9e11 100644 --- a/src/modules/TextMessageModule.h +++ b/src/modules/TextMessageModule.h @@ -5,13 +5,13 @@ /** * Text message handling for meshtastic - draws on the OLED display the most recent received message */ -class TextMessagePlugin : public SinglePortPlugin, public Observable +class TextMessageModule : public SinglePortPlugin, public Observable { public: /** Constructor * name is for debugging output */ - TextMessagePlugin() : SinglePortPlugin("text", PortNum_TEXT_MESSAGE_APP) {} + TextMessageModule() : SinglePortPlugin("text", PortNum_TEXT_MESSAGE_APP) {} protected: @@ -22,4 +22,4 @@ class TextMessagePlugin : public SinglePortPlugin, public ObservablegetLatitude() %d\n", gpsStatus->getLatitude()); DEBUG_MSG("gpsStatus->getLongitude() %d\n", gpsStatus->getLongitude()); @@ -90,7 +90,7 @@ int32_t RangeTestModule::runOnce() } } else { - DEBUG_MSG("Range Test Plugin - Disabled\n"); + DEBUG_MSG("Range Test Module - Disabled\n"); } #endif @@ -175,7 +175,7 @@ ProcessMessage RangeTestModuleRadio::handleReceived(const MeshPacket &mp) } } else { - DEBUG_MSG("Range Test Plugin Disabled\n"); + DEBUG_MSG("Range Test Module Disabled\n"); } #endif diff --git a/src/modules/esp32/SerialModule.cpp b/src/modules/esp32/SerialModule.cpp index c8b9914b1..a29e03bbf 100644 --- a/src/modules/esp32/SerialModule.cpp +++ b/src/modules/esp32/SerialModule.cpp @@ -9,7 +9,7 @@ #include /* - SerialPlugin + SerialModule A simple interface to send messages over the mesh network by sending strings over a serial port. @@ -20,7 +20,7 @@ Basic Usage: - 1) Enable the module by setting serialplugin_enabled to 1. + 1) Enable the module by setting serialmodule_enabled to 1. 2) Set the pins (serialmodule_rxd / serialmodule_rxd) for your preferred RX and TX GPIO pins. On tbeam, recommend to use: RXD 35 @@ -54,20 +54,20 @@ #define SERIALMODULE_BAUD 38400 #define SERIALMODULE_ACK 1 -SerialPlugin *serialPlugin; -SerialPluginRadio *serialPluginRadio; +SerialModule *serialModule; +SerialModuleRadio *serialModuleRadio; -SerialPlugin::SerialPlugin() : concurrency::OSThread("SerialPlugin") {} +SerialModule::SerialModule() : concurrency::OSThread("SerialModule") {} char serialStringChar[Constants_DATA_PAYLOAD_LEN]; -SerialPluginRadio::SerialPluginRadio() : SinglePortPlugin("SerialPluginRadio", PortNum_SERIAL_APP) +SerialModuleRadio::SerialModuleRadio() : SinglePortPlugin("SerialModuleRadio", PortNum_SERIAL_APP) { // restrict to the admin channel for rx boundChannel = Channels::serialChannel; } -int32_t SerialPlugin::runOnce() +int32_t SerialModule::runOnce() { #ifndef NO_ESP32 @@ -107,7 +107,7 @@ int32_t SerialPlugin::runOnce() Serial2.setRxBufferSize(SERIALMODULE_RX_BUFFER); - serialPluginRadio = new SerialPluginRadio(); + serialModuleRadio = new SerialModuleRadio(); firstTime = 0; @@ -118,7 +118,7 @@ int32_t SerialPlugin::runOnce() serialString = Serial2.readString(); serialString.toCharArray(serialStringChar, Constants_DATA_PAYLOAD_LEN); - serialPluginRadio->sendPayload(); + serialModuleRadio->sendPayload(); DEBUG_MSG("Received: %s\n", serialStringChar); } @@ -126,7 +126,7 @@ int32_t SerialPlugin::runOnce() return (10); } else { - DEBUG_MSG("Serial Plugin Disabled\n"); + DEBUG_MSG("Serial Module Disabled\n"); return (INT32_MAX); } @@ -135,7 +135,7 @@ int32_t SerialPlugin::runOnce() #endif } -MeshPacket *SerialPluginRadio::allocReply() +MeshPacket *SerialModuleRadio::allocReply() { auto reply = allocDataPacket(); // Allocate a packet for sending @@ -143,7 +143,7 @@ MeshPacket *SerialPluginRadio::allocReply() return reply; } -void SerialPluginRadio::sendPayload(NodeNum dest, bool wantReplies) +void SerialModuleRadio::sendPayload(NodeNum dest, bool wantReplies) { MeshPacket *p = allocReply(); p->to = dest; @@ -157,7 +157,7 @@ void SerialPluginRadio::sendPayload(NodeNum dest, bool wantReplies) service.sendToMesh(p); } -ProcessMessage SerialPluginRadio::handleReceived(const MeshPacket &mp) +ProcessMessage SerialModuleRadio::handleReceived(const MeshPacket &mp) { #ifndef NO_ESP32 @@ -202,7 +202,7 @@ ProcessMessage SerialPluginRadio::handleReceived(const MeshPacket &mp) } } else { - DEBUG_MSG("Serial Plugin Disabled\n"); + DEBUG_MSG("Serial Module Disabled\n"); } #endif diff --git a/src/modules/esp32/SerialModule.h b/src/modules/esp32/SerialModule.h index 7781e4419..860f53082 100644 --- a/src/modules/esp32/SerialModule.h +++ b/src/modules/esp32/SerialModule.h @@ -6,24 +6,24 @@ #include #include -class SerialPlugin : private concurrency::OSThread +class SerialModule : private concurrency::OSThread { bool firstTime = 1; public: - SerialPlugin(); + SerialModule(); protected: virtual int32_t runOnce() override; }; -extern SerialPlugin *serialPlugin; +extern SerialModule *serialModule; /* - * Radio interface for SerialPlugin + * Radio interface for SerialModule * */ -class SerialPluginRadio : public SinglePortPlugin +class SerialModuleRadio : public SinglePortPlugin { uint32_t lastRxID = 0; @@ -33,7 +33,7 @@ class SerialPluginRadio : public SinglePortPlugin from the main code. */ - SerialPluginRadio(); + SerialModuleRadio(); /** * Send our payload into the mesh @@ -50,4 +50,4 @@ class SerialPluginRadio : public SinglePortPlugin virtual ProcessMessage handleReceived(const MeshPacket &mp) override; }; -extern SerialPluginRadio *serialPluginRadio; +extern SerialModuleRadio *serialModuleRadio; diff --git a/src/modules/esp32/StoreForwardModule.cpp b/src/modules/esp32/StoreForwardModule.cpp index 3aedcdf3a..a8c775236 100644 --- a/src/modules/esp32/StoreForwardModule.cpp +++ b/src/modules/esp32/StoreForwardModule.cpp @@ -12,9 +12,9 @@ #include #include -StoreForwardPlugin *storeForwardPlugin; +StoreForwardModule *storeForwardModule; -int32_t StoreForwardPlugin::runOnce() +int32_t StoreForwardModule::runOnce() { #ifndef NO_ESP32 @@ -31,11 +31,11 @@ int32_t StoreForwardPlugin::runOnce() if (airTime->channelUtilizationPercent() < 25) { // DEBUG_MSG("--- --- --- In busy loop 1 %d\n", this->packetHistoryTXQueue_index); - storeForwardPlugin->sendPayload(this->busyTo, this->packetHistoryTXQueue_index); + storeForwardModule->sendPayload(this->busyTo, this->packetHistoryTXQueue_index); if (this->packetHistoryTXQueue_index == packetHistoryTXQueue_size) { strcpy(this->routerMessage, "** S&F - Done"); - storeForwardPlugin->sendMessage(this->busyTo, this->routerMessage); + storeForwardModule->sendMessage(this->busyTo, this->routerMessage); // DEBUG_MSG("--- --- --- In busy loop - Done \n"); this->packetHistoryTXQueue_index = 0; @@ -52,13 +52,13 @@ int32_t StoreForwardPlugin::runOnce() return (this->packetTimeMax); } else { - DEBUG_MSG("Store & Forward Plugin - Disabled (is_router = false)\n"); + DEBUG_MSG("Store & Forward Module - Disabled (is_router = false)\n"); return (INT32_MAX); } } else { - DEBUG_MSG("Store & Forward Plugin - Disabled\n"); + DEBUG_MSG("Store & Forward Module - Disabled\n"); return (INT32_MAX); } @@ -70,7 +70,7 @@ int32_t StoreForwardPlugin::runOnce() /* Create our data structure in the PSRAM. */ -void StoreForwardPlugin::populatePSRAM() +void StoreForwardModule::populatePSRAM() { /* For PSRAM usage, see: @@ -104,7 +104,7 @@ void StoreForwardPlugin::populatePSRAM() DEBUG_MSG(" numberOfPackets for packetHistory - %u\n", numberOfPackets); } -void StoreForwardPlugin::historyReport() +void StoreForwardModule::historyReport() { DEBUG_MSG("Iterating through the message history...\n"); DEBUG_MSG("Message history contains %u records\n", this->packetHistoryCurrent); @@ -113,27 +113,27 @@ void StoreForwardPlugin::historyReport() /* * */ -void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to) +void StoreForwardModule::historySend(uint32_t msAgo, uint32_t to) { // uint32_t packetsSent = 0; - uint32_t queueSize = storeForwardPlugin->historyQueueCreate(msAgo, to); + uint32_t queueSize = storeForwardModule->historyQueueCreate(msAgo, to); if (queueSize) { snprintf(this->routerMessage, 80, "** S&F - Sending %u message(s)", queueSize); - storeForwardPlugin->sendMessage(to, this->routerMessage); + storeForwardModule->sendMessage(to, this->routerMessage); this->busy = true; // runOnce() will pickup the next steps once busy = true. this->busyTo = to; } else { strcpy(this->routerMessage, "** S&F - No history to send"); - storeForwardPlugin->sendMessage(to, this->routerMessage); + storeForwardModule->sendMessage(to, this->routerMessage); } } -uint32_t StoreForwardPlugin::historyQueueCreate(uint32_t msAgo, uint32_t to) +uint32_t StoreForwardModule::historyQueueCreate(uint32_t msAgo, uint32_t to) { // uint32_t packetHistoryTXQueueIndex = 0; @@ -177,7 +177,7 @@ uint32_t StoreForwardPlugin::historyQueueCreate(uint32_t msAgo, uint32_t to) return this->packetHistoryTXQueue_size; } -void StoreForwardPlugin::historyAdd(const MeshPacket &mp) +void StoreForwardModule::historyAdd(const MeshPacket &mp) { const auto &p = mp.decoded; @@ -191,13 +191,13 @@ void StoreForwardPlugin::historyAdd(const MeshPacket &mp) this->packetHistoryCurrent++; } -MeshPacket *StoreForwardPlugin::allocReply() +MeshPacket *StoreForwardModule::allocReply() { auto reply = allocDataPacket(); // Allocate a packet for sending return reply; } -void StoreForwardPlugin::sendPayload(NodeNum dest, uint32_t packetHistory_index) +void StoreForwardModule::sendPayload(NodeNum dest, uint32_t packetHistory_index) { DEBUG_MSG("Sending S&F Payload\n"); MeshPacket *p = allocReply(); @@ -218,7 +218,7 @@ void StoreForwardPlugin::sendPayload(NodeNum dest, uint32_t packetHistory_index) service.sendToMesh(p); } -void StoreForwardPlugin::sendMessage(NodeNum dest, char *str) +void StoreForwardModule::sendMessage(NodeNum dest, char *str) { MeshPacket *p = allocReply(); @@ -240,7 +240,7 @@ void StoreForwardPlugin::sendMessage(NodeNum dest, char *str) // HardwareMessage_init_default } -ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp) +ProcessMessage StoreForwardModule::handleReceived(const MeshPacket &mp) { #ifndef NO_ESP32 if (radioConfig.preferences.store_forward_module_enabled) { @@ -261,9 +261,9 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp) // Send the last 60 minutes of messages. if (this->busy) { strcpy(this->routerMessage, "** S&F - Busy. Try again shortly."); - storeForwardPlugin->sendMessage(getFrom(&mp), this->routerMessage); + storeForwardModule->sendMessage(getFrom(&mp), this->routerMessage); } else { - storeForwardPlugin->historySend(1000 * 60, getFrom(&mp)); + storeForwardModule->historySend(1000 * 60, getFrom(&mp)); } } else if ((p.payload.bytes[0] == 'S') && (p.payload.bytes[1] == 'F') && (p.payload.bytes[2] == 'm') && (p.payload.bytes[3] == 0x00)) { @@ -271,10 +271,10 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp) "01234567890123456789012345678901234567890123456789012345678901234567890123456789" "01234567890123456789012345678901234567890123456789012345678901234567890123456", sizeof(this->routerMessage)); - storeForwardPlugin->sendMessage(getFrom(&mp), this->routerMessage); + storeForwardModule->sendMessage(getFrom(&mp), this->routerMessage); } else { - storeForwardPlugin->historyAdd(mp); + storeForwardModule->historyAdd(mp); } } else if (mp.decoded.portnum == PortNum_STORE_FORWARD_APP) { @@ -285,7 +285,7 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp) } } else { - DEBUG_MSG("Store & Forward Plugin - Disabled\n"); + DEBUG_MSG("Store & Forward Module - Disabled\n"); } #endif @@ -293,7 +293,7 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp) return ProcessMessage::CONTINUE; // Let others look at this message also if they want } -ProcessMessage StoreForwardPlugin::handleReceivedProtobuf(const MeshPacket &mp, StoreAndForward *p) +ProcessMessage StoreForwardModule::handleReceivedProtobuf(const MeshPacket &mp, StoreAndForward *p) { if (!radioConfig.preferences.store_forward_module_enabled) { // If this module is not enabled in any capacity, don't handle the packet, and allow other modules to consume @@ -323,9 +323,9 @@ ProcessMessage StoreForwardPlugin::handleReceivedProtobuf(const MeshPacket &mp, // Send the last 60 minutes of messages. if (this->busy) { strcpy(this->routerMessage, "** S&F - Busy. Try again shortly."); - storeForwardPlugin->sendMessage(getFrom(&mp), this->routerMessage); + storeForwardModule->sendMessage(getFrom(&mp), this->routerMessage); } else { - storeForwardPlugin->historySend(1000 * 60, getFrom(&mp)); + storeForwardModule->historySend(1000 * 60, getFrom(&mp)); } break; @@ -377,8 +377,8 @@ ProcessMessage StoreForwardPlugin::handleReceivedProtobuf(const MeshPacket &mp, return ProcessMessage::STOP; // There's no need for others to look at this message. } -StoreForwardPlugin::StoreForwardPlugin() - : SinglePortPlugin("StoreForwardPlugin", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardPlugin") +StoreForwardModule::StoreForwardModule() + : SinglePortPlugin("StoreForwardModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardModule") { #ifndef NO_ESP32 @@ -387,7 +387,7 @@ StoreForwardPlugin::StoreForwardPlugin() if (StoreForward_Dev) { /* - Uncomment the preferences below if you want to use the plugin + Uncomment the preferences below if you want to use the module without having to configure it from the PythonAPI or WebUI. */ @@ -400,7 +400,7 @@ StoreForwardPlugin::StoreForwardPlugin() // Router if (radioConfig.preferences.is_router) { - DEBUG_MSG("Initializing Store & Forward Plugin - Enabled as Router\n"); + DEBUG_MSG("Initializing Store & Forward Module - Enabled as Router\n"); if (ESP.getPsramSize()) { if (ESP.getFreePsram() >= 1024 * 1024) { @@ -427,17 +427,17 @@ StoreForwardPlugin::StoreForwardPlugin() } else { DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n"); - DEBUG_MSG("Store & Forward Plugin - Aborting Startup.\n"); + DEBUG_MSG("Store & Forward Module - Aborting Startup.\n"); } } else { DEBUG_MSG("Device doesn't have PSRAM.\n"); - DEBUG_MSG("Store & Forward Plugin - Aborting Startup.\n"); + DEBUG_MSG("Store & Forward Module - Aborting Startup.\n"); } // Client } else { - DEBUG_MSG("Initializing Store & Forward Plugin - Enabled as Client\n"); + DEBUG_MSG("Initializing Store & Forward Module - Enabled as Client\n"); } } #endif diff --git a/src/modules/esp32/StoreForwardModule.h b/src/modules/esp32/StoreForwardModule.h index 2514b89bf..4d610c667 100644 --- a/src/modules/esp32/StoreForwardModule.h +++ b/src/modules/esp32/StoreForwardModule.h @@ -18,7 +18,7 @@ struct PacketHistoryStruct { pb_size_t payload_size; }; -class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThread +class StoreForwardModule : public SinglePortPlugin, private concurrency::OSThread { // bool firstTime = 1; bool busy = 0; @@ -37,7 +37,7 @@ class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThrea uint32_t packetTimeMax = 2000; public: - StoreForwardPlugin(); + StoreForwardModule(); /** Update our local reference of when we last saw that node. @@ -82,4 +82,4 @@ class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThrea }; -extern StoreForwardPlugin *storeForwardPlugin; +extern StoreForwardModule *storeForwardModule; diff --git a/variants/diy/v1/variant.h b/variants/diy/v1/variant.h index d1724340e..2d2b195cf 100644 --- a/variants/diy/v1/variant.h +++ b/variants/diy/v1/variant.h @@ -9,7 +9,7 @@ //#define GPS_TX_PIN 12 // not connected #define BUTTON_PIN 39 // The middle button GPIO on the T-Beam -#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Plugin (#975). +#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975). #define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets) #define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module diff --git a/variants/diy/v1_1/variant.h b/variants/diy/v1_1/variant.h index d5d6f238c..3100c7029 100644 --- a/variants/diy/v1_1/variant.h +++ b/variants/diy/v1_1/variant.h @@ -8,7 +8,7 @@ #define BUTTON_PIN 2 // The middle button GPIO on the T-Beam #define BUTTON_NEED_PULLUP -#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Plugin (#975). +#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975). #define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module #define LORA_RESET 27 // RST for SX1276, and for SX1262/SX1268 diff --git a/variants/heltec_v2.1/variant.h b/variants/heltec_v2.1/variant.h index daa1ab880..2c0f4e165 100644 --- a/variants/heltec_v2.1/variant.h +++ b/variants/heltec_v2.1/variant.h @@ -27,4 +27,4 @@ #define ADC_MULTIPLIER 3.8 #define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. diff --git a/variants/tbeam/variant.h b/variants/tbeam/variant.h index fef19e785..11bc21f4a 100644 --- a/variants/tbeam/variant.h +++ b/variants/tbeam/variant.h @@ -5,7 +5,7 @@ #define BUTTON_PIN 38 // The middle button GPIO on the T-Beam //#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented anywhere. -#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. #define LED_INVERTED 1 #define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4 diff --git a/variants/tbeam_v07/variant.h b/variants/tbeam_v07/variant.h index ff007428c..359641aa4 100644 --- a/variants/tbeam_v07/variant.h +++ b/variants/tbeam_v07/variant.h @@ -5,7 +5,7 @@ #define BUTTON_PIN 39 #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module diff --git a/variants/tlora_v1/variant.h b/variants/tlora_v1/variant.h index 06352fbbd..c138447df 100644 --- a/variants/tlora_v1/variant.h +++ b/variants/tlora_v1/variant.h @@ -12,7 +12,7 @@ #define LED_PIN 2 // If defined we will blink this LED #define BUTTON_PIN 0 // If defined, this will be used for user button presses #define BUTTON_NEED_PULLUP -#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module