Move DecodedServiceEnvelope into its own file (#5715)

This commit is contained in:
Eric Severance
2025-01-02 08:40:14 +08:00
committed by GitHub
co-authored by GitHub
parent 9abd07bb05
commit c2c06ed0ad
3 changed files with 37 additions and 18 deletions
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include "mesh/generated/meshtastic/mqtt.pb.h"
// meshtastic_ServiceEnvelope that automatically releases dynamically allocated memory when it goes out of scope.
struct DecodedServiceEnvelope : public meshtastic_ServiceEnvelope {
DecodedServiceEnvelope(const uint8_t *payload, size_t length);
DecodedServiceEnvelope(DecodedServiceEnvelope &) = delete;
DecodedServiceEnvelope(DecodedServiceEnvelope &&);
~DecodedServiceEnvelope();
// Clients must check that this is true before using.
const bool validDecode;
};