BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/MessageService/Message.h Source File
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
Message.h
Go to the documentation of this file.
1
24#ifndef MESSAGE_H
25#define MESSAGE_H
26
27#ifdef ARDUINO
28 #include <Arduino.h> // include Arduino-Library for platformIO-build
29#else
30 #include <iostream> // include iostream for local testing
31 #include <cstring>
32 #include <cstdio>
33 #include <mockArduino.h>
34 using namespace arduinoMocking;
35#endif
36
37#include "Content.h" // include Content-template
38
57 char sender_id; // Src-ID[1 Byte]
58 char receiver_id; // Rec-ID[1 Byte]
59 String msg_text; // Message-Text
60
68
79 Message_content_t(char sender_id, char receiver_id, String msg_txt, uint8_t txt_size) :
81 msg_text += '\0';
82 }
83};
84
108class Message: public Content<Message_content_t, String>
109{
110 public:
116 Message();
117
122 ~Message();
123
131 Message(bool boolean_expression);
132
141
149 Message(Message_content_t* message_content);
150
157
158 private:
164 virtual void rep_to_content() override;
165
171 virtual void content_to_rep() override;
172
173
174
175};
176
177#endif // MESSAGE_H
The cascading of processing information and the rules applied to it lead to the concept of content- a...
Definition Content.h:45
String representation
Definition Content.h:94
Represents a message with information for sender and receiver, and provides methods for converting be...
Definition Message.h:109
~Message()
Destroy the Message object.
Definition Message.cpp:32
Message()
Default constructor for Message.
Definition Message.cpp:27
String to_string()
Converts the message to a string representation.
Definition Message.cpp:72
Provides mock implementations of Arduino framework functions and classes for native builds.
Definition mockArduino.cpp:28
std::string String
Alias for std::string to simulate Arduino's String type.
Definition mockArduino.h:51
Represents the content of a message with sender and receiver information.
Definition Message.h:56
char receiver_id
Definition Message.h:58
String msg_text
Definition Message.h:59
Message_content_t()
Default constructor for Message_content_t.
Definition Message.h:66
char sender_id
Definition Message.h:57
Message_content_t(char sender_id, char receiver_id, String msg_txt, uint8_t txt_size)
Parameterized constructor for Message_content_t.
Definition Message.h:79