Midnight Sun Firmware
Loading...
Searching...
No Matches
metadata.h
1#pragma once
2
3/************************************************************************************************
4 * @file metadata.h
5 *
6 * @brief Header file defining the Metadata class
7 *
8 * @date 2025-01-04
9 * @author Aryan Kashem
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <cstdint>
14#include <string>
15
16/* Inter-component Headers */
17
18/* Intra-component Headers */
19
26namespace Datagram {
27
34class Metadata {
35 public:
39 struct Payload {
40 std::string projectName;
41 std::string projectStatus;
42 std::string hardwareModel;
43 };
44
49 explicit Metadata(Payload &data);
50
54 Metadata() = default;
55
60 std::string serialize() const;
61
66 void deserialize(std::string &metadataPayload);
67
72 void setProjectName(const std::string &projectName);
73
78 void setProjectStatus(const std::string &projectStatus);
79
84 void setHardwareModel(const std::string &hardwareModel);
85
90 std::string getProjectName() const;
91
96 std::string getProjectStatus() const;
97
102 std::string getHardwareModel() const;
103
104 private:
106};
107
108} // namespace Datagram
109
Definition: metadata.h:34
std::string getProjectStatus() const
Gets the target project status.
Definition: metadata.cc:61
Payload m_metadata
Definition: metadata.h:105
void setProjectName(const std::string &projectName)
Sets the target project name.
Definition: metadata.cc:45
Metadata()=default
Default constructor for Metadata object.
std::string serialize() const
Serializes Metadata data with the Metadata command code for transmission.
Definition: metadata.cc:23
std::string getProjectName() const
Gets the target project name.
Definition: metadata.cc:57
void setHardwareModel(const std::string &hardwareModel)
Sets the target hardware model.
Definition: metadata.cc:53
void deserialize(std::string &metadataPayload)
Deserializes Metadata data from payload string.
Definition: metadata.cc:33
std::string getHardwareModel() const
Gets the target hardware model.
Definition: metadata.cc:65
void setProjectStatus(const std::string &projectStatus)
Sets the target project status.
Definition: metadata.cc:49
Metadata Datagram payload storage.
Definition: metadata.h:39
std::string hardwareModel
Definition: metadata.h:42
std::string projectStatus
Definition: metadata.h:41
std::string projectName
Definition: metadata.h:40