2021-02-21 06:03:44 +00:00
|
|
|
#pragma once
|
2022-03-09 08:01:43 +00:00
|
|
|
#include "ProtobufModule.h"
|
2021-02-21 06:03:44 +00:00
|
|
|
|
|
|
|
/**
|
2022-02-27 10:21:02 +00:00
|
|
|
* Routing module for router control messages
|
2021-02-21 06:03:44 +00:00
|
|
|
*/
|
2022-03-09 08:01:43 +00:00
|
|
|
class AdminModule : public ProtobufModule<AdminMessage>
|
2021-02-21 06:03:44 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Constructor
|
|
|
|
* name is for debugging output
|
|
|
|
*/
|
2022-02-27 10:21:02 +00:00
|
|
|
AdminModule();
|
2021-02-21 06:03:44 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/** Called to handle a particular incoming message
|
|
|
|
|
|
|
|
@return true if you've guaranteed you've handled this message and no other handlers should be considered for it
|
|
|
|
*/
|
2022-01-24 17:24:40 +00:00
|
|
|
virtual bool handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *p) override;
|
2021-02-21 06:03:44 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void handleSetOwner(const User &o);
|
|
|
|
void handleSetChannel(const Channel &cc);
|
2021-08-01 18:21:36 +00:00
|
|
|
void handleSetRadio(RadioConfig &r);
|
2022-05-01 22:53:44 +00:00
|
|
|
void handleSetConfig(Config &c);
|
2021-02-26 07:34:00 +00:00
|
|
|
|
|
|
|
void handleGetChannel(const MeshPacket &req, uint32_t channelIndex);
|
|
|
|
void handleGetRadio(const MeshPacket &req);
|
2022-05-01 02:39:48 +00:00
|
|
|
void handleGetConfig(const MeshPacket &req);
|
2022-03-09 22:14:56 +00:00
|
|
|
void handleGetOwner(const MeshPacket &req);
|
2021-02-21 06:03:44 +00:00
|
|
|
};
|
|
|
|
|
2022-02-27 10:21:02 +00:00
|
|
|
extern AdminModule *adminModule;
|