Return errors for unauthorized requests or out of bound channel nums

This commit is contained in:
Kevin Hester
2021-03-23 11:44:51 +08:00
parent e9faf657df
commit d32386a027
8 changed files with 88 additions and 40 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "mesh/Channels.h"
#include "mesh/MeshTypes.h"
#include <vector>
@@ -90,6 +91,11 @@ class MeshPlugin
*/
virtual bool wantUIFrame() { return false; }
MeshPacket *allocAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex);
/// Send an error response for the specified packet.
MeshPacket *allocErrorResponse(Routing_Error err, const MeshPacket *p);
private:
/**
* If any of the current chain of plugins has already sent a reply, it will be here. This is useful to allow