Rename MeshPlugin, SinglePortPlugin and ProtobufPlugin

This commit is contained in:
Sacha Weatherstone
2022-03-09 19:01:43 +11:00
parent 46b8b61b7f
commit 6bee95d6b2
33 changed files with 80 additions and 80 deletions

View File

@@ -123,7 +123,7 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r)
default:
AdminMessage response = AdminMessage_init_default;
AdminMessageHandleResult handleResult = MeshPlugin::handleAdminMessageForAllPlugins(mp, r, &response);
AdminMessageHandleResult handleResult = MeshModule::handleAdminMessageForAllPlugins(mp, r, &response);
if (handleResult == AdminMessageHandleResult::HANDLED_WITH_RESPONSE)
{
@@ -195,7 +195,7 @@ void AdminModule::handleSetRadio(RadioConfig &r)
service.reloadConfig();
}
AdminModule::AdminModule() : ProtobufPlugin("Admin", PortNum_ADMIN_APP, AdminMessage_fields)
AdminModule::AdminModule() : ProtobufModule("Admin", PortNum_ADMIN_APP, AdminMessage_fields)
{
// restrict to the admin channel for rx
boundChannel = Channels::adminChannel;

View File

@@ -1,10 +1,10 @@
#pragma once
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
/**
* Routing module for router control messages
*/
class AdminModule : public ProtobufPlugin<AdminMessage>
class AdminModule : public ProtobufModule<AdminMessage>
{
public:
/** Constructor

View File

@@ -23,7 +23,7 @@ extern bool loadProto(const char *filename, size_t protoSize, size_t objSize, co
extern bool saveProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, const void *dest_struct);
CannedMessageModule::CannedMessageModule()
: SinglePortPlugin("canned", PortNum_TEXT_MESSAGE_APP),
: SinglePortModule("canned", PortNum_TEXT_MESSAGE_APP),
concurrency::OSThread("CannedMessageModule")
{
if (radioConfig.preferences.canned_message_module_enabled)

View File

@@ -1,5 +1,5 @@
#pragma once
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
#include "input/InputBroker.h"
enum cannedMessageModuleRunState
@@ -21,7 +21,7 @@ enum cannedMessageModuleRunState
#define CANNED_MESSAGE_MODULE_MESSAGES_SIZE 800
class CannedMessageModule :
public SinglePortPlugin,
public SinglePortModule,
public Observable<const UIFrameEvent *>,
private concurrency::OSThread
{

View File

@@ -108,7 +108,7 @@ void ExternalNotificationModule::setExternalOff()
// --------
ExternalNotificationModule::ExternalNotificationModule()
: SinglePortPlugin("ExternalNotificationModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread(
: SinglePortModule("ExternalNotificationModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread(
"ExternalNotificationModule")
{
// restrict to the admin channel for rx

View File

@@ -1,6 +1,6 @@
#pragma once
#include "SinglePortPlugin.h"
#include "SinglePortModule.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include <Arduino.h>
@@ -10,7 +10,7 @@
* Radio interface for ExternalNotificationModule
*
*/
class ExternalNotificationModule : public SinglePortPlugin, private concurrency::OSThread
class ExternalNotificationModule : public SinglePortModule, private concurrency::OSThread
{
public:
ExternalNotificationModule();

View File

@@ -51,7 +51,7 @@ MeshPacket *NodeInfoModule::allocReply()
}
NodeInfoModule::NodeInfoModule()
: ProtobufPlugin("nodeinfo", PortNum_NODEINFO_APP, User_fields), concurrency::OSThread("NodeInfoModule")
: ProtobufModule("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 *

View File

@@ -1,10 +1,10 @@
#pragma once
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
/**
* NodeInfo module for sending/receiving NodeInfos into the mesh
*/
class NodeInfoModule : public ProtobufPlugin<User>, private concurrency::OSThread
class NodeInfoModule : public ProtobufModule<User>, 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;

View File

@@ -10,7 +10,7 @@
PositionModule *positionModule;
PositionModule::PositionModule()
: ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionModule")
: ProtobufModule("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)

View File

@@ -1,11 +1,11 @@
#pragma once
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
#include "concurrency/OSThread.h"
/**
* Position module for sending/receiving positions into the mesh
*/
class PositionModule : public ProtobufPlugin<Position>, private concurrency::OSThread
class PositionModule : public ProtobufModule<Position>, 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;

View File

@@ -47,7 +47,7 @@ static uint64_t digitalReads(uint64_t mask)
}
RemoteHardwareModule::RemoteHardwareModule()
: ProtobufPlugin("remotehardware", PortNum_REMOTE_HARDWARE_APP, HardwareMessage_fields), concurrency::OSThread(
: ProtobufModule("remotehardware", PortNum_REMOTE_HARDWARE_APP, HardwareMessage_fields), concurrency::OSThread(
"remotehardware")
{
}

View File

@@ -1,12 +1,12 @@
#pragma once
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
#include "mesh/generated/remote_hardware.pb.h"
#include "concurrency/OSThread.h"
/**
* A module that provides easy low-level remote access to device hardware.
*/
class RemoteHardwareModule : public ProtobufPlugin<HardwareMessage>, private concurrency::OSThread
class RemoteHardwareModule : public ProtobufModule<HardwareMessage>, private concurrency::OSThread
{
/// The current set of GPIOs we've been asked to watch for changes
uint64_t watchGpios = 0;

View File

@@ -1,17 +1,17 @@
#pragma once
#include "SinglePortPlugin.h"
#include "SinglePortModule.h"
/**
* A simple example module that just replies with "Message received" to any message it receives.
*/
class ReplyModule : public SinglePortPlugin
class ReplyModule : public SinglePortModule
{
public:
/** Constructor
* name is for debugging output
*/
ReplyModule() : SinglePortPlugin("reply", PortNum_REPLY_APP) {}
ReplyModule() : SinglePortModule("reply", PortNum_REPLY_APP) {}
protected:

View File

@@ -41,7 +41,7 @@ void RoutingModule::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, C
router->sendLocal(p); // we sometimes send directly to the local node
}
RoutingModule::RoutingModule() : ProtobufPlugin("routing", PortNum_ROUTING_APP, Routing_fields)
RoutingModule::RoutingModule() : ProtobufModule("routing", PortNum_ROUTING_APP, Routing_fields)
{
isPromiscuous = true;
}

View File

@@ -1,11 +1,11 @@
#pragma once
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
#include "Channels.h"
/**
* Routing module for router control messages
*/
class RoutingModule : public ProtobufPlugin<Routing>
class RoutingModule : public ProtobufModule<Routing>
{
public:
/** Constructor

View File

@@ -1,15 +1,15 @@
#pragma once
#include "../mesh/generated/telemetry.pb.h"
#include "ProtobufPlugin.h"
#include "ProtobufModule.h"
#include <OLEDDisplay.h>
#include <OLEDDisplayUi.h>
class TelemetryModule : private concurrency::OSThread, public ProtobufPlugin<Telemetry>
class TelemetryModule : private concurrency::OSThread, public ProtobufModule<Telemetry>
{
public:
TelemetryModule()
: concurrency::OSThread("TelemetryModule"),
ProtobufPlugin("Telemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
ProtobufModule("Telemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
{
lastMeasurementPacket = nullptr;
}

View File

@@ -1,17 +1,17 @@
#pragma once
#include "SinglePortPlugin.h"
#include "SinglePortModule.h"
#include "Observer.h"
/**
* Text message handling for meshtastic - draws on the OLED display the most recent received message
*/
class TextMessageModule : public SinglePortPlugin, public Observable<const MeshPacket *>
class TextMessageModule : public SinglePortModule, public Observable<const MeshPacket *>
{
public:
/** Constructor
* name is for debugging output
*/
TextMessageModule() : SinglePortPlugin("text", PortNum_TEXT_MESSAGE_APP) {}
TextMessageModule() : SinglePortModule("text", PortNum_TEXT_MESSAGE_APP) {}
protected:

View File

@@ -1,6 +1,6 @@
#pragma once
#include "SinglePortPlugin.h"
#include "SinglePortModule.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include <Arduino.h>
@@ -23,12 +23,12 @@ extern RangeTestModule *rangeTestModule;
* Radio interface for RangeTestModule
*
*/
class RangeTestModuleRadio : public SinglePortPlugin
class RangeTestModuleRadio : public SinglePortModule
{
uint32_t lastRxID = 0;
public:
RangeTestModuleRadio() : SinglePortPlugin("RangeTestModuleRadio", PortNum_TEXT_MESSAGE_APP) {}
RangeTestModuleRadio() : SinglePortModule("RangeTestModuleRadio", PortNum_TEXT_MESSAGE_APP) {}
/**
* Send our payload into the mesh

View File

@@ -61,7 +61,7 @@ SerialModule::SerialModule() : concurrency::OSThread("SerialModule") {}
char serialStringChar[Constants_DATA_PAYLOAD_LEN];
SerialModuleRadio::SerialModuleRadio() : SinglePortPlugin("SerialModuleRadio", PortNum_SERIAL_APP)
SerialModuleRadio::SerialModuleRadio() : SinglePortModule("SerialModuleRadio", PortNum_SERIAL_APP)
{
// restrict to the admin channel for rx
boundChannel = Channels::serialChannel;

View File

@@ -1,6 +1,6 @@
#pragma once
#include "SinglePortPlugin.h"
#include "SinglePortModule.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include <Arduino.h>
@@ -23,7 +23,7 @@ extern SerialModule *serialModule;
* Radio interface for SerialModule
*
*/
class SerialModuleRadio : public SinglePortPlugin
class SerialModuleRadio : public SinglePortModule
{
uint32_t lastRxID = 0;

View File

@@ -378,7 +378,7 @@ ProcessMessage StoreForwardModule::handleReceivedProtobuf(const MeshPacket &mp,
}
StoreForwardModule::StoreForwardModule()
: SinglePortPlugin("StoreForwardModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardModule")
: SinglePortModule("StoreForwardModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("StoreForwardModule")
{
#ifndef NO_ESP32

View File

@@ -1,6 +1,6 @@
#pragma once
#include "SinglePortPlugin.h"
#include "SinglePortModule.h"
#include "concurrency/OSThread.h"
#include "mesh/generated/storeforward.pb.h"
@@ -18,7 +18,7 @@ struct PacketHistoryStruct {
pb_size_t payload_size;
};
class StoreForwardModule : public SinglePortPlugin, private concurrency::OSThread
class StoreForwardModule : public SinglePortModule, private concurrency::OSThread
{
// bool firstTime = 1;
bool busy = 0;