mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-12 08:02:04 +00:00
Implement getOwner
This commit is contained in:
parent
8a7a6e9a5d
commit
f33cd4081e
@ -61,6 +61,18 @@ void AdminModule::handleGetRadio(const MeshPacket &req)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdminModule::handleGetOwner(const MeshPacket &req)
|
||||||
|
{
|
||||||
|
if (req.decoded.want_response) {
|
||||||
|
// We create the reply here
|
||||||
|
AdminMessage r = AdminMessage_init_default;
|
||||||
|
r.get_owner_response = owner;
|
||||||
|
|
||||||
|
r.which_variant = AdminMessage_get_owner_response_tag;
|
||||||
|
myReply = allocDataProtobuf(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool AdminModule::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
|
// if handled == false, then let others look at this message also if they want
|
||||||
@ -101,6 +113,11 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r)
|
|||||||
handleGetRadio(mp);
|
handleGetRadio(mp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AdminMessage_get_owner_request_tag:
|
||||||
|
DEBUG_MSG("Client is getting owner\n");
|
||||||
|
handleGetOwner(mp);
|
||||||
|
break;
|
||||||
|
|
||||||
case AdminMessage_reboot_seconds_tag: {
|
case AdminMessage_reboot_seconds_tag: {
|
||||||
int32_t s = r->reboot_seconds;
|
int32_t s = r->reboot_seconds;
|
||||||
DEBUG_MSG("Rebooting in %d seconds\n", s);
|
DEBUG_MSG("Rebooting in %d seconds\n", s);
|
||||||
|
@ -26,6 +26,7 @@ class AdminModule : public ProtobufModule<AdminMessage>
|
|||||||
|
|
||||||
void handleGetChannel(const MeshPacket &req, uint32_t channelIndex);
|
void handleGetChannel(const MeshPacket &req, uint32_t channelIndex);
|
||||||
void handleGetRadio(const MeshPacket &req);
|
void handleGetRadio(const MeshPacket &req);
|
||||||
|
void handleGetOwner(const MeshPacket &req);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern AdminModule *adminModule;
|
extern AdminModule *adminModule;
|
||||||
|
Loading…
Reference in New Issue
Block a user