From 72ccb5a77352388a379999e48f2518a384ce6d67 Mon Sep 17 00:00:00 2001 From: F-L-X-S Date: Tue, 1 Oct 2024 22:27:57 +0200 Subject: [PATCH] Squashed commit of the following: Integrated CharArray for sending nullbytes in frame commit 6e3692e00e2f52c794e434912f67b736e82999b3 Author: F-L-X-S Date: Tue Oct 1 22:17:27 2024 +0200 specified Partner-device commit 30bdde854926a1b3e5c7eeb6d5aaf3b88ff7a76e Author: F-L-X-S Date: Tue Oct 1 22:09:13 2024 +0200 removed nulltermination (not necessary for CharArray) commit 5fc238b48c14ce6b8cd68f39b1b6c5f5e2106a0e Author: F-L-X-S Date: Tue Oct 1 21:33:27 2024 +0200 exit-condition in receive loop before nullbyte-condition/removed serial-debug functions commit 62bafb76daacde00cec1ba5472aaf464acbd7aef Author: F-L-X-S Date: Tue Oct 1 21:30:20 2024 +0200 modified test for CharArray commit 5b5937fd23f82f4b01230e82f4eb6ece6ae32d90 Author: F-L-X-S Date: Tue Oct 1 21:29:55 2024 +0200 Constructor from String commit eabf6b52a931ac12e84c44c8e2aa4d73fc17a825 Author: F-L-X-S Date: Tue Oct 1 20:44:42 2024 +0200 serial debugging with char-array commit bc974c241a3174cc5c0d9d006fa19a9dd85486d6 Author: F-L-X-S Date: Tue Oct 1 20:43:54 2024 +0200 removed serial debug lib commit 527ff84bc1598fbc1081dfccf632492f2e154a20 Author: F-L-X-S Date: Wed Sep 18 21:17:42 2024 +0200 docs commit 5a5219f344cb58fbe63a6e39b37823c9269cc017 Author: F-L-X-S Date: Wed Sep 18 21:17:07 2024 +0200 renamed test commit 7112f683a87f201fa8b4cace4b38359012192ff7 Author: F-L-X-S Date: Wed Sep 18 21:15:16 2024 +0200 receive-testing for CharArray commit 66b7077c58b2ed74ed66d4ac5e1819ba7e5aa8ad Author: F-L-X-S Date: Wed Sep 18 21:03:11 2024 +0200 String assignment commit 1551f3e613cf52ece92dd1e6a5ce46dbecbbee04 Author: F-L-X-S Date: Wed Sep 18 21:02:56 2024 +0200 modified test for CharArray commit 1b5863da6db0c52eeeb9bb6fb3227fba83ffd5b4 Author: F-L-X-S Date: Wed Sep 18 19:37:46 2024 +0200 hex-string as classfunction commit 585dcbd2e5a12169bd2cde7fb622b44b54ac3fd1 Author: F-L-X-S Date: Wed Sep 18 19:37:33 2024 +0200 Added hex-string representation commit 0ea954c0793a2fcb17d8afdeb09ac472b76606ed Author: F-L-X-S Date: Wed Sep 18 19:24:07 2024 +0200 Manual Test for CharArray commit 6a8322cc54d5767442134e9a4aa5954a238719a0 Author: F-L-X-S Date: Wed Sep 18 19:08:18 2024 +0200 process charArray of representation as const char* commit f1c229ec48d3d07fd8200beaac841e1538cfff3b Author: F-L-X-S Date: Wed Sep 18 19:07:41 2024 +0200 deleted constructor with predefined size / added copy- and assignment-operator / getData as const commit e48c5a16a8f5480f915ecf06c2f800bc9ee74f55 Author: F-L-X-S Date: Wed Sep 18 17:17:37 2024 +0200 removed copy-constructor and assignment operator commit 4e47e0d2e25fcbdeb2001ea5841b9b4c50b84de4 Author: F-L-X-S Date: Wed Sep 18 17:17:19 2024 +0200 added equality operator commit a4d08af3cf85b0de7359c354f96fec01d1ef1c5c Author: F-L-X-S Date: Sat Sep 14 09:22:52 2024 +0200 replaced frameString by CharArray commit 420bf226e9bfabe18205352cd315892249274746 Author: F-L-X-S Date: Sat Sep 14 09:22:41 2024 +0200 string Pdu as String commit c4c3111341a5a6d4d9e94f29f0c394a09d606062 Author: F-L-X-S Date: Sat Sep 14 08:08:40 2024 +0200 deleted buffersize calculation commit c4fe83694769372b369203accf4730247e4b4a36 Author: F-L-X-S Date: Fri Sep 13 17:59:42 2024 +0200 pduString as String / Frame as CharArray (copy_to_heap not necessary anymore-> deleted) commit d8aca6638c9c0fc14d9e1499a1c580f0f2fe569e Author: F-L-X-S Date: Fri Sep 13 17:58:44 2024 +0200 recBuffer as pointer to charArray commit df39703bab38cb0d28b65c4af06632b6b2d7b173 Author: F-L-X-S Date: Fri Sep 13 17:58:16 2024 +0200 replaced Frame/frameString by charArray commit 315e72e77371c8be0006009f6c7463d539ea8e76 Author: F-L-X-S Date: Fri Sep 13 17:57:31 2024 +0200 deleted getPDU and getFrame-function, replaced frameString by charArray commit e5eda41abe0685fbf0bcd08abe13d2b949ba39f2 Author: F-L-X-S Date: Fri Sep 13 17:56:41 2024 +0200 Created CharArray class commit 9c43ad9ceb146e216690806357c2f2a4c4477fb3 Author: F-L-X-S Date: Fri Sep 13 11:21:43 2024 +0200 typo commit 9273311da9ceb61774be14f7941142b2d51b2346 Author: F-L-X-S Date: Fri Sep 13 08:50:17 2024 +0200 silencetime for nullbyte detection commit b795b05babf518e20327c67b7af58b17b19593c9 Author: F-L-X-S Date: Fri Sep 13 08:18:18 2024 +0200 Revert "CRC as Hex in ASCII-format" This reverts commit b28a7ad6374145ec6ebfe4367c912a26b7b55f54. commit 76bec93e1cb835e157bb4292b786e4a6a5c8946b Author: F-L-X-S Date: Fri Sep 13 08:16:52 2024 +0200 Revert "frame with null in crc" This reverts commit 730fa36a7901eeecfd5ad057001235f053a08f39. commit 730fa36a7901eeecfd5ad057001235f053a08f39 Author: F-L-X-S Date: Fri Sep 13 08:13:28 2024 +0200 frame with null in crc commit b28a7ad6374145ec6ebfe4367c912a26b7b55f54 Author: F-L-X-S Date: Wed Sep 11 14:08:55 2024 +0200 CRC as Hex in ASCII-format commit 6c6715826cadbd32f586fe666d068caf6e51af40 Author: F-L-X-S Date: Wed Sep 11 09:17:53 2024 +0200 Ack only for non-ACK messages --- docs/html/_char_array_8cpp.html | 110 +++++ docs/html/_char_array_8h.html | 121 +++++ docs/html/_char_array_8h_source.html | 171 +++++++ docs/html/_comm_interface_8h.html | 2 +- docs/html/_comm_interface_8h_source.html | 135 +++--- .../_comm_interface__modbus_r_t_u_8h.html | 4 +- ...omm_interface__modbus_r_t_u_8h_source.html | 20 +- docs/html/_frame_8h.html | 30 +- docs/html/_frame_8h_source.html | 41 +- docs/html/_frame__modbus_r_t_u_8h_source.html | 64 ++- docs/html/_message_service_8h_source.html | 4 +- docs/html/_service_interface_8h_source.html | 123 +++-- docs/html/annotated.html | 41 +- docs/html/class_char_array-members.html | 114 +++++ docs/html/class_char_array.html | 435 ++++++++++++++++++ docs/html/class_comm_interface-members.html | 8 +- docs/html/class_comm_interface.html | 48 +- ..._comm_interface__modbus_r_t_u-members.html | 24 +- .../class_comm_interface__modbus_r_t_u.html | 34 +- .../class_comm_interface_base-members.html | 4 +- docs/html/class_comm_interface_base.html | 36 +- docs/html/class_frame-members.html | 24 +- docs/html/class_frame.html | 101 ++-- docs/html/class_frame.png | Bin 940 -> 910 bytes .../class_frame__modbus_r_t_u-members.html | 26 +- docs/html/class_frame__modbus_r_t_u.html | 125 ++--- docs/html/class_frame__modbus_r_t_u.png | Bin 934 -> 904 bytes .../html/class_service_interface-members.html | 4 +- docs/html/class_service_interface.html | 16 +- ...rvice_interface__modbus_r_t_u-members.html | 4 +- ...class_service_interface__modbus_r_t_u.html | 16 +- docs/html/classes.html | 2 +- .../dir_63423c24249a4ea801821a9ef8d1869d.html | 4 + docs/html/doxygen_crawl.html | 53 ++- docs/html/files.html | 6 +- docs/html/functions.html | 27 +- docs/html/functions_func.html | 19 +- docs/html/functions_vars.html | 8 +- docs/html/globals.html | 1 - docs/html/hierarchy.html | 73 +-- docs/html/menudata.js | 1 - docs/html/search/all_13.js | 23 +- docs/html/search/all_2.js | 77 ++-- docs/html/search/all_5.js | 4 +- docs/html/search/all_6.js | 17 +- docs/html/search/all_b.js | 8 +- docs/html/search/all_c.js | 17 +- docs/html/search/all_d.js | 4 +- docs/html/search/all_e.js | 6 +- docs/html/search/classes_0.js | 31 +- docs/html/search/files_0.js | 12 +- docs/html/search/functions_2.js | 21 +- docs/html/search/functions_5.js | 4 +- docs/html/search/functions_6.js | 17 +- docs/html/search/functions_9.js | 6 +- docs/html/search/functions_c.js | 2 +- docs/html/search/functions_f.js | 23 +- docs/html/search/searchdata.js | 2 +- docs/html/search/typedefs_0.js | 2 +- docs/html/search/variables_3.js | 4 +- docs/html/search/variables_4.js | 4 +- lib/Frame/CharArray.cpp | 246 ++++++++++ lib/Frame/CharArray.h | 190 ++++++++ lib/Frame/Frame.cpp | 20 +- lib/Frame/Frame.h | 35 +- lib/Interface/CommInterface.h | 33 +- lib/Interface/ServiceInterface.h | 24 +- lib/MessageService/MessageService.cpp | 3 +- lib/ModbusRTU/CommInterface_modbusRTU.cpp | 66 +-- lib/ModbusRTU/CommInterface_modbusRTU.h | 5 +- lib/ModbusRTU/Frame_modbusRTU.cpp | 91 +--- lib/ModbusRTU/Frame_modbusRTU.h | 52 +-- lib/ModbusRTU/ServiceInterface_modbusRTU.cpp | 4 +- platformio.ini | 3 - src/main.cpp | 20 +- test/manual/test_CharArray.cpp | 77 ++++ test/manual/test_CommInterface.cpp | 29 +- ...t_Interface.cpp => test_CommInterface.cpp} | 92 ++-- 78 files changed, 2287 insertions(+), 1066 deletions(-) create mode 100644 docs/html/_char_array_8cpp.html create mode 100644 docs/html/_char_array_8h.html create mode 100644 docs/html/_char_array_8h_source.html create mode 100644 docs/html/class_char_array-members.html create mode 100644 docs/html/class_char_array.html create mode 100644 lib/Frame/CharArray.cpp create mode 100644 lib/Frame/CharArray.h create mode 100644 test/manual/test_CharArray.cpp rename test/native/test_Interface/{test_Interface.cpp => test_CommInterface.cpp} (56%) diff --git a/docs/html/_char_array_8cpp.html b/docs/html/_char_array_8cpp.html new file mode 100644 index 0000000..5cb6600 --- /dev/null +++ b/docs/html/_char_array_8cpp.html @@ -0,0 +1,110 @@ + + + + + + + +BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/Frame/CharArray.cpp File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
BusBricks 0.1 +
+
Object-oriented building-blocks to configure bus-communication for different services and interfaces on Arduino-MCUs
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+
CharArray.cpp File Reference
+
+
+
#include "CharArray.h"
+

Detailed Description

+
Author
Felix Schuelke (flxsc.nosp@m.ode@.nosp@m.gmail.nosp@m..com)
+
Version
0.1
+
Date
2024-08-18
+ +

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

+

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

+
+ + +
+ + diff --git a/docs/html/_char_array_8h.html b/docs/html/_char_array_8h.html new file mode 100644 index 0000000..b7e78be --- /dev/null +++ b/docs/html/_char_array_8h.html @@ -0,0 +1,121 @@ + + + + + + + +BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/Frame/CharArray.h File Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
BusBricks 0.1 +
+
Object-oriented building-blocks to configure bus-communication for different services and interfaces on Arduino-MCUs
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+ +
CharArray.h File Reference
+
+
+
#include <mockArduino.h>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

class  CharArray
 Class for storing char-array (byte-array) together with size. The Array is stored on Heap-memory and is extended by adding bytes with "+=" or by write-access to an index larger than the current size. More...
 
+

Detailed Description

+
Author
Felix Schuelke (flxsc.nosp@m.ode@.nosp@m.gmail.nosp@m..com)
+
Version
0.1
+
Date
2024-08-18
+ +

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

+

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

+
+ + +
+ + diff --git a/docs/html/_char_array_8h_source.html b/docs/html/_char_array_8h_source.html new file mode 100644 index 0000000..122e622 --- /dev/null +++ b/docs/html/_char_array_8h_source.html @@ -0,0 +1,171 @@ + + + + + + + +BusBricks: /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/Frame/CharArray.h Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
BusBricks 0.1 +
+
Object-oriented building-blocks to configure bus-communication for different services and interfaces on Arduino-MCUs
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+
CharArray.h
+
+
+Go to the documentation of this file.
1
+
24#ifndef CHARARRAY_H
+
25#define CHARARRAY_H
+
26
+
27#ifdef ARDUINO
+
28 #include <Arduino.h> // include Arduino-Library for platformIO-build
+
29#else
+
30 #include <mockArduino.h>
+
31 using namespace arduinoMocking;
+
32#endif
+
33
+
+
38class CharArray {
+
39private:
+
41 char* data;
+
42
+
44 size_t size;
+
45
+
52 void extendArray(size_t extendedSize);
+
53
+
54public:
+
59 CharArray();
+
60
+
61
+
66 ~CharArray();
+
67
+
78 CharArray(const CharArray& other);
+
79
+
91 CharArray& operator=(const CharArray& other);
+
92
+
102 CharArray& operator=(const String& other);
+
103
+
113 char& operator[](size_t index);
+
114
+
124 const char& operator[](size_t index) const;
+
125
+
126
+
133 CharArray& operator+=(char c);
+
134
+
141 bool operator==(const CharArray& other) const;
+
142
+
149 bool operator!=(const CharArray& other) const;
+
150
+
151
+
159 size_t getSize() const;
+
160
+
169 const char* getData() const;
+
170
+ +
177};
+
+
178
+
179
+
180
+
181#endif // CHARARRAY_H
+
Class for storing char-array (byte-array) together with size. The Array is stored on Heap-memory and ...
Definition CharArray.h:38
+
CharArray()
Construct a new empty Char Array object (0 byte)
Definition CharArray.cpp:30
+
size_t getSize() const
Retrieves the size of the char array.
Definition CharArray.cpp:201
+
char & operator[](size_t index)
Write-Access the element at the specified index.
Definition CharArray.cpp:120
+
CharArray & operator=(const CharArray &other)
Assignment operator.
Definition CharArray.cpp:67
+
String getHexString()
Get the Hex-Values of the Array as a String.
Definition CharArray.cpp:217
+
bool operator!=(const CharArray &other) const
Inequality Operator.
Definition CharArray.cpp:190
+
const char * getData() const
Provides direct access to the internal char array.
Definition CharArray.cpp:213
+
bool operator==(const CharArray &other) const
Equality Operator.
Definition CharArray.cpp:168
+
~CharArray()
Destroy the Char Array object.
Definition CharArray.cpp:36
+
CharArray & operator+=(char c)
+= Operator to append a single character
Definition CharArray.cpp:133
+ +
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
+
+ + +
+ + diff --git a/docs/html/_comm_interface_8h.html b/docs/html/_comm_interface_8h.html index 4830a2a..82d64b5 100644 --- a/docs/html/_comm_interface_8h.html +++ b/docs/html/_comm_interface_8h.html @@ -95,7 +95,7 @@
#include <mockArduino.h>
-#include <Frame.h>
+#include <CharArray.h>
#include <ErrorState.h>

Go to the source code of this file.

diff --git a/docs/html/_comm_interface_8h_source.html b/docs/html/_comm_interface_8h_source.html index 13e82d3..87df8e8 100644 --- a/docs/html/_comm_interface_8h_source.html +++ b/docs/html/_comm_interface_8h_source.html @@ -102,7 +102,7 @@
31 using namespace arduinoMocking;
32#endif
33
-
34#include<Frame.h>
+
34#include<CharArray.h>
35#include<ErrorState.h>
36
@@ -111,11 +111,11 @@
55public:
60 virtual void setup_interface(){};
61
-
67 virtual void sendNewFrame(String* sendFrame){};
+
67 virtual void sendNewFrame(CharArray* sendFrame){};
68
75 virtual bool finishedSending(){};
76
-
82 virtual void getReceivedFrame(String* destFrameBuffer){};
+
82 virtual void getReceivedFrame(CharArray* destFrameBuffer){};
83
90 virtual bool receivedNewFrame(){};
91
@@ -131,95 +131,92 @@
124 protected:
126 interface_type* interface;
127
-
129 String* sendBuffer = nullptr;
+
130
- +
133
-
134 // Send a Frame
-
135 // True, if a frame was send successfully
-
136
-
144 virtual bool send() = 0;
-
145
-
146
-
154 virtual bool receive() = 0;
-
155
-
156 public:
-
163 CommInterface(interface_type* interface, uint32_t baudrate): interface(interface){};
-
164
-
-
171 void sendNewFrame(String* sendFrame){
-
172 if (sendBuffer == nullptr)
-
173 {
-
174 sendBuffer = sendFrame; // set the send-buffer-ptr to the Frame, that has to be sent
-
175 }
-
176 };
+
141 virtual bool send() = 0;
+
142
+
143
+
151 virtual bool receive() = 0;
+
152
+
153 public:
+
160 CommInterface(interface_type* interface, uint32_t baudrate): interface(interface){};
+
161
+
+
168 void sendNewFrame(CharArray* sendFrame){
+
169 if (sendBuffer == nullptr)
+
170 {
+
171 sendBuffer = sendFrame; // set the send-buffer-ptr to the Frame, that has to be sent
+
172 }
+
173 };
-
177
-
- -
187 return sendBuffer==nullptr;
-
188 };
+
174
+
+ +
184 return sendBuffer==nullptr;
+
185 };
-
189
-
-
195 void getReceivedFrame(String* destFrameBuffer){
-
196 receiveBuffer = destFrameBuffer; // set the receive-buffer-ptr to the destination, the next received Frame should be stored at
-
197 };
+
186
+
+
192 void getReceivedFrame(CharArray* externalRecBuffer){
+
193 receiveBuffer = externalRecBuffer; // set the receive-buffer-ptr to the destination, the next received Frame should be stored at
+
194 };
-
198
-
- -
207 return receiveBuffer==nullptr;
-
208 };
+
195
+
+ +
204 return receiveBuffer==nullptr;
+
205 };
-
209
-
-
214 virtual void receiveCycle(){
-
215 // Receiving
-
216 if (receive()) {
-
217 receiveBuffer = nullptr;
-
218 };
-
219 };
+
206
+
+
211 virtual void receiveCycle(){
+
212 // Receiving
+
213 if (receive()) {
+
214 receiveBuffer = nullptr;
+
215 };
+
216 };
-
220
-
-
225 virtual void sendCycle(){
-
226 // Sending
-
227 if (send()){
-
228 sendBuffer = nullptr;
-
229 };
-
230 };
+
217
+
+
222 virtual void sendCycle(){
+
223 // Sending
+
224 if (send()){
+
225 sendBuffer = nullptr;
+
226 };
+
227 };
-
231};
+
228};
-
232#endif // COMMINTERFACE_H
+
229#endif // COMMINTERFACE_H
+ - +
Class for storing char-array (byte-array) together with size. The Array is stored on Heap-memory and ...
Definition CharArray.h:38
Communcation-Interface-Base-Class of the CommInterface template specifies a standardized interface to...
Definition CommInterface.h:54
~CommInterfaceBase()
Destroy the Comm-Interface Base object.
Definition CommInterface.h:102
virtual bool receivedNewFrame()
Check, if a new Frame was received.
Definition CommInterface.h:90
-
virtual void getReceivedFrame(String *destFrameBuffer)
Define the destination, the next received Frame should be copied to ba a pointer to an empty String-O...
Definition CommInterface.h:82
-
virtual void sendNewFrame(String *sendFrame)
Add a new Frame to the send-buffer.
Definition CommInterface.h:67
+
virtual void getReceivedFrame(CharArray *destFrameBuffer)
Define the destination, the next received Frame should be copied to ba a pointer to an empty String-O...
Definition CommInterface.h:82
CommInterfaceBase()
Construct a new Comm Interface Base object.
Definition CommInterface.h:96
virtual bool finishedSending()
Check, if the Frame was sent and the CommInterface is ready to send the next Frame.
Definition CommInterface.h:75
virtual void setup_interface()
Setup the Interface has to be called in Setup-function.
Definition CommInterface.h:60
+
virtual void sendNewFrame(CharArray *sendFrame)
Add a new Frame to the send-buffer.
Definition CommInterface.h:67
Template for generic communication-interface specifies a standardized interface to use for integratin...
Definition CommInterface.h:123
-
CommInterface(interface_type *interface, uint32_t baudrate)
Construct a new Comm-Interface object.
Definition CommInterface.h:163
-
String * sendBuffer
pointer to the next frame to be send, set to nullptr if Frame was sent
Definition CommInterface.h:129
-
void sendNewFrame(String *sendFrame)
Specify the next frame to be sent by the interface, no overwrite, if the sendBuffer is already pointi...
Definition CommInterface.h:171
-
void getReceivedFrame(String *destFrameBuffer)
Define the destination, the next received Frame should be stored at.
Definition CommInterface.h:195
+
CommInterface(interface_type *interface, uint32_t baudrate)
Construct a new Comm-Interface object.
Definition CommInterface.h:160
+
CharArray * sendBuffer
pointer to the next frame to be send, set to nullptr if Frame was sent
Definition CommInterface.h:129
+
CharArray * receiveBuffer
pointer to CharArray-object, a received frame should be stored at, set to nullptr if Frame was copied...
Definition CommInterface.h:132
+
void sendNewFrame(CharArray *sendFrame)
Specify the next frame to be sent by the interface, no overwrite, if the sendBuffer is already pointi...
Definition CommInterface.h:168
virtual bool send()=0
Send the frame, sendBuffer is pointing to (has to be done in the derived class)
interface_type * interface
pointer to an instance of the native bus-interface (setup outside of BusBricks)
Definition CommInterface.h:126
virtual bool receive()=0
Receive a Frame (has to be done in the derived class)
-
virtual void receiveCycle()
Execution of receive-cycle, set the receiveBuffer to nullptr after a new frame was received.
Definition CommInterface.h:214
-
virtual void sendCycle()
Execution of send-cycle, set the sendBuffer to nullptr, after the frame, sendBuffer was pointing at,...
Definition CommInterface.h:225
-
bool finishedSending()
Check, if the Frame was sent and the CommInterface is ready to send the next Frame Interface is ready...
Definition CommInterface.h:186
-
String * receiveBuffer
pointer to String-object, a received frame should be stored at, set to nullptr if Frame was copied to...
Definition CommInterface.h:132
-
bool receivedNewFrame()
Check, if a new Frame was received and stored at the in getReceivedFrame specified location the inter...
Definition CommInterface.h:206
+
virtual void receiveCycle()
Execution of receive-cycle, set the receiveBuffer to nullptr after a new frame was received.
Definition CommInterface.h:211
+
virtual void sendCycle()
Execution of send-cycle, set the sendBuffer to nullptr, after the frame, sendBuffer was pointing at,...
Definition CommInterface.h:222
+
bool finishedSending()
Check, if the Frame was sent and the CommInterface is ready to send the next Frame Interface is ready...
Definition CommInterface.h:183
+
void getReceivedFrame(CharArray *externalRecBuffer)
Define the destination, the next received Frame should be stored at.
Definition CommInterface.h:192
+
bool receivedNewFrame()
Check, if a new Frame was received and stored at the in getReceivedFrame specified location the inter...
Definition CommInterface.h:203
A class to manage and track error states using error codes.
Definition ErrorState.h:49
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
diff --git a/docs/html/class_char_array-members.html b/docs/html/class_char_array-members.html new file mode 100644 index 0000000..ece1880 --- /dev/null +++ b/docs/html/class_char_array-members.html @@ -0,0 +1,114 @@ + + + + + + + +BusBricks: Member List + + + + + + + + + + + + + +
+
+ + + + + + +
+
BusBricks 0.1 +
+
Object-oriented building-blocks to configure bus-communication for different services and interfaces on Arduino-MCUs
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
+
CharArray Member List
+
+
+ +

This is the complete list of members for CharArray, including all inherited members.

+ + + + + + + + + + + + + + +
CharArray()CharArray
CharArray(const CharArray &other)CharArray
getData() constCharArray
getHexString()CharArray
getSize() constCharArray
operator!=(const CharArray &other) constCharArray
operator+=(char c)CharArray
operator=(const CharArray &other)CharArray
operator=(const String &other)CharArray
operator==(const CharArray &other) constCharArray
operator[](size_t index)CharArray
operator[](size_t index) constCharArray
~CharArray()CharArray
+ + +
+ + diff --git a/docs/html/class_char_array.html b/docs/html/class_char_array.html new file mode 100644 index 0000000..d921028 --- /dev/null +++ b/docs/html/class_char_array.html @@ -0,0 +1,435 @@ + + + + + + + +BusBricks: CharArray Class Reference + + + + + + + + + + + + + +
+
+ + + + + + +
+
BusBricks 0.1 +
+
Object-oriented building-blocks to configure bus-communication for different services and interfaces on Arduino-MCUs
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
+ +
CharArray Class Reference
+
+
+ +

Class for storing char-array (byte-array) together with size. The Array is stored on Heap-memory and is extended by adding bytes with "+=" or by write-access to an index larger than the current size. + More...

+ +

#include <CharArray.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CharArray ()
 Construct a new empty Char Array object (0 byte)
 
~CharArray ()
 Destroy the Char Array object.
 
 CharArray (const CharArray &other)
 Copy constructor.
 
CharArrayoperator= (const CharArray &other)
 Assignment operator.
 
CharArrayoperator= (const String &other)
 Assignment operator for String-assignment.
 
char & operator[] (size_t index)
 Write-Access the element at the specified index.
 
const char & operator[] (size_t index) const
 Read-Access the element at the specified index.
 
CharArrayoperator+= (char c)
 += Operator to append a single character
 
bool operator== (const CharArray &other) const
 Equality Operator.
 
bool operator!= (const CharArray &other) const
 Inequality Operator.
 
size_t getSize () const
 Retrieves the size of the char array.
 
const char * getData () const
 Provides direct access to the internal char array.
 
String getHexString ()
 Get the Hex-Values of the Array as a String.
 
+

Detailed Description

+

Class for storing char-array (byte-array) together with size. The Array is stored on Heap-memory and is extended by adding bytes with "+=" or by write-access to an index larger than the current size.

+

Constructor & Destructor Documentation

+ +

◆ CharArray()

+ +
+
+ + + + + + + +
CharArray::CharArray (const CharArray & other)
+
+ +

Copy constructor.

+

Initializes a new CharArray object as a copy of another CharArray object.

+
Parameters
+ + +
otherThe other CharArray object to copy.
+
+
+

This constructor performs a deep copy of all the data from other, ensuring that the new object is an exact copy of the source object.

+ +
+
+

Member Function Documentation

+ +

◆ getData()

+ +
+
+ + + + + + + +
const char * CharArray::getData () const
+
+ +

Provides direct access to the internal char array.

+

Returns a pointer to the internal char array. This allows direct manipulation of the data stored in the array.

+
Returns
char* A pointer to the internal char array.
+ +
+
+ +

◆ getHexString()

+ +
+
+ + + + + + + +
String CharArray::getHexString ()
+
+ +

Get the Hex-Values of the Array as a String.

+
Returns
String
+ +
+
+ +

◆ getSize()

+ +
+
+ + + + + + + +
size_t CharArray::getSize () const
+
+ +

Retrieves the size of the char array.

+

Returns the number of elements in the char array.

+
Returns
size_t The size of the char array.
+ +
+
+ +

◆ operator!=()

+ +
+
+ + + + + + + +
bool CharArray::operator!= (const CharArray & other) const
+
+ +

Inequality Operator.

+
Parameters
+ + +
other
+
+
+
Returns
bool
+ +
+
+ +

◆ operator+=()

+ +
+
+ + + + + + + +
CharArray & CharArray::operator+= (char c)
+
+ +

+= Operator to append a single character

+
Parameters
+ + +
cchar to append
+
+
+
Returns
CharArray&
+ +
+
+ +

◆ operator=() [1/2]

+ +
+
+ + + + + + + +
CharArray & CharArray::operator= (const CharArray & other)
+
+ +

Assignment operator.

+

This operator assigns the values from another object of the same type to the current object.

+
Parameters
+ + +
otherThe other CharArray object whose values will be assigned.
+
+
+
Returns
A reference to the current object after assignment.
+

This operator performs a deep copy of the data from other, ensuring that the current object becomes an exact copy of other.

+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + + + +
CharArray & CharArray::operator= (const String & str)
+
+ +

Assignment operator for String-assignment.

+

This operator assigns the values from a String-object to the current object.

+
Parameters
+ + +
otherThe String object whose values will be assigned.
+
+
+
Returns
A reference to the current object after assignment.
+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + + + +
bool CharArray::operator== (const CharArray & other) const
+
+ +

Equality Operator.

+
Parameters
+ + +
other
+
+
+
Returns
bool
+ +
+
+ +

◆ operator[]() [1/2]

+ +
+
+ + + + + + + +
char & CharArray::operator[] (size_t index)
+
+ +

Write-Access the element at the specified index.

+

Returns a reference to the element at the given index in the char array. If the index is out of bounds, a the array will be extended.

+
Parameters
+ + +
indexThe index of the element to access.
+
+
+
Returns
char& A reference to the element at the specified index.
+ +
+
+ +

◆ operator[]() [2/2]

+ +
+
+ + + + + + + +
const char & CharArray::operator[] (size_t index) const
+
+ +

Read-Access the element at the specified index.

+

Returns a reference to the element at the given index in the char array. If the index is out of bounds, a refernce to a dummy nullterminator will be returned.

+
Parameters
+ + +
indexThe index of the element to access.
+
+
+
Returns
char& A reference to the element at the specified index.
+ +
+
+
The documentation for this class was generated from the following files:
    +
  • /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/Frame/CharArray.h
  • +
  • /Users/felixschulke/Developement/Arduino/Modbus_RTU/Modbus_RTU/Modbus-RTU/lib/Frame/CharArray.cpp
  • +
+
+ + +
+ + diff --git a/docs/html/class_comm_interface-members.html b/docs/html/class_comm_interface-members.html index 1051658..b6b6178 100644 --- a/docs/html/class_comm_interface-members.html +++ b/docs/html/class_comm_interface-members.html @@ -97,17 +97,17 @@ ErrorState()ErrorState finishedSending()CommInterface< interface_type >inlinevirtual getErrorState()ErrorState - getReceivedFrame(String *destFrameBuffer)CommInterface< interface_type >inlinevirtual + getReceivedFrame(CharArray *externalRecBuffer)CommInterface< interface_type >inlinevirtual interfaceCommInterface< interface_type >protected raiseError(errorCodes code)ErrorState receive()=0CommInterface< interface_type >protectedpure virtual - receiveBufferCommInterface< interface_type >protected + receiveBufferCommInterface< interface_type >protected receiveCycle()CommInterface< interface_type >inlinevirtual receivedNewFrame()CommInterface< interface_type >inlinevirtual send()=0CommInterface< interface_type >protectedpure virtual - sendBufferCommInterface< interface_type >protected + sendBufferCommInterface< interface_type >protected sendCycle()CommInterface< interface_type >inlinevirtual - sendNewFrame(String *sendFrame)CommInterface< interface_type >inlinevirtual + sendNewFrame(CharArray *sendFrame)CommInterface< interface_type >inlinevirtual setup_interface()CommInterfaceBaseinlinevirtual ~CommInterfaceBase()CommInterfaceBaseinline ~ErrorState()ErrorState diff --git a/docs/html/class_comm_interface.html b/docs/html/class_comm_interface.html index 8e87818..d6946d8 100644 --- a/docs/html/class_comm_interface.html +++ b/docs/html/class_comm_interface.html @@ -114,15 +114,15 @@  CommInterface (interface_type *interface, uint32_t baudrate)  Construct a new Comm-Interface object.
  -void sendNewFrame (String *sendFrame) - Specify the next frame to be sent by the interface, no overwrite, if the sendBuffer is already pointing to another frame.
-  +void sendNewFrame (CharArray *sendFrame) + Specify the next frame to be sent by the interface, no overwrite, if the sendBuffer is already pointing to another frame.
+  bool finishedSending ()  Check, if the Frame was sent and the CommInterface is ready to send the next Frame Interface is ready to send a new frame, if the sendBuffer is nullpointer.
  -void getReceivedFrame (String *destFrameBuffer) - Define the destination, the next received Frame should be stored at.
-  +void getReceivedFrame (CharArray *externalRecBuffer) + Define the destination, the next received Frame should be stored at.
+  bool receivedNewFrame ()  Check, if a new Frame was received and stored at the in getReceivedFrame specified location the interface is waiting waiting for getReceivedFrame-call to specify the location, the next received frame should be stored at.
  @@ -181,14 +181,14 @@ interface_type * interface  pointer to an instance of the native bus-interface (setup outside of BusBricks)
  - -StringsendBuffer = nullptr - pointer to the next frame to be send, set to nullptr if Frame was sent
-  - -StringreceiveBuffer = nullptr - pointer to String-object, a received frame should be stored at, set to nullptr if Frame was copied to destination
-  + +CharArraysendBuffer = nullptr + pointer to the next frame to be send, set to nullptr if Frame was sent
+  + +CharArrayreceiveBuffer = nullptr + pointer to CharArray-object, a received frame should be stored at, set to nullptr if Frame was copied to destination

Detailed Description

template<typename interface_type>
@@ -278,8 +278,8 @@

-

◆ getReceivedFrame()

+ +

◆ getReceivedFrame()

@@ -292,7 +292,7 @@

void CommInterface< interface_type >::getReceivedFrame ( - String * destFrameBuffer) + CharArray * externalRecBuffer) @@ -306,12 +306,12 @@

Frame should be stored at.

Parameters
- +
destFrameBufferpointer to String-object, the next received Frame should be stored at
externalRecBufferpointer to CharArray-object, the next received Frame should be stored at
-

Reimplemented from CommInterfaceBase.

+

Reimplemented from CommInterfaceBase.

@@ -417,8 +417,8 @@

-

◆ sendNewFrame()

+ +

◆ sendNewFrame()

@@ -431,7 +431,7 @@

void CommInterface< interface_type >::sendNewFrame ( - String * sendFrame) + CharArray * sendFrame) @@ -445,12 +445,12 @@

Parameters
- +
sendFrameString-pointer to next frame to be send
sendFramepointer to next Frame-object to be send
-

Reimplemented from CommInterfaceBase.

+

Reimplemented from CommInterfaceBase.

diff --git a/docs/html/class_comm_interface__modbus_r_t_u-members.html b/docs/html/class_comm_interface__modbus_r_t_u-members.html index ca9deb6..dfa2f25 100644 --- a/docs/html/class_comm_interface__modbus_r_t_u-members.html +++ b/docs/html/class_comm_interface__modbus_r_t_u-members.html @@ -99,19 +99,17 @@ finishedSending()CommInterface< SoftwareSerial >inlinevirtual getDeviceId()CommInterface_modbusRTU getErrorState()ErrorState - getReceivedFrame(String *destFrameBuffer)CommInterface< SoftwareSerial >inline - CommInterfaceBase::getReceivedFrame(String *destFrameBuffer)CommInterfaceBaseinlinevirtual - interfaceCommInterface< SoftwareSerial >protected - raiseError(errorCodes code)ErrorState - receive() overrideCommInterface_modbusRTUvirtual - receiveBufferCommInterface< SoftwareSerial >protected - receiveCycle()CommInterface< SoftwareSerial >inlinevirtual - receivedNewFrame()CommInterface< SoftwareSerial >inlinevirtual - send() overrideCommInterface_modbusRTUvirtual - sendBufferCommInterface< SoftwareSerial >protected - sendCycle()CommInterface< SoftwareSerial >inlinevirtual - sendNewFrame(String *sendFrame)CommInterface< SoftwareSerial >inline - CommInterfaceBase::sendNewFrame(String *sendFrame)CommInterfaceBaseinlinevirtual + getReceivedFrame(CharArray *externalRecBuffer)CommInterface< SoftwareSerial >inlinevirtual + interfaceCommInterface< SoftwareSerial >protected + raiseError(errorCodes code)ErrorState + receive() overrideCommInterface_modbusRTUvirtual + receiveBufferCommInterface< SoftwareSerial >protected + receiveCycle()CommInterface< SoftwareSerial >inlinevirtual + receivedNewFrame()CommInterface< SoftwareSerial >inlinevirtual + send() overrideCommInterface_modbusRTUvirtual + sendBufferCommInterface< SoftwareSerial >protected + sendCycle()CommInterface< SoftwareSerial >inlinevirtual + sendNewFrame(CharArray *sendFrame)CommInterface< SoftwareSerial >inlinevirtual setup_interface()CommInterfaceBaseinlinevirtual ~CommInterface_modbusRTU()CommInterface_modbusRTU ~CommInterfaceBase()CommInterfaceBaseinline diff --git a/docs/html/class_comm_interface__modbus_r_t_u.html b/docs/html/class_comm_interface__modbus_r_t_u.html index cfac6fe..023aaaf 100644 --- a/docs/html/class_comm_interface__modbus_r_t_u.html +++ b/docs/html/class_comm_interface__modbus_r_t_u.html @@ -130,15 +130,15 @@  CommInterface (SoftwareSerial *interface, uint32_t baudrate)  Construct a new Comm-Interface object.
  -void sendNewFrame (String *sendFrame) - Specify the next frame to be sent by the interface, no overwrite, if the sendBuffer is already pointing to another frame.
-  +void sendNewFrame (CharArray *sendFrame) + Specify the next frame to be sent by the interface, no overwrite, if the sendBuffer is already pointing to another frame.
+  bool finishedSending ()  Check, if the Frame was sent and the CommInterface is ready to send the next Frame Interface is ready to send a new frame, if the sendBuffer is nullpointer.
  -void getReceivedFrame (String *destFrameBuffer) - Define the destination, the next received Frame should be stored at.
-  +void getReceivedFrame (CharArray *externalRecBuffer) + Define the destination, the next received Frame should be stored at.
+  bool receivedNewFrame ()  Check, if a new Frame was received and stored at the in getReceivedFrame specified location the interface is waiting waiting for getReceivedFrame-call to specify the location, the next received frame should be stored at.
  @@ -155,12 +155,6 @@ virtual void setup_interface ()  Setup the Interface has to be called in Setup-function.
  -virtual void sendNewFrame (String *sendFrame) - Add a new Frame to the send-buffer.
-  -virtual void getReceivedFrame (String *destFrameBuffer) - Define the destination, the next received Frame should be copied to ba a pointer to an empty String-Object.
-   CommInterfaceBase ()  Construct a new Comm Interface Base object.
@@ -196,14 +190,14 @@ SoftwareSerialinterface  pointer to an instance of the native bus-interface (setup outside of BusBricks)
  - -StringsendBuffer - pointer to the next frame to be send, set to nullptr if Frame was sent
-  - -StringreceiveBuffer - pointer to String-object, a received frame should be stored at, set to nullptr if Frame was copied to destination
-  + +CharArraysendBuffer + pointer to the next frame to be send, set to nullptr if Frame was sent
+  + +CharArrayreceiveBuffer + pointer to CharArray-object, a received frame should be stored at, set to nullptr if Frame was copied to destination

Detailed Description

The Modbus-RTU CommInterface-class specifies a communication interface with SoftwareSerial as interface-type and Monitors modbus-specific timeouts. Ensures correct data-transfer between standardized Frame-Objects in the Interface-Stack and SoftwareSerial.

diff --git a/docs/html/class_comm_interface_base-members.html b/docs/html/class_comm_interface_base-members.html index 2e6b54d..a4649f8 100644 --- a/docs/html/class_comm_interface_base-members.html +++ b/docs/html/class_comm_interface_base-members.html @@ -96,10 +96,10 @@ ErrorState()ErrorState finishedSending()CommInterfaceBaseinlinevirtual getErrorState()ErrorState - getReceivedFrame(String *destFrameBuffer)CommInterfaceBaseinlinevirtual + getReceivedFrame(CharArray *destFrameBuffer)CommInterfaceBaseinlinevirtual raiseError(errorCodes code)ErrorState receivedNewFrame()CommInterfaceBaseinlinevirtual - sendNewFrame(String *sendFrame)CommInterfaceBaseinlinevirtual + sendNewFrame(CharArray *sendFrame)CommInterfaceBaseinlinevirtual setup_interface()CommInterfaceBaseinlinevirtual ~CommInterfaceBase()CommInterfaceBaseinline ~ErrorState()ErrorState diff --git a/docs/html/class_comm_interface_base.html b/docs/html/class_comm_interface_base.html index 69c98d4..9897ff9 100644 --- a/docs/html/class_comm_interface_base.html +++ b/docs/html/class_comm_interface_base.html @@ -115,15 +115,15 @@ virtual void setup_interface ()  Setup the Interface has to be called in Setup-function.
  -virtual void sendNewFrame (String *sendFrame) - Add a new Frame to the send-buffer.
-  +virtual void sendNewFrame (CharArray *sendFrame) + Add a new Frame to the send-buffer.
+  virtual bool finishedSending ()  Check, if the Frame was sent and the CommInterface is ready to send the next Frame.
  -virtual void getReceivedFrame (String *destFrameBuffer) - Define the destination, the next received Frame should be copied to ba a pointer to an empty String-Object.
-  +virtual void getReceivedFrame (CharArray *destFrameBuffer) + Define the destination, the next received Frame should be copied to ba a pointer to an empty String-Object.
+  virtual bool receivedNewFrame ()  Check, if a new Frame was received.
  @@ -192,8 +192,8 @@

-

◆ getReceivedFrame()

+ +

◆ getReceivedFrame()

@@ -204,7 +204,7 @@

virtual void CommInterfaceBase::getReceivedFrame ( - String * destFrameBuffer) + CharArray * destFrameBuffer) @@ -218,12 +218,12 @@

Frame should be copied to ba a pointer to an empty String-Object.

Parameters
- +
destFrameBufferpointer to an empty String-Object, the next received frame should be stored in
destFrameBufferpointer to an empty CharArray-Object, the next received frame should be stored in
-

Reimplemented in CommInterface< interface_type >.

+

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

@@ -251,16 +251,16 @@

Check, if a new Frame was received.

-
Returns
true a new frame was received and stored on the with getReceivedFrame specified String-Object
+
Returns
true a new frame was received and stored on the with getReceivedFrame specified Frame-Object
-false no new frame was received, getReceivedFrame specified String-Object still empty
+false no new frame was received, getReceivedFrame specified Frame-Object still empty

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

- -

◆ sendNewFrame()

+ +

◆ sendNewFrame()

@@ -271,7 +271,7 @@

virtual void CommInterfaceBase::sendNewFrame ( - String * sendFrame) + CharArray * sendFrame) @@ -285,13 +285,13 @@

Frame to the send-buffer.

Parameters
-
sendFramePointer to String-Object with frame to be send next
+
sendFramePointer to CharArray-Object with frame to be send next
-

Reimplemented in CommInterface< interface_type >.

+

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

diff --git a/docs/html/class_frame-members.html b/docs/html/class_frame-members.html index 880601d..86d98de 100644 --- a/docs/html/class_frame-members.html +++ b/docs/html/class_frame-members.html @@ -91,20 +91,18 @@

This is the complete list of members for Frame, including all inherited members.

- - - - + + + + - - - - - - - - - + + + + + + +
Content(pduString content)Content< pduString, frameString >inline
Content(frameString representation)Content< pduString, frameString >inline
contentContent< pduString, frameString >protected
content_to_rep()=0Content< pduString, frameString >protectedpure virtual
Content(String content)Content< String, CharArray >inline
Content(CharArray representation)Content< String, CharArray >inline
contentContent< String, CharArray >protected
content_to_rep()=0Content< String, CharArray >protectedpure virtual
Frame()Frame
Frame(pduString *pdu)Frame
Frame(frameString *frame)Frame
get_content()Content< pduString, frameString >inline
get_representation()Content< pduString, frameString >inline
getFrame()Frame
getPDU()Frame
isValid()Content< pduString, frameString >inline
rep_to_content()=0Content< pduString, frameString >protectedpure virtual
representationContent< pduString, frameString >protected
Frame(String *pdu)Frame
Frame(CharArray *frame)Frame
get_content()Content< String, CharArray >inline
get_representation()Content< String, CharArray >inline
isValid()Content< String, CharArray >inline
rep_to_content()=0Content< String, CharArray >protectedpure virtual
representationContent< String, CharArray >protected
~Frame()Frame
diff --git a/docs/html/class_frame.html b/docs/html/class_frame.html index d3c80de..6c90db8 100644 --- a/docs/html/class_frame.html +++ b/docs/html/class_frame.html @@ -102,8 +102,8 @@
-Content< pduString, frameString > -Frame_modbusRTU +Content< String, CharArray > +Frame_modbusRTU
@@ -117,29 +117,23 @@   - - - - - - - - - - - - - - + + + + + + + + - + - + - + @@ -148,7 +142,7 @@
~Frame ()
 Destroy the Frame object.
 
 Frame (pduString *pdu)
 Constructor for creating Frame-instance from pdu (Content)
 
 Frame (frameString *frame)
 Constructor for creating Frame-Object from byte-frame (Representation)
 
String getPDU ()
 get the pdu (Content) as String from the frame-object
 
String getFrame ()
 Get the byte-frame (Representation) as String from the frame-object.
 
- Public Member Functions inherited from Content< pduString, frameString >
 Content (pduString content)
 Frame (String *pdu)
 Constructor for creating Frame-instance from pdu (Content)
 
 Frame (CharArray *frame)
 Constructor for creating Frame-Object from byte-frame (Representation)
 
- Public Member Functions inherited from Content< String, CharArray >
 Content (String content)
 Construct a new Content object from an instance from type content_type (content itself)
 
 Content (frameString representation)
 Content (CharArray representation)
 Construct a new Content object from it's representation from type representation_type.
 
frameString * get_representation ()
CharArrayget_representation ()
 Get the address of the informations representation of type representation-type.
 
pduStringget_content ()
Stringget_content ()
 Get the address of the informations content of type content_type.
 
bool isValid ()
- + @@ -157,14 +151,14 @@ virtual void  - + +String  +CharArray  @@ -177,14 +171,14 @@
Template Parameters

Additional Inherited Members

- Protected Member Functions inherited from Content< pduString, frameString >
- Protected Member Functions inherited from Content< String, CharArray >
virtual void rep_to_content ()=0
 Defines the mapping from Representation to Content. Convert the class-attribute "representation" to the class-attribute "content". (has to be defined in derived class) (has to be called in the constructor of the derived class)
content_to_rep ()=0
 Defines the mapping from Content to Representation. Convert the class-attribute "content"to the class-attribute "representation" . (has to be defined in derived class) (has to be called in the constructor of the derived class)
 
- Protected Attributes inherited from Content< pduString, frameString >
- Protected Attributes inherited from Content< String, CharArray >
-pduString content
content
 Content of an information (view on information (content) closer to Service-Layer)

 
-frameString representation
representation
 Representation of an information (view on information (content) closer to physical layer)

 
- - + +
pduStringtype-definition for a String-Object containing the Payload of the frame ("Content")
frameStringtype-definition for a const-char-pointer pointing to the byte-formatted frame
Stringtype of Payload of the frame ("Content")
CharArraytype of byte-formatted frame ("Representation")

Constructor & Destructor Documentation

- -

◆ Frame() [1/2]

+ +

◆ Frame() [1/2]

@@ -192,7 +186,7 @@

Frame::Frame ( - pduString * pdu) + String * pdu) @@ -201,15 +195,15 @@

Content)

Parameters
- +
pdupointer to pduString containing the payload of the frame
pdupointer to String containing the payload of the frame

- -

◆ Frame() [2/2]

+ +

◆ Frame() [2/2]

-

Member Function Documentation

-
-

◆ getFrame()

- -
-
- - - - - - - -
String Frame::getFrame ()
-
- -

Get the byte-frame (Representation) as String from the frame-object.

-
Returns
String with byte-frame (Representation)
- -
-
- -

◆ getPDU()

- -
-
- - - - - - - -
String Frame::getPDU ()
-
- -

get the pdu (Content) as String from the frame-object

-
Returns
String with frame-payload
-

The documentation for this class was generated from the following files:
diff --git a/docs/html/class_frame__modbus_r_t_u.html b/docs/html/class_frame__modbus_r_t_u.html index e8ab95e..e7c26e5 100644 --- a/docs/html/class_frame__modbus_r_t_u.html +++ b/docs/html/class_frame__modbus_r_t_u.html @@ -102,19 +102,19 @@
-Frame -Content< pduString, frameString > +Frame +Content< String, CharArray >
- - - - - - + + + + + + @@ -123,12 +123,6 @@   - - - - - - @@ -144,29 +138,23 @@   - - - - - - - - - - - - - - + + + + + + + + - + - + - + @@ -175,15 +163,15 @@

Public Member Functions

 Frame_modbusRTU (pduString *pdu, char *slaveId, char *functionCode)
 Construct a new Frame_modbusRTU object by PDU, modbus-slave-ID and modus-function-code. Object calculates and adds the CRC16, the Modbus-Slave-ID and the Modbus-Function-Code and concatenates them to the modbus-frame (representation) by calling content_to_rep during construction. Allocate heap-memory (buffer) to the frame-representation and let the Content's representation (parent-class-template) point to that buffer on heap.
 
 Frame_modbusRTU (frameString *frame)
 Construct Modbus-RTU-Frame from given Byte-Frame (Representation). Copy the representation, the argument is pointing to, to heap-memory and let by calling copy_to_heap and let Content's representation (parent-class-template) point to that buffer on heap. Extract Payload, device-ID and function-Code. Check the CRC16 for plausibility by checking rest = 0.
 
 Frame_modbusRTU (String *pdu, char *slaveId, char *functionCode)
 Construct a new Frame_modbusRTU object by PDU, modbus-slave-ID and modus-function-code. Object calculates and adds the CRC16, the Modbus-Slave-ID and the Modbus-Function-Code and concatenates them to the modbus-frame (representation) by calling content_to_rep during construction. Allocate heap-memory (buffer) to the frame-representation and let the Content's representation (parent-class-template) point to that buffer on heap.
 
 Frame_modbusRTU (CharArray *frame)
 Construct Modbus-RTU-Frame from given Byte-Frame (Representation). Copy the representation, the argument is pointing to, to heap-memory and let by calling copy_to_heap and let Content's representation (parent-class-template) point to that buffer on heap. Extract Payload, device-ID and function-Code. Check the CRC16 for plausibility by checking rest = 0.
 
 Frame_modbusRTU ()
 Construct empty Modbus-RTU-Frame.
~Frame_modbusRTU ()
 Destroy the Frame_modbusRTU object.
 
 Frame_modbusRTU (const Frame_modbusRTU &other)
 Copy constructor.
 
Frame_modbusRTUoperator= (const Frame_modbusRTU &other)
 Assignment operator.
 
bool checkCRC16 ()
 Verifies the CRC16 checksum of the current Modbus RTU frame.
 
~Frame ()
 Destroy the Frame object.
 
 Frame (pduString *pdu)
 Constructor for creating Frame-instance from pdu (Content)
 
 Frame (frameString *frame)
 Constructor for creating Frame-Object from byte-frame (Representation)
 
String getPDU ()
 get the pdu (Content) as String from the frame-object
 
String getFrame ()
 Get the byte-frame (Representation) as String from the frame-object.
 
- Public Member Functions inherited from Content< pduString, frameString >
 Content (pduString content)
 Frame (String *pdu)
 Constructor for creating Frame-instance from pdu (Content)
 
 Frame (CharArray *frame)
 Constructor for creating Frame-Object from byte-frame (Representation)
 
- Public Member Functions inherited from Content< String, CharArray >
 Content (String content)
 Construct a new Content object from an instance from type content_type (content itself)
 
 Content (frameString representation)
 Content (CharArray representation)
 Construct a new Content object from it's representation from type representation_type.
 
frameString * get_representation ()
CharArrayget_representation ()
 Get the address of the informations representation of type representation-type.
 
pduStringget_content ()
Stringget_content ()
 Get the address of the informations content of type content_type.
 
bool isValid ()
- - + + +String  +CharArray  @@ -192,8 +180,8 @@

Class for defining the structure of the Modbus-RTU-Frame. Can be constructed by a given modbus-frame and extracts payload, device-id and function-code (additionally checking CRC) or by providing payload, device-id and function-code (additionally calculating CRC).

Because the frame-representation is stored as a reference, the representation has to be allocated on the heap-memory (buffer) The allocation is done during the conversion from "Content" (construction by PDU) within the content_to_rep-function or it has to be initiated by calling the function "copy_to_heap" (e.g. in copy-constructor or during construction by frame-representation)

Constructor & Destructor Documentation

- -

◆ Frame_modbusRTU() [1/3]

+ +

◆ Frame_modbusRTU() [1/2]

- + @@ -228,8 +216,8 @@

-

◆ Frame_modbusRTU() [2/3]

+ +

◆ Frame_modbusRTU() [2/2]

- +

Additional Inherited Members

- Protected Member Functions inherited from Content< pduString, frameString >
- Protected Attributes inherited from Content< pduString, frameString >
- Protected Member Functions inherited from Content< String, CharArray >
- Protected Attributes inherited from Content< String, CharArray >
-pduString content
content
 Content of an information (view on information (content) closer to Service-Layer)

 
-frameString representation
representation
 Representation of an information (view on information (content) closer to physical layer)

 
(pduString * pdu, String * pdu,
(frameString * frame)CharArray * frame)
@@ -251,33 +239,6 @@

-

◆ Frame_modbusRTU() [3/3]

- -
-
- - - - - - - -
Frame_modbusRTU::Frame_modbusRTU (const Frame_modbusRTU & other)
-
- -

Copy constructor.

-

Initializes a new Frame_modbusRTU object as a copy of another Frame_modbusRTU object.

-
Parameters
- - -
otherThe other Frame_modbusRTU object to copy.
-
-
-

This constructor performs a deep copy of all the data from other, ensuring that the new object is an exact copy of the source object.

-

Member Function Documentation

@@ -321,34 +282,6 @@

Returns
char Modbus-RTU-function-code of the frame-instance
- - -
-

◆ operator=()

- -
-
- - - - - - - -
Frame_modbusRTU & Frame_modbusRTU::operator= (const Frame_modbusRTU & other)
-
- -

Assignment operator.

-

This operator assigns the values from another object of the same type to the current object.

-
Parameters
- - -
otherThe other Frame_modbusRTU object whose values will be assigned.
-
-
-
Returns
A reference to the current object after assignment.
-

This operator performs a deep copy of the data from other, ensuring that the current object becomes an exact copy of other.

-

The documentation for this class was generated from the following files:
    diff --git a/docs/html/class_frame__modbus_r_t_u.png b/docs/html/class_frame__modbus_r_t_u.png index c8dd12db8013b1d24f153acbfbb5904cc2700f06..31f836596c92fc5a1333cd5c328a22c2fd13b63f 100644 GIT binary patch delta 856 zcmZ3+-odWe8Q|y6%O%Cdz`(%k>ERLtq_+Wa2M05dtc`p4dZMCzy|AZ?V@L(#+qtj% zRvYlJsmCul_5S~n<=#vxF}t>CU2{9Gz07y-PM%|&^(QT#e^l_kl+m(HrBd+Lq$jS6 z=gzC2bY)|A4s+=hnS198ZiNOF@0HT|QFU6dqC+*?L_5Ac`<=oEI#+xaoUoLAcK{*sGjW3&szS{ ze^TD_)xdB+tb6O_@<^fhSzjYPE|u?a-@VH3)8(yyrY+I`@by;S-^o|v>O*&DPpOVr zzdrB!?JduhGB@jb-ai;xJwYk*+{BYV*UwX#^u#5@dy@D8Q_F66G z(~mzI&058WJ$GCAe(Da~eakGS>Kyaz1?}HrZWX^zxfZwfn_A7Ut7l#XsFd!!w*L0I z>05qxeY|+j?nPZ&_ANixPqV+B&iTIeuC1o~+m{_P%3~`Z-SynWS+4H+x3pr?l}EERLtq|XC!2M05dENAlHIZ@HR-q6#)mwnM% zoN18Wv%h%r`fJ5cU)Bfa)n5&ny(V6^XUqHGUsIUF=hoPUo?fE$O)DyHdW!VAcdjoZ zuX-389ajof{9Ze6d#GD%{o|*rJG(*~dtL23zJ8tTab8aLTX=loB6Wy>km)d z_U-)Z-=D1_y}nPA-2MFa>uIakv~L!<5tV=baxPzBeSMj-=c@Im+$YtYdB}e_>$K-3 z{hjxh|8?-Z6j|o>^z!G;f8@L`S#DGQd(C~4jiBA6C(}PnRN3ESr@8bBKg0Y7j28sw z{{HjFt%548R`3&C*xQ^gm4&N$`j_vLL*|IC|} z-)g?qojJqzS$lq_$mfu!Pi)SWUUV&!`}t8le3oYC?%HSP{KC$!yLLAs?fImoNmDCV z``@%%`YItTe(QOq>hEE$dyDs;{ky{Y-W<{Pnp;Q9H=i#$yX9fu&pUhX-TPT%ZU6RP z=CfdyBO_b=Y3yJ`04+`3yf_n(#Kq6KTS0^{;gqXpOyxU k516yv<|j(D)%{>^*S&H5zTWF;z^ugJ>FVdQ&MBb@0M9?dwEzGB diff --git a/docs/html/class_service_interface-members.html b/docs/html/class_service_interface-members.html index 284f3e9..74b8974 100644 --- a/docs/html/class_service_interface-members.html +++ b/docs/html/class_service_interface-members.html @@ -102,9 +102,9 @@ processSendStack()ServiceInterface< CommInterfaceBase, frameType >inlineprotectedvirtual processServices()ServiceInterface< CommInterfaceBase, frameType >inlineprotectedvirtual raiseError(errorCodes code)ServiceInterface< CommInterfaceBase, frameType >inlineprotected - recItemServiceInterface< CommInterfaceBase, frameType >protected + recItemServiceInterface< CommInterfaceBase, frameType >protected recStackServiceInterface< CommInterfaceBase, frameType >protected - sendItemServiceInterface< CommInterfaceBase, frameType >protected + sendItemServiceInterface< CommInterfaceBase, frameType >protected sendStackServiceInterface< CommInterfaceBase, frameType >protected ServiceInterface(CommInterfaceBase *comm_interface, ServiceClusterBase *services)ServiceInterface< CommInterfaceBase, frameType >inline servicesServiceInterface< CommInterfaceBase, frameType >protected diff --git a/docs/html/class_service_interface.html b/docs/html/class_service_interface.html index 3670f54..7b57270 100644 --- a/docs/html/class_service_interface.html +++ b/docs/html/class_service_interface.html @@ -180,16 +180,16 @@  stack for frames to send next (instance of Content_stack-derived class, specified for type of frames, the bus is using)

      - -String sendItem - Item to be sent next
    + +CharArray sendItem + Item to be sent next

    -  - -String recItem - Item received last
    +  + +CharArray recItem + Item received last

    -  + 

    Detailed Description

    template<typename CommInterfaceBase, typename frameType>
    diff --git a/docs/html/class_service_interface__modbus_r_t_u-members.html b/docs/html/class_service_interface__modbus_r_t_u-members.html index 5adfe50..5341330 100644 --- a/docs/html/class_service_interface__modbus_r_t_u-members.html +++ b/docs/html/class_service_interface__modbus_r_t_u-members.html @@ -100,9 +100,9 @@ processSendStack()ServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >inlineprotectedvirtual processServices()ServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >inlineprotectedvirtual raiseError(errorCodes code)ServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >inlineprotected - recItemServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >protected + recItemServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >protected recStackServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >protected - sendItemServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >protected + sendItemServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >protected sendStackServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >protected ServiceInterface(CommInterface_modbusRTU *comm_interface, ServiceClusterBase *services)ServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >inline ServiceInterface_modbusRTU(ServiceClusterBase *services, CommInterface_modbusRTU *comm_interface)ServiceInterface_modbusRTU diff --git a/docs/html/class_service_interface__modbus_r_t_u.html b/docs/html/class_service_interface__modbus_r_t_u.html index 3a65d7f..665844a 100644 --- a/docs/html/class_service_interface__modbus_r_t_u.html +++ b/docs/html/class_service_interface__modbus_r_t_u.html @@ -178,16 +178,16 @@  stack for frames to send next (instance of Content_stack-derived class, specified for type of frames, the bus is using)

      - -String sendItem - Item to be sent next
    + +CharArray sendItem + Item to be sent next

    -  - -String recItem - Item received last
    +  + +CharArray recItem + Item received last

    -  + 

    Detailed Description

    Service-Interface-class for Modbus-RTU: Impart incoming frames from the CommInterface to the designated service of the service-cluster. Build outgoing modbus-RTU-frames from the payload provided by the services and impart them to the Communication-Interface. The service-IDs of the associated services are mapped to the modbus-rtu-function-code. If a Frame is sent by a modbus-slave device, the frame's slave-id is the same as the sender-id (and the local device-id). If a Frame is sent by a modbus-device in mastermode, the frame's slave-id is the receiver-id provided by the service, that provided the payload for the frame.

    diff --git a/docs/html/classes.html b/docs/html/classes.html index 4a404bb..4ef30fd 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -92,7 +92,7 @@
    C
    -
    CommInterface
    CommInterface_modbusRTU
    CommInterfaceBase
    Content
    Content_stack
    +
    CharArray
    CommInterface
    CommInterface_modbusRTU
    CommInterfaceBase
    Content
    Content_stack
    E
    Error
    ErrorContent_t
    ErrorService
    ErrorState
    diff --git a/docs/html/dir_63423c24249a4ea801821a9ef8d1869d.html b/docs/html/dir_63423c24249a4ea801821a9ef8d1869d.html index 9645eb9..8553ced 100644 --- a/docs/html/dir_63423c24249a4ea801821a9ef8d1869d.html +++ b/docs/html/dir_63423c24249a4ea801821a9ef8d1869d.html @@ -95,6 +95,10 @@ + + + + diff --git a/docs/html/doxygen_crawl.html b/docs/html/doxygen_crawl.html index f1cd9ad..18cb0e8 100644 --- a/docs/html/doxygen_crawl.html +++ b/docs/html/doxygen_crawl.html @@ -11,6 +11,7 @@ + @@ -31,6 +32,8 @@ + + @@ -54,6 +57,8 @@ + + @@ -173,7 +178,6 @@ - @@ -188,6 +192,8 @@ + + @@ -212,7 +218,6 @@ - @@ -231,18 +236,33 @@ + + + + + + + + + + + + + + + - - - + + + - + @@ -253,11 +273,11 @@ - - + + @@ -295,21 +315,17 @@ - - - + - + + - - + - - @@ -351,19 +367,19 @@ - + - + @@ -427,7 +443,6 @@ - diff --git a/docs/html/files.html b/docs/html/files.html index db9bf8d..8385a61 100644 --- a/docs/html/files.html +++ b/docs/html/files.html @@ -99,8 +99,10 @@ - - + + + + diff --git a/docs/html/functions.html b/docs/html/functions.html index 912d110..3bff7d4 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -100,6 +100,7 @@

    - b -

    Files

     CharArray.cpp
     
     CharArray.h
     
     Frame.cpp
     
     Frame.h
     ErrorState.cpp
     ErrorState.h
      Frame
     Frame.cpp
     Frame.h
     CharArray.cpp
     CharArray.h
     Frame.cpp
     Frame.h
      Interface
     CommInterface.h
     ServiceInterface.h
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     CContent< content_type, representation_type >The cascading of processing information and the rules applied to it lead to the concept of content- and representation. In every iteration, an information is processed and the rules of the next level, closer to the physical layer are applied to it, the information closer to the format the service is able to process is called Content. Conversely, the format, the information has after applying the rules of the next level closer to "Layer-0" is called representation
     CContent< ErrorContent_t, String >
     CErrorRepresents an error with it's error-content (error-code and an error-message), and provides methods for converting between sendable PDU and error-content
     CContent< Message_content_t, String >
     CMessageRepresents a message with information for sender and receiver, and provides methods for converting between PDU and message content
     CContent< pduString, frameString >
     CFrameFrame-Class as derived class from Content The derived classes define: -the conversion from a given payload plus protocol-specific parameters (e.g. Modbus-function-code, addresses...) to the frame-representation (override of content_to_rep from Content-Class)
     CFrame_modbusRTUClass for defining the structure of the Modbus-RTU-Frame. Can be constructed by a given modbus-frame and extracts payload, device-id and function-code (additionally checking CRC) or by providing payload, device-id and function-code (additionally calculating CRC)
     CContent_stack< content_class, MaxSize >Content-Stack-Template the content-stack stores the added items (call-by-value / copy) on internal array the item added last is stacked on top (highest index), the one added first is stored on index "0"
     CContent_stack< char, 512 >
     CContent_stack< content_class, stackSize >
     CContent_stack< Error, stackSize >
     CContent_stack< Frame_modbusRTU, STACKSIZE >
     CContent_stack< frameType, STACKSIZE >
     CContent_stack< Message, stackSize >
     CErrorContent_tStructure to hold an error code and its associated message
     CErrorStateA class to manage and track error states using error codes
     CServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >
     CServiceInterface_modbusRTUService-Interface-class for Modbus-RTU: Impart incoming frames from the CommInterface to the designated service of the service-cluster. Build outgoing modbus-RTU-frames from the payload provided by the services and impart them to the Communication-Interface. The service-IDs of the associated services are mapped to the modbus-rtu-function-code. If a Frame is sent by a modbus-slave device, the frame's slave-id is the same as the sender-id (and the local device-id). If a Frame is sent by a modbus-device in mastermode, the frame's slave-id is the receiver-id provided by the service, that provided the payload for the frame
     CCommInterfaceBaseCommuncation-Interface-Base-Class of the CommInterface template specifies a standardized interface to use for integrating any hardware-interface (e.g. SoftwareSerial, OneWire...) into a Service-Interface The template ensures the correct handling of send- and receive-buffers of the interface:
     CCommInterface< SoftwareSerial >
     CCommInterface_modbusRTUThe Modbus-RTU CommInterface-class specifies a communication interface with SoftwareSerial as interface-type and Monitors modbus-specific timeouts. Ensures correct data-transfer between standardized Frame-Objects in the Interface-Stack and SoftwareSerial
     CCommInterface< interface_type >Template for generic communication-interface specifies a standardized interface to use for integrating any hardware-interface (e.g. SoftwareSerial, OneWire...) into a Service-Interface The template ensures the correct handling of send- and receive-buffers of the interface:
     CServiceInterface< CommInterfaceBase, frameType >Template for generic Service-Interface Defines the handling of incoming frames from CommInterface to services stored in the associated ServiceCluster and the conversion from PDU provided by Services in the ServiceCluster to frames, getting sent by the communication-interface. The ServiceInterface dedicates memory to the CommInterface by iterating through it's stacks
     CMessage_content_tRepresents the content of a message with sender and receiver information
     CarduinoMocking::MockSerialSimulates Arduino's Serial class for testing purposes
     CarduinoMocking::MockTimeSimulates Arduino's time functions for testing purposes
     CServiceBaseService-base-class to add class-functions to vtable
     CService< Error, STACKSIZE >
     CErrorServiceService class for handling Errors
     CService< Message, STACKSIZE >
     CMessageServiceService class for handling messages and acknowledgments
     CService< content_class, stackSize >Service-Template to derive a Service class by defining the Content (derived Class of "Content") to handle and the size of the stacks (send and receive). A Service has to be instantiated with a unique service-ID and an instance-ID, the service-instance should use for it's communication. E.g.: Messenger-service with service-id "m" (specified in derived class, same on every host) is instantiated with a host-specific ID to identify the instances. The derived classes have to define the stack-processing to handle the payload at the rec-stack and add payload to the send-stack. Each derived class has a unique serviceID to identify the Service-type and each instance in the communication-network has a unique instanceID
     CServiceClusterBaseServiceCluster-base-class to add class-functions to vtable
     CServiceCluster< number_of_services >The ServiceCluster provides functions to manage multiple services. The ServiceCluster is added to the ServiceInterface and contains references to all services, associated with the interface
     CarduinoMocking::SoftwareSerialMock class to simulate the SoftwareSerial library for native builds
     CCharArrayClass for storing char-array (byte-array) together with size. The Array is stored on Heap-memory and is extended by adding bytes with "+=" or by write-access to an index larger than the current size
     CContent< content_type, representation_type >The cascading of processing information and the rules applied to it lead to the concept of content- and representation. In every iteration, an information is processed and the rules of the next level, closer to the physical layer are applied to it, the information closer to the format the service is able to process is called Content. Conversely, the format, the information has after applying the rules of the next level closer to "Layer-0" is called representation
     CContent< ErrorContent_t, String >
     CErrorRepresents an error with it's error-content (error-code and an error-message), and provides methods for converting between sendable PDU and error-content
     CContent< Message_content_t, String >
     CMessageRepresents a message with information for sender and receiver, and provides methods for converting between PDU and message content
     CContent< String, CharArray >
     CFrameFrame-Class as derived class from Content The derived classes define: -the conversion from a given payload plus protocol-specific parameters (e.g. Modbus-function-code, addresses...) to the frame-representation (override of content_to_rep from Content-Class)
     CFrame_modbusRTUClass for defining the structure of the Modbus-RTU-Frame. Can be constructed by a given modbus-frame and extracts payload, device-id and function-code (additionally checking CRC) or by providing payload, device-id and function-code (additionally calculating CRC)
     CContent_stack< content_class, MaxSize >Content-Stack-Template the content-stack stores the added items (call-by-value / copy) on internal array the item added last is stacked on top (highest index), the one added first is stored on index "0"
     CContent_stack< char, 512 >
     CContent_stack< content_class, stackSize >
     CContent_stack< Error, stackSize >
     CContent_stack< Frame_modbusRTU, STACKSIZE >
     CContent_stack< frameType, STACKSIZE >
     CContent_stack< Message, stackSize >
     CErrorContent_tStructure to hold an error code and its associated message
     CErrorStateA class to manage and track error states using error codes
     CServiceInterface< CommInterface_modbusRTU, Frame_modbusRTU >
     CServiceInterface_modbusRTUService-Interface-class for Modbus-RTU: Impart incoming frames from the CommInterface to the designated service of the service-cluster. Build outgoing modbus-RTU-frames from the payload provided by the services and impart them to the Communication-Interface. The service-IDs of the associated services are mapped to the modbus-rtu-function-code. If a Frame is sent by a modbus-slave device, the frame's slave-id is the same as the sender-id (and the local device-id). If a Frame is sent by a modbus-device in mastermode, the frame's slave-id is the receiver-id provided by the service, that provided the payload for the frame
     CCommInterfaceBaseCommuncation-Interface-Base-Class of the CommInterface template specifies a standardized interface to use for integrating any hardware-interface (e.g. SoftwareSerial, OneWire...) into a Service-Interface The template ensures the correct handling of send- and receive-buffers of the interface:
     CCommInterface< SoftwareSerial >
     CCommInterface_modbusRTUThe Modbus-RTU CommInterface-class specifies a communication interface with SoftwareSerial as interface-type and Monitors modbus-specific timeouts. Ensures correct data-transfer between standardized Frame-Objects in the Interface-Stack and SoftwareSerial
     CCommInterface< interface_type >Template for generic communication-interface specifies a standardized interface to use for integrating any hardware-interface (e.g. SoftwareSerial, OneWire...) into a Service-Interface The template ensures the correct handling of send- and receive-buffers of the interface:
     CServiceInterface< CommInterfaceBase, frameType >Template for generic Service-Interface Defines the handling of incoming frames from CommInterface to services stored in the associated ServiceCluster and the conversion from PDU provided by Services in the ServiceCluster to frames, getting sent by the communication-interface. The ServiceInterface dedicates memory to the CommInterface by iterating through it's stacks
     CMessage_content_tRepresents the content of a message with sender and receiver information
     CarduinoMocking::MockSerialSimulates Arduino's Serial class for testing purposes
     CarduinoMocking::MockTimeSimulates Arduino's time functions for testing purposes
     CServiceBaseService-base-class to add class-functions to vtable
     CService< Error, STACKSIZE >
     CErrorServiceService class for handling Errors
     CService< Message, STACKSIZE >
     CMessageServiceService class for handling messages and acknowledgments
     CService< content_class, stackSize >Service-Template to derive a Service class by defining the Content (derived Class of "Content") to handle and the size of the stacks (send and receive). A Service has to be instantiated with a unique service-ID and an instance-ID, the service-instance should use for it's communication. E.g.: Messenger-service with service-id "m" (specified in derived class, same on every host) is instantiated with a host-specific ID to identify the instances. The derived classes have to define the stack-processing to handle the payload at the rec-stack and add payload to the send-stack. Each derived class has a unique serviceID to identify the Service-type and each instance in the communication-network has a unique instanceID
     CServiceClusterBaseServiceCluster-base-class to add class-functions to vtable
     CServiceCluster< number_of_services >The ServiceCluster provides functions to manage multiple services. The ServiceCluster is added to the ServiceInterface and contains references to all services, associated with the interface
     CarduinoMocking::SoftwareSerialMock class to simulate the SoftwareSerial library for native builds
    diff --git a/docs/html/menudata.js b/docs/html/menudata.js index 5167a4d..6d5bf82 100644 --- a/docs/html/menudata.js +++ b/docs/html/menudata.js @@ -75,7 +75,6 @@ var menudata={children:[ {text:"File List",url:"files.html"}, {text:"File Members",url:"globals.html",children:[ {text:"All",url:"globals.html"}, -{text:"Typedefs",url:"globals_type.html"}, {text:"Enumerations",url:"globals_enum.html"}, {text:"Enumerator",url:"globals_eval.html"}, {text:"Macros",url:"globals_defs.html"}]}]}]} diff --git a/docs/html/search/all_13.js b/docs/html/search/all_13.js index 825f890..59ab2c2 100644 --- a/docs/html/search/all_13.js +++ b/docs/html/search/all_13.js @@ -1,14 +1,15 @@ var searchData= [ - ['_7ecomminterface_5fmodbusrtu_0',['~CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html#ae10bee9bfea696f21ab0732420f65241',1,'CommInterface_modbusRTU']]], - ['_7ecomminterfacebase_1',['~CommInterfaceBase',['../class_comm_interface_base.html#a04f23e3fad55bfe5d149e78ec5843388',1,'CommInterfaceBase']]], - ['_7econtent_5fstack_2',['~Content_stack',['../class_content__stack.html#a9f6ead53f4a1337740962f3e26134c02',1,'Content_stack']]], - ['_7eerror_3',['~Error',['../class_error.html#a1a45d42a3a035d510333cdfeb36a0e93',1,'Error']]], - ['_7eerrorstate_4',['~ErrorState',['../class_error_state.html#a1343b13a9feac276a1a26a523dfae1a5',1,'ErrorState']]], - ['_7eframe_5',['~Frame',['../class_frame.html#abec8c7bccdfc88cb4da137caae9f73d6',1,'Frame']]], - ['_7eframe_5fmodbusrtu_6',['~Frame_modbusRTU',['../class_frame__modbus_r_t_u.html#a981fc8dff661e9ac46ea378f17a28e9a',1,'Frame_modbusRTU']]], - ['_7emessage_7',['~Message',['../class_message.html#a3f7275462831f787a861271687bcad67',1,'Message']]], - ['_7eservicebase_8',['~ServiceBase',['../class_service_base.html#aa97f10faae142933b99784497f3aeb2e',1,'ServiceBase']]], - ['_7eserviceclusterbase_9',['~ServiceClusterBase',['../class_service_cluster_base.html#a8027755899da79046ec66cd5d1a34b6e',1,'ServiceClusterBase']]], - ['_7eserviceinterface_5fmodbusrtu_10',['~ServiceInterface_modbusRTU',['../class_service_interface__modbus_r_t_u.html#a23666158d2a1b544174587843bb95808',1,'ServiceInterface_modbusRTU']]] + ['_7echararray_0',['~CharArray',['../class_char_array.html#ae13f8ca8c3f0de90cb43edff3753199a',1,'CharArray']]], + ['_7ecomminterface_5fmodbusrtu_1',['~CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html#ae10bee9bfea696f21ab0732420f65241',1,'CommInterface_modbusRTU']]], + ['_7ecomminterfacebase_2',['~CommInterfaceBase',['../class_comm_interface_base.html#a04f23e3fad55bfe5d149e78ec5843388',1,'CommInterfaceBase']]], + ['_7econtent_5fstack_3',['~Content_stack',['../class_content__stack.html#a9f6ead53f4a1337740962f3e26134c02',1,'Content_stack']]], + ['_7eerror_4',['~Error',['../class_error.html#a1a45d42a3a035d510333cdfeb36a0e93',1,'Error']]], + ['_7eerrorstate_5',['~ErrorState',['../class_error_state.html#a1343b13a9feac276a1a26a523dfae1a5',1,'ErrorState']]], + ['_7eframe_6',['~Frame',['../class_frame.html#abec8c7bccdfc88cb4da137caae9f73d6',1,'Frame']]], + ['_7eframe_5fmodbusrtu_7',['~Frame_modbusRTU',['../class_frame__modbus_r_t_u.html#a981fc8dff661e9ac46ea378f17a28e9a',1,'Frame_modbusRTU']]], + ['_7emessage_8',['~Message',['../class_message.html#a3f7275462831f787a861271687bcad67',1,'Message']]], + ['_7eservicebase_9',['~ServiceBase',['../class_service_base.html#aa97f10faae142933b99784497f3aeb2e',1,'ServiceBase']]], + ['_7eserviceclusterbase_10',['~ServiceClusterBase',['../class_service_cluster_base.html#a8027755899da79046ec66cd5d1a34b6e',1,'ServiceClusterBase']]], + ['_7eserviceinterface_5fmodbusrtu_11',['~ServiceInterface_modbusRTU',['../class_service_interface__modbus_r_t_u.html#a23666158d2a1b544174587843bb95808',1,'ServiceInterface_modbusRTU']]] ]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js index 578c8f6..7c45c97 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js @@ -1,41 +1,44 @@ var searchData= [ ['case_3a_20messenger_20service_0',['example use-case: Messenger-service',['../index.html#autotoc_md2',1,'']]], - ['checkcrc16_1',['checkCRC16',['../class_frame__modbus_r_t_u.html#a4c47818dc37cda1cd7ba792989bcb0ea',1,'Frame_modbusRTU']]], - ['clang_20build_20for_20local_20debugging_2',['clang-build for local debugging',['../index.html#autotoc_md19',1,'']]], - ['classdiagram_3',['Classdiagram',['../index.html#autotoc_md13',1,'']]], - ['clearerrorstate_4',['clearErrorState',['../class_error_state.html#a2a2b91200168f27971ff6e63a8ab0e38',1,'ErrorState']]], - ['clearresponse_5',['clearResponse',['../class_service_base.html#ae959e3c9fa34b4c021e3d28a4c74222b',1,'ServiceBase::clearResponse()'],['../class_service.html#a75817b19f202f1696c3609a3f9578cb9',1,'Service::clearResponse()']]], - ['code_6',['code',['../struct_error_content__t.html#a1717614dc6e1a081dac66c003bf424a2',1,'ErrorContent_t']]], - ['comm_5finterface_7',['comm_interface',['../class_service_interface.html#a899b6f3e042682b285dca2588b833ae6',1,'ServiceInterface']]], - ['comminterface_8',['CommInterface',['../class_comm_interface.html',1,'CommInterface< interface_type >'],['../class_comm_interface.html#a036d6ee859c4aa352083626e3d852da2',1,'CommInterface::CommInterface()']]], - ['comminterface_2eh_9',['CommInterface.h',['../_comm_interface_8h.html',1,'']]], - ['comminterface_3c_20softwareserial_20_3e_10',['CommInterface< SoftwareSerial >',['../class_comm_interface.html',1,'']]], - ['comminterface_5fmodbusrtu_11',['CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html',1,'CommInterface_modbusRTU'],['../class_comm_interface__modbus_r_t_u.html#ac349c7e4dafa46ea96d89ed808a67b07',1,'CommInterface_modbusRTU::CommInterface_modbusRTU()']]], - ['comminterface_5fmodbusrtu_2ecpp_12',['CommInterface_modbusRTU.cpp',['../_comm_interface__modbus_r_t_u_8cpp.html',1,'']]], - ['comminterface_5fmodbusrtu_2eh_13',['CommInterface_modbusRTU.h',['../_comm_interface__modbus_r_t_u_8h.html',1,'']]], - ['comminterfacebase_14',['CommInterfaceBase',['../class_comm_interface_base.html',1,'CommInterfaceBase'],['../class_comm_interface_base.html#ac1c7e099dc4fce9e9c93a93cbf3c133e',1,'CommInterfaceBase::CommInterfaceBase()']]], - ['communicate_15',['communicate',['../class_service_interface.html#aeaebdad7101c0a66bee56edc4e6a19c1',1,'ServiceInterface::communicate()'],['../class_service_interface__modbus_r_t_u.html#ad1afd9540b980f8d4d8f2c947ce10a65',1,'ServiceInterface_modbusRTU::communicate()']]], - ['communication_20layer_16',['Communication Layer',['../index.html#autotoc_md11',1,'Communication-Layer'],['../index.html#autotoc_md9',1,'Service- and Communication-Layer']]], - ['concepts_17',['Basic Concepts',['../index.html#autotoc_md8',1,'']]], - ['content_18',['Content',['../class_content.html',1,'Content< content_type, representation_type >'],['../class_content.html#a2d300bab9c7fe3f9efb537139d8efba9',1,'Content::Content(content_type content)'],['../class_content.html#a017ed819c621340a1c77c59f93729c42',1,'Content::Content(representation_type representation)']]], - ['content_19',['content',['../class_content.html#a5078d76f7e6118f67e1f158692650d5b',1,'Content::content'],['../index.html#autotoc_md16',1,'Define the content']]], - ['content_20and_20representation_20',['Content and representation',['../index.html#autotoc_md12',1,'']]], - ['content_2eh_21',['Content.h',['../_content_8h.html',1,'']]], - ['content_3c_20errorcontent_5ft_2c_20string_20_3e_22',['Content< ErrorContent_t, String >',['../class_content.html',1,'']]], - ['content_3c_20message_5fcontent_5ft_2c_20string_20_3e_23',['Content< Message_content_t, String >',['../class_content.html',1,'']]], - ['content_3c_20pdustring_2c_20framestring_20_3e_24',['Content< pduString, frameString >',['../class_content.html',1,'']]], - ['content_5fstack_25',['Content_stack',['../class_content__stack.html',1,'Content_stack< content_class, MaxSize >'],['../class_content__stack.html#abf24a26a21202c7bc916b820a4c698fd',1,'Content_stack::Content_stack()']]], - ['content_5fstack_2eh_26',['Content_stack.h',['../_content__stack_8h.html',1,'']]], - ['content_5fstack_3c_20char_2c_20512_20_3e_27',['Content_stack< char, 512 >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20content_5fclass_2c_20stacksize_20_3e_28',['Content_stack< content_class, stackSize >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20error_2c_20stacksize_20_3e_29',['Content_stack< Error, stackSize >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20frame_5fmodbusrtu_2c_20stacksize_20_3e_30',['Content_stack< Frame_modbusRTU, STACKSIZE >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20frametype_2c_20stacksize_20_3e_31',['Content_stack< frameType, STACKSIZE >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20message_2c_20stacksize_20_3e_32',['Content_stack< Message, stackSize >',['../class_content__stack.html',1,'']]], - ['content_5fto_5frep_33',['content_to_rep',['../class_content.html#a1f6eb4cb7073a5dc6c30d8566caff6c5',1,'Content']]], - ['crc16mask_34',['CRC16MASK',['../_frame__modbus_r_t_u_8h.html#a3c68608186b114292e3b5d467afea323',1,'Frame_modbusRTU.h']]], - ['crc16value_35',['CRC16VALUE',['../_frame__modbus_r_t_u_8h.html#a1278bf212a9965b29b29c8f0a740ec99',1,'Frame_modbusRTU.h']]], - ['crcerror_36',['crcError',['../_error_8h.html#a88edd67ec29d18293fae821840fef3aca44a9e3fc08f1805af68ca3174567fadc',1,'Error.h']]], - ['custom_20service_37',['Deriving a custom Service',['../index.html#autotoc_md15',1,'']]] + ['chararray_1',['CharArray',['../class_char_array.html',1,'CharArray'],['../class_char_array.html#a146ef9bb0b947f92e5f0ccb80b768c81',1,'CharArray::CharArray()'],['../class_char_array.html#ac79f104c9a63490a71f4a05f7fc2539b',1,'CharArray::CharArray(const CharArray &other)']]], + ['chararray_2ecpp_2',['CharArray.cpp',['../_char_array_8cpp.html',1,'']]], + ['chararray_2eh_3',['CharArray.h',['../_char_array_8h.html',1,'']]], + ['checkcrc16_4',['checkCRC16',['../class_frame__modbus_r_t_u.html#a4c47818dc37cda1cd7ba792989bcb0ea',1,'Frame_modbusRTU']]], + ['clang_20build_20for_20local_20debugging_5',['clang-build for local debugging',['../index.html#autotoc_md19',1,'']]], + ['classdiagram_6',['Classdiagram',['../index.html#autotoc_md13',1,'']]], + ['clearerrorstate_7',['clearErrorState',['../class_error_state.html#a2a2b91200168f27971ff6e63a8ab0e38',1,'ErrorState']]], + ['clearresponse_8',['clearResponse',['../class_service_base.html#ae959e3c9fa34b4c021e3d28a4c74222b',1,'ServiceBase::clearResponse()'],['../class_service.html#a75817b19f202f1696c3609a3f9578cb9',1,'Service::clearResponse()']]], + ['code_9',['code',['../struct_error_content__t.html#a1717614dc6e1a081dac66c003bf424a2',1,'ErrorContent_t']]], + ['comm_5finterface_10',['comm_interface',['../class_service_interface.html#a899b6f3e042682b285dca2588b833ae6',1,'ServiceInterface']]], + ['comminterface_11',['CommInterface',['../class_comm_interface.html',1,'CommInterface< interface_type >'],['../class_comm_interface.html#a036d6ee859c4aa352083626e3d852da2',1,'CommInterface::CommInterface()']]], + ['comminterface_2eh_12',['CommInterface.h',['../_comm_interface_8h.html',1,'']]], + ['comminterface_3c_20softwareserial_20_3e_13',['CommInterface< SoftwareSerial >',['../class_comm_interface.html',1,'']]], + ['comminterface_5fmodbusrtu_14',['CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html',1,'CommInterface_modbusRTU'],['../class_comm_interface__modbus_r_t_u.html#ac349c7e4dafa46ea96d89ed808a67b07',1,'CommInterface_modbusRTU::CommInterface_modbusRTU()']]], + ['comminterface_5fmodbusrtu_2ecpp_15',['CommInterface_modbusRTU.cpp',['../_comm_interface__modbus_r_t_u_8cpp.html',1,'']]], + ['comminterface_5fmodbusrtu_2eh_16',['CommInterface_modbusRTU.h',['../_comm_interface__modbus_r_t_u_8h.html',1,'']]], + ['comminterfacebase_17',['CommInterfaceBase',['../class_comm_interface_base.html',1,'CommInterfaceBase'],['../class_comm_interface_base.html#ac1c7e099dc4fce9e9c93a93cbf3c133e',1,'CommInterfaceBase::CommInterfaceBase()']]], + ['communicate_18',['communicate',['../class_service_interface.html#aeaebdad7101c0a66bee56edc4e6a19c1',1,'ServiceInterface::communicate()'],['../class_service_interface__modbus_r_t_u.html#ad1afd9540b980f8d4d8f2c947ce10a65',1,'ServiceInterface_modbusRTU::communicate()']]], + ['communication_20layer_19',['Communication Layer',['../index.html#autotoc_md11',1,'Communication-Layer'],['../index.html#autotoc_md9',1,'Service- and Communication-Layer']]], + ['concepts_20',['Basic Concepts',['../index.html#autotoc_md8',1,'']]], + ['content_21',['Content',['../class_content.html',1,'Content< content_type, representation_type >'],['../class_content.html#a2d300bab9c7fe3f9efb537139d8efba9',1,'Content::Content(content_type content)'],['../class_content.html#a017ed819c621340a1c77c59f93729c42',1,'Content::Content(representation_type representation)']]], + ['content_22',['content',['../class_content.html#a5078d76f7e6118f67e1f158692650d5b',1,'Content::content'],['../index.html#autotoc_md16',1,'Define the content']]], + ['content_20and_20representation_23',['Content and representation',['../index.html#autotoc_md12',1,'']]], + ['content_2eh_24',['Content.h',['../_content_8h.html',1,'']]], + ['content_3c_20errorcontent_5ft_2c_20string_20_3e_25',['Content< ErrorContent_t, String >',['../class_content.html',1,'']]], + ['content_3c_20message_5fcontent_5ft_2c_20string_20_3e_26',['Content< Message_content_t, String >',['../class_content.html',1,'']]], + ['content_3c_20string_2c_20chararray_20_3e_27',['Content< String, CharArray >',['../class_content.html',1,'']]], + ['content_5fstack_28',['Content_stack',['../class_content__stack.html',1,'Content_stack< content_class, MaxSize >'],['../class_content__stack.html#abf24a26a21202c7bc916b820a4c698fd',1,'Content_stack::Content_stack()']]], + ['content_5fstack_2eh_29',['Content_stack.h',['../_content__stack_8h.html',1,'']]], + ['content_5fstack_3c_20char_2c_20512_20_3e_30',['Content_stack< char, 512 >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20content_5fclass_2c_20stacksize_20_3e_31',['Content_stack< content_class, stackSize >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20error_2c_20stacksize_20_3e_32',['Content_stack< Error, stackSize >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20frame_5fmodbusrtu_2c_20stacksize_20_3e_33',['Content_stack< Frame_modbusRTU, STACKSIZE >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20frametype_2c_20stacksize_20_3e_34',['Content_stack< frameType, STACKSIZE >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20message_2c_20stacksize_20_3e_35',['Content_stack< Message, stackSize >',['../class_content__stack.html',1,'']]], + ['content_5fto_5frep_36',['content_to_rep',['../class_content.html#a1f6eb4cb7073a5dc6c30d8566caff6c5',1,'Content']]], + ['crc16mask_37',['CRC16MASK',['../_frame__modbus_r_t_u_8h.html#a3c68608186b114292e3b5d467afea323',1,'Frame_modbusRTU.h']]], + ['crc16value_38',['CRC16VALUE',['../_frame__modbus_r_t_u_8h.html#a1278bf212a9965b29b29c8f0a740ec99',1,'Frame_modbusRTU.h']]], + ['crcerror_39',['crcError',['../_error_8h.html#a88edd67ec29d18293fae821840fef3aca44a9e3fc08f1805af68ca3174567fadc',1,'Error.h']]], + ['custom_20service_40',['Deriving a custom Service',['../index.html#autotoc_md15',1,'']]] ]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js index 2a7e755..8e98d08 100644 --- a/docs/html/search/all_5.js +++ b/docs/html/search/all_5.js @@ -3,10 +3,10 @@ var searchData= ['finishedsending_0',['finishedSending',['../class_comm_interface_base.html#ad0438ac0d164b6179f742dec21be715d',1,'CommInterfaceBase::finishedSending()'],['../class_comm_interface.html#a9a27c7221b188bde1632a7c44f79b493',1,'CommInterface::finishedSending()']]], ['flush_1',['flush',['../classarduino_mocking_1_1_software_serial.html#a5785050c0162a9c4285b822d1dd940a1',1,'arduinoMocking::SoftwareSerial']]], ['for_20local_20debugging_2',['clang-build for local debugging',['../index.html#autotoc_md19',1,'']]], - ['frame_3',['Frame',['../class_frame.html',1,'Frame'],['../class_frame.html#ad2e5946cf41d4817e750500acf05d02b',1,'Frame::Frame()'],['../class_frame.html#a14e6a51db150c7d0bc1f2ce08d680e7b',1,'Frame::Frame(pduString *pdu)'],['../class_frame.html#a27d6b1db5f7dda4713bb1f0cfc67b180',1,'Frame::Frame(frameString *frame)']]], + ['frame_3',['Frame',['../class_frame.html',1,'Frame'],['../class_frame.html#ad2e5946cf41d4817e750500acf05d02b',1,'Frame::Frame()'],['../class_frame.html#a5e8a875fe8a7b74dd779cc77bb457bf6',1,'Frame::Frame(String *pdu)'],['../class_frame.html#ae87e5f4bdf967c1081005b2260441863',1,'Frame::Frame(CharArray *frame)']]], ['frame_2ecpp_4',['Frame.cpp',['../_frame_8cpp.html',1,'']]], ['frame_2eh_5',['Frame.h',['../_frame_8h.html',1,'']]], - ['frame_5fmodbusrtu_6',['Frame_modbusRTU',['../class_frame__modbus_r_t_u.html',1,'Frame_modbusRTU'],['../class_frame__modbus_r_t_u.html#a6009ce4dda11184e6e0055baf09b280a',1,'Frame_modbusRTU::Frame_modbusRTU(pduString *pdu, char *slaveId, char *functionCode)'],['../class_frame__modbus_r_t_u.html#a591ed00bcf27673a8534bfdb07dfa121',1,'Frame_modbusRTU::Frame_modbusRTU(frameString *frame)'],['../class_frame__modbus_r_t_u.html#ac8bde306d324d44d9d6adc6bc718e3a5',1,'Frame_modbusRTU::Frame_modbusRTU()'],['../class_frame__modbus_r_t_u.html#aeefc27c92fbcc096f4181869e918712e',1,'Frame_modbusRTU::Frame_modbusRTU(const Frame_modbusRTU &other)']]], + ['frame_5fmodbusrtu_6',['Frame_modbusRTU',['../class_frame__modbus_r_t_u.html',1,'Frame_modbusRTU'],['../class_frame__modbus_r_t_u.html#a162254e271d86cbc5761ec0f8e9d20f3',1,'Frame_modbusRTU::Frame_modbusRTU(String *pdu, char *slaveId, char *functionCode)'],['../class_frame__modbus_r_t_u.html#a5e80b5c1bf550713de304605fcc1825b',1,'Frame_modbusRTU::Frame_modbusRTU(CharArray *frame)'],['../class_frame__modbus_r_t_u.html#ac8bde306d324d44d9d6adc6bc718e3a5',1,'Frame_modbusRTU::Frame_modbusRTU()']]], ['frame_5fmodbusrtu_2ecpp_7',['Frame_modbusRTU.cpp',['../_frame__modbus_r_t_u_8cpp.html',1,'']]], ['frame_5fmodbusrtu_2eh_8',['Frame_modbusRTU.h',['../_frame__modbus_r_t_u_8h.html',1,'']]], ['framelengtherror_9',['frameLengthError',['../_error_8h.html#a88edd67ec29d18293fae821840fef3acaebbf7bd809b94b7d0725f163a4d406a9',1,'Error.h']]], diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js index 291b655..af982f1 100644 --- a/docs/html/search/all_6.js +++ b/docs/html/search/all_6.js @@ -6,15 +6,16 @@ var searchData= ['get_5frepresentation_3',['get_representation',['../class_content.html#a206c6c8ebf9f5f84c571d8d9dfbdd40c',1,'Content']]], ['get_5fresponse_4',['get_response',['../class_service_base.html#ab59dbe94f663838461cdd00536f46c0c',1,'ServiceBase::get_response()'],['../class_service.html#a601e6d2878ce2b292a3b7c6428f0d51f',1,'Service::get_response()']]], ['get_5fserviceid_5',['get_ServiceID',['../class_service_base.html#a10d3306ab361be7854734c80eb30dc1d',1,'ServiceBase::get_ServiceID()'],['../class_service.html#a4d0e8aca49451e363888ca46c2742b2e',1,'Service::get_ServiceID()']]], - ['getdeviceid_6',['getDeviceId',['../class_comm_interface__modbus_r_t_u.html#acced18055fd7b7157e66155b1346d20f',1,'CommInterface_modbusRTU']]], - ['getelement_7',['getElement',['../class_content__stack.html#a5ac2a896da7724281d9d85eb239f5084',1,'Content_stack']]], - ['geterrorstate_8',['getErrorState',['../class_error_state.html#a55090bb1772cd8c20c936b5a9cf4f2ce',1,'ErrorState']]], - ['getframe_9',['getFrame',['../class_frame.html#a2aa3fb0eb3fc7248bda4684a57b3bf27',1,'Frame']]], + ['getdata_6',['getData',['../class_char_array.html#aca5000ba20e3e1a4b6efd128c8dd62dd',1,'CharArray']]], + ['getdeviceid_7',['getDeviceId',['../class_comm_interface__modbus_r_t_u.html#acced18055fd7b7157e66155b1346d20f',1,'CommInterface_modbusRTU']]], + ['getelement_8',['getElement',['../class_content__stack.html#a5ac2a896da7724281d9d85eb239f5084',1,'Content_stack']]], + ['geterrorstate_9',['getErrorState',['../class_error_state.html#a55090bb1772cd8c20c936b5a9cf4f2ce',1,'ErrorState']]], ['getfunctioncode_10',['getFunctionCode',['../class_frame__modbus_r_t_u.html#a02b47ac99a90a57c64b17f291190b13d',1,'Frame_modbusRTU']]], - ['getnumberofservices_11',['getNumberOfServices',['../class_service_cluster_base.html#acbc08bddc57dbe90665216f5b2dedd35',1,'ServiceClusterBase::getNumberOfServices()'],['../class_service_cluster.html#a507a50d20b2764c77200a73971935971',1,'ServiceCluster::getNumberOfServices()']]], - ['getpdu_12',['getPDU',['../class_frame.html#abfe1ce91d1d7080940628ba6acdc7196',1,'Frame']]], + ['gethexstring_11',['getHexString',['../class_char_array.html#ab6ae6efb0622d58bd8ae2aa77cce6b00',1,'CharArray']]], + ['getnumberofservices_12',['getNumberOfServices',['../class_service_cluster_base.html#acbc08bddc57dbe90665216f5b2dedd35',1,'ServiceClusterBase::getNumberOfServices()'],['../class_service_cluster.html#a507a50d20b2764c77200a73971935971',1,'ServiceCluster::getNumberOfServices()']]], ['getpdu_5ffrom_5fservices_13',['getPDU_from_services',['../class_service_interface.html#ab4112c2b2eb29d1e0ade95e4f3c07030',1,'ServiceInterface']]], - ['getreceivedframe_14',['getReceivedFrame',['../class_comm_interface_base.html#a27a15e83d148ddd98d7116a225a3a30d',1,'CommInterfaceBase::getReceivedFrame()'],['../class_comm_interface.html#a446d6dfeb4dd695c061f1ff1c926fb51',1,'CommInterface::getReceivedFrame()']]], + ['getreceivedframe_14',['getReceivedFrame',['../class_comm_interface_base.html#a24de53b6a6f3150b9c2f904fbf872ef5',1,'CommInterfaceBase::getReceivedFrame()'],['../class_comm_interface.html#ab8f43fd2837a027c0008859567ced8de',1,'CommInterface::getReceivedFrame()']]], ['getservice_5fbyid_15',['getService_byID',['../class_service_cluster_base.html#ae025282a6ef15d01eaba440bdf73a750',1,'ServiceClusterBase::getService_byID()'],['../class_service_cluster.html#ae40a5207d621ccd428297ae8f3bbbf40',1,'ServiceCluster::getService_byID()']]], - ['getservice_5fbypos_16',['getService_byPos',['../class_service_cluster_base.html#a15023dc39ae2ceeb678d38f9bb51b172',1,'ServiceClusterBase::getService_byPos()'],['../class_service_cluster.html#a9e24f14fb13116a5f7bb7a551b8c5d22',1,'ServiceCluster::getService_byPos()']]] + ['getservice_5fbypos_16',['getService_byPos',['../class_service_cluster_base.html#a15023dc39ae2ceeb678d38f9bb51b172',1,'ServiceClusterBase::getService_byPos()'],['../class_service_cluster.html#a9e24f14fb13116a5f7bb7a551b8c5d22',1,'ServiceCluster::getService_byPos()']]], + ['getsize_17',['getSize',['../class_char_array.html#a384344479de289fff7c98966f0b079be',1,'CharArray']]] ]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js index 57e665a..8944f18 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -1,5 +1,9 @@ var searchData= [ - ['operator_3d_0',['operator=',['../class_frame__modbus_r_t_u.html#af22baa4f3962f3f4e9d9d86c2155bc45',1,'Frame_modbusRTU']]], - ['output_1',['OUTPUT',['../mock_arduino_8h.html#a61a3c9a18380aafb6e430e79bf596557',1,'mockArduino.h']]] + ['operator_21_3d_0',['operator!=',['../class_char_array.html#ab801f84f8b8b84f089b8d574d9f0f7dd',1,'CharArray']]], + ['operator_2b_3d_1',['operator+=',['../class_char_array.html#af571946b68108c9cb95c6b046073227f',1,'CharArray']]], + ['operator_3d_2',['operator=',['../class_char_array.html#a5a3f1e26bd80a96b7cc36a5e0b984860',1,'CharArray::operator=(const CharArray &other)'],['../class_char_array.html#a065e4ef970ec3952d129d14c947400e1',1,'CharArray::operator=(const String &other)']]], + ['operator_3d_3d_3',['operator==',['../class_char_array.html#ad530feb6d6970e84df2056ef7b338da5',1,'CharArray']]], + ['operator_5b_5d_4',['operator[]',['../class_char_array.html#a388f6ed3f703102118c210c1a7c79ef6',1,'CharArray::operator[](size_t index)'],['../class_char_array.html#ae79eeb2b6c5b4fc80ffcd599e82239e6',1,'CharArray::operator[](size_t index) const']]], + ['output_5',['OUTPUT',['../mock_arduino_8h.html#a61a3c9a18380aafb6e430e79bf596557',1,'mockArduino.h']]] ]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js index c722771..23d2011 100644 --- a/docs/html/search/all_c.js +++ b/docs/html/search/all_c.js @@ -1,12 +1,11 @@ var searchData= [ - ['pdustring_0',['pduString',['../_frame_8h.html#a482f50c6b69835c5a4abdd201a2d40df',1,'Frame.h']]], - ['peek_1',['peek',['../classarduino_mocking_1_1_software_serial.html#ae70b691c402eede6805828c476b96bf5',1,'arduinoMocking::SoftwareSerial']]], - ['pinmode_2',['pinMode',['../namespacearduino_mocking.html#acbfa9a213dea8b606211beb942bc52ab',1,'arduinoMocking']]], - ['prefixsize_3',['PREFIXSIZE',['../_frame__modbus_r_t_u_8h.html#a5b759218acbb3b1a38f7c041d9cc94ea',1,'Frame_modbusRTU.h']]], - ['print_4',['print',['../classarduino_mocking_1_1_mock_serial.html#a5574b127279fa6e099d1026d3a69a5d4',1,'arduinoMocking::MockSerial::print(const std::string &str)'],['../classarduino_mocking_1_1_mock_serial.html#ab78a5a346275ab600281acb8b62350ce',1,'arduinoMocking::MockSerial::print(char c)'],['../classarduino_mocking_1_1_mock_serial.html#a20ab0b8af925e49c0fb3d409612e2961',1,'arduinoMocking::MockSerial::print(int num)'],['../classarduino_mocking_1_1_mock_serial.html#ae11d6d44915c7f5aa22d126e5dc09191',1,'arduinoMocking::MockSerial::print(unsigned int num)'],['../classarduino_mocking_1_1_mock_serial.html#a669f7bae40ca6627250fcc99afd09255',1,'arduinoMocking::MockSerial::print(long num)'],['../classarduino_mocking_1_1_mock_serial.html#abca1ad8ef0287f2cbf3c5687cfa01a0c',1,'arduinoMocking::MockSerial::print(unsigned long num)'],['../classarduino_mocking_1_1_mock_serial.html#a9ee99aad6429ee3ba655f656f0110182',1,'arduinoMocking::MockSerial::print(double num)'],['../classarduino_mocking_1_1_software_serial.html#ad19e74f4a2378ed414ca4f18649b0e31',1,'arduinoMocking::SoftwareSerial::print()']]], - ['println_5',['println',['../classarduino_mocking_1_1_mock_serial.html#a3ae50becfead299fa547d158a80544d4',1,'arduinoMocking::MockSerial::println(const std::string &str)'],['../classarduino_mocking_1_1_mock_serial.html#a0d99ac9e6d82fdd860298b4a62366df3',1,'arduinoMocking::MockSerial::println(char c)'],['../classarduino_mocking_1_1_mock_serial.html#aa4903d4eae568197d4c4b79500e4d4db',1,'arduinoMocking::MockSerial::println(int num)'],['../classarduino_mocking_1_1_mock_serial.html#a7f5068154c7422844343ef7908b6df5e',1,'arduinoMocking::MockSerial::println(unsigned int num)'],['../classarduino_mocking_1_1_mock_serial.html#aafdd120adc7002a1308a7cc48483555a',1,'arduinoMocking::MockSerial::println(long num)'],['../classarduino_mocking_1_1_mock_serial.html#a3a0a3788fa52814acad9919bc8442d8c',1,'arduinoMocking::MockSerial::println(unsigned long num)'],['../classarduino_mocking_1_1_mock_serial.html#a5c4f259c0a492f7370acbd95c4e73a24',1,'arduinoMocking::MockSerial::println(double num)'],['../classarduino_mocking_1_1_mock_serial.html#a47a129e1092041a5b2e0d1d881213c3c',1,'arduinoMocking::MockSerial::println()'],['../classarduino_mocking_1_1_software_serial.html#a5fd9d4b41b5a69dfd9e9555901bd2b48',1,'arduinoMocking::SoftwareSerial::println()']]], - ['processrecstack_6',['processRecStack',['../class_service_interface.html#a7c5ec5e13af8a67d1b08c963fcd71214',1,'ServiceInterface']]], - ['processsendstack_7',['processSendStack',['../class_service_interface.html#a23feb243ed1748e04dd757aa5f788b3e',1,'ServiceInterface']]], - ['processservices_8',['processServices',['../class_service_interface.html#a4dffc7c3e366b470e1075db65333b67e',1,'ServiceInterface']]] + ['peek_0',['peek',['../classarduino_mocking_1_1_software_serial.html#ae70b691c402eede6805828c476b96bf5',1,'arduinoMocking::SoftwareSerial']]], + ['pinmode_1',['pinMode',['../namespacearduino_mocking.html#acbfa9a213dea8b606211beb942bc52ab',1,'arduinoMocking']]], + ['prefixsize_2',['PREFIXSIZE',['../_frame__modbus_r_t_u_8h.html#a5b759218acbb3b1a38f7c041d9cc94ea',1,'Frame_modbusRTU.h']]], + ['print_3',['print',['../classarduino_mocking_1_1_mock_serial.html#a5574b127279fa6e099d1026d3a69a5d4',1,'arduinoMocking::MockSerial::print(const std::string &str)'],['../classarduino_mocking_1_1_mock_serial.html#ab78a5a346275ab600281acb8b62350ce',1,'arduinoMocking::MockSerial::print(char c)'],['../classarduino_mocking_1_1_mock_serial.html#a20ab0b8af925e49c0fb3d409612e2961',1,'arduinoMocking::MockSerial::print(int num)'],['../classarduino_mocking_1_1_mock_serial.html#ae11d6d44915c7f5aa22d126e5dc09191',1,'arduinoMocking::MockSerial::print(unsigned int num)'],['../classarduino_mocking_1_1_mock_serial.html#a669f7bae40ca6627250fcc99afd09255',1,'arduinoMocking::MockSerial::print(long num)'],['../classarduino_mocking_1_1_mock_serial.html#abca1ad8ef0287f2cbf3c5687cfa01a0c',1,'arduinoMocking::MockSerial::print(unsigned long num)'],['../classarduino_mocking_1_1_mock_serial.html#a9ee99aad6429ee3ba655f656f0110182',1,'arduinoMocking::MockSerial::print(double num)'],['../classarduino_mocking_1_1_software_serial.html#ad19e74f4a2378ed414ca4f18649b0e31',1,'arduinoMocking::SoftwareSerial::print()']]], + ['println_4',['println',['../classarduino_mocking_1_1_mock_serial.html#a3ae50becfead299fa547d158a80544d4',1,'arduinoMocking::MockSerial::println(const std::string &str)'],['../classarduino_mocking_1_1_mock_serial.html#a0d99ac9e6d82fdd860298b4a62366df3',1,'arduinoMocking::MockSerial::println(char c)'],['../classarduino_mocking_1_1_mock_serial.html#aa4903d4eae568197d4c4b79500e4d4db',1,'arduinoMocking::MockSerial::println(int num)'],['../classarduino_mocking_1_1_mock_serial.html#a7f5068154c7422844343ef7908b6df5e',1,'arduinoMocking::MockSerial::println(unsigned int num)'],['../classarduino_mocking_1_1_mock_serial.html#aafdd120adc7002a1308a7cc48483555a',1,'arduinoMocking::MockSerial::println(long num)'],['../classarduino_mocking_1_1_mock_serial.html#a3a0a3788fa52814acad9919bc8442d8c',1,'arduinoMocking::MockSerial::println(unsigned long num)'],['../classarduino_mocking_1_1_mock_serial.html#a5c4f259c0a492f7370acbd95c4e73a24',1,'arduinoMocking::MockSerial::println(double num)'],['../classarduino_mocking_1_1_mock_serial.html#a47a129e1092041a5b2e0d1d881213c3c',1,'arduinoMocking::MockSerial::println()'],['../classarduino_mocking_1_1_software_serial.html#a5fd9d4b41b5a69dfd9e9555901bd2b48',1,'arduinoMocking::SoftwareSerial::println()']]], + ['processrecstack_5',['processRecStack',['../class_service_interface.html#a7c5ec5e13af8a67d1b08c963fcd71214',1,'ServiceInterface']]], + ['processsendstack_6',['processSendStack',['../class_service_interface.html#a23feb243ed1748e04dd757aa5f788b3e',1,'ServiceInterface']]], + ['processservices_7',['processServices',['../class_service_interface.html#a4dffc7c3e366b470e1075db65333b67e',1,'ServiceInterface']]] ]; diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js index a03caac..75b6467 100644 --- a/docs/html/search/all_d.js +++ b/docs/html/search/all_d.js @@ -3,11 +3,11 @@ var searchData= ['raiseerror_0',['raiseError',['../class_error_service.html#a4db0ae1a3ca53fe1e6290b87390098ba',1,'ErrorService::raiseError()'],['../class_error_state.html#ab996befaa1eb1089914ab0fbfecfcf39',1,'ErrorState::raiseError()'],['../class_service_interface.html#a42226b8c236c344b6c5d171736a08f6e',1,'ServiceInterface::raiseError()']]], ['read_1',['read',['../classarduino_mocking_1_1_mock_serial.html#a06e96a93e5e0f1785e6e87620625eeaf',1,'arduinoMocking::MockSerial::read()'],['../classarduino_mocking_1_1_software_serial.html#a892a38a5eb6b0c115c2745098c9637ad',1,'arduinoMocking::SoftwareSerial::read()']]], ['receive_2',['receive',['../class_comm_interface.html#a81c74dee239a10522d30900943f64eb2',1,'CommInterface::receive()'],['../class_comm_interface__modbus_r_t_u.html#a50b42ad0a40a82ebe5a7749313ca2283',1,'CommInterface_modbusRTU::receive()']]], - ['receivebuffer_3',['receiveBuffer',['../class_comm_interface.html#aa2cedf4d8d25ab2a0a04278c976383d9',1,'CommInterface']]], + ['receivebuffer_3',['receiveBuffer',['../class_comm_interface.html#a16f63bbe5fbe3e4b328ac4bf9727eebf',1,'CommInterface']]], ['receivecycle_4',['receiveCycle',['../class_comm_interface.html#a86287d0a0ecad690b5182bbe01b7f63f',1,'CommInterface']]], ['receivednewframe_5',['receivedNewFrame',['../class_comm_interface_base.html#a08f93b5ea06e7ffb99571f4798108da2',1,'CommInterfaceBase::receivedNewFrame()'],['../class_comm_interface.html#aea53cf3e71460f3a662c175958acb643',1,'CommInterface::receivedNewFrame()']]], ['receiver_5fid_6',['receiver_id',['../struct_message__content__t.html#a0c1e2ca71214ff401635a9cd21c65cee',1,'Message_content_t']]], - ['recitem_7',['recItem',['../class_service_interface.html#ac69502c2d78c4a046c5d3219d637f1b3',1,'ServiceInterface']]], + ['recitem_7',['recItem',['../class_service_interface.html#a5564df6dabbaab51556a9dffe37b2444',1,'ServiceInterface']]], ['recstack_8',['recStack',['../class_service_interface.html#a7793efd070a56f021ce56a372b13c2fa',1,'ServiceInterface']]], ['rep_5fto_5fcontent_9',['rep_to_content',['../class_content.html#abac5c5b29b85a4abbd5dc5f09ce03d46',1,'Content']]], ['representation_10',['representation',['../index.html#autotoc_md12',1,'Content and representation'],['../class_content.html#aa667f2d6f2ec335fb5ac1204f4cdc0b8',1,'Content::representation']]], diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js index 40cdd1c..88928dd 100644 --- a/docs/html/search/all_e.js +++ b/docs/html/search/all_e.js @@ -1,12 +1,12 @@ var searchData= [ ['send_0',['send',['../class_comm_interface.html#a458e3da4ff47bdf6cc9f0a5f956c80dd',1,'CommInterface::send()'],['../class_comm_interface__modbus_r_t_u.html#a0e78a2a6e3b5b029609c2b16c21bd85b',1,'CommInterface_modbusRTU::send()']]], - ['sendbuffer_1',['sendBuffer',['../class_comm_interface.html#a158b6fec22811cd97732ca9bada05873',1,'CommInterface']]], + ['sendbuffer_1',['sendBuffer',['../class_comm_interface.html#a129b3eda32cb5a57087e87c612423589',1,'CommInterface']]], ['sendcycle_2',['sendCycle',['../class_comm_interface.html#a8670e37fdefcfeca579e99b6051fe3da',1,'CommInterface']]], ['sender_5fid_3',['sender_id',['../struct_message__content__t.html#ad18914f4dbe4131a1cb38cedbdb3069a',1,'Message_content_t']]], - ['senditem_4',['sendItem',['../class_service_interface.html#a1e08cf764cea2084e1f425e32f44d2c1',1,'ServiceInterface']]], + ['senditem_4',['sendItem',['../class_service_interface.html#ae4aa045a41f0040cacbc20d9dccc3db7',1,'ServiceInterface']]], ['sendmessage_5',['sendMessage',['../class_message_service.html#ac8e64d87d453ae6a6631891bdce42bef',1,'MessageService']]], - ['sendnewframe_6',['sendNewFrame',['../class_comm_interface_base.html#abc912fe242ac43255912b2f9bb9ee6fd',1,'CommInterfaceBase::sendNewFrame()'],['../class_comm_interface.html#a21c8ee8eddb3011e89b950f1b5264664',1,'CommInterface::sendNewFrame()']]], + ['sendnewframe_6',['sendNewFrame',['../class_comm_interface_base.html#afb11f519c50f1e5a7ec22bd5f253a2ce',1,'CommInterfaceBase::sendNewFrame()'],['../class_comm_interface.html#a3cf21e5181e56d234dbe9e52e6f2cb70',1,'CommInterface::sendNewFrame()']]], ['sendstack_7',['sendStack',['../class_service_interface.html#a38bd169d6286c4ddbda050b7f28d093a',1,'ServiceInterface']]], ['serial_8',['Serial',['../namespacearduino_mocking.html#ace877ffb508b19b20cbc06b8f9837359',1,'arduinoMocking']]], ['service_9',['Service',['../index.html#autotoc_md15',1,'Deriving a custom Service'],['../class_service.html',1,'Service< content_class, stackSize >']]], diff --git a/docs/html/search/classes_0.js b/docs/html/search/classes_0.js index 37b92ee..0110bdb 100644 --- a/docs/html/search/classes_0.js +++ b/docs/html/search/classes_0.js @@ -1,18 +1,19 @@ var searchData= [ - ['comminterface_0',['CommInterface',['../class_comm_interface.html',1,'']]], - ['comminterface_3c_20softwareserial_20_3e_1',['CommInterface< SoftwareSerial >',['../class_comm_interface.html',1,'']]], - ['comminterface_5fmodbusrtu_2',['CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html',1,'']]], - ['comminterfacebase_3',['CommInterfaceBase',['../class_comm_interface_base.html',1,'']]], - ['content_4',['Content',['../class_content.html',1,'']]], - ['content_3c_20errorcontent_5ft_2c_20string_20_3e_5',['Content< ErrorContent_t, String >',['../class_content.html',1,'']]], - ['content_3c_20message_5fcontent_5ft_2c_20string_20_3e_6',['Content< Message_content_t, String >',['../class_content.html',1,'']]], - ['content_3c_20pdustring_2c_20framestring_20_3e_7',['Content< pduString, frameString >',['../class_content.html',1,'']]], - ['content_5fstack_8',['Content_stack',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20char_2c_20512_20_3e_9',['Content_stack< char, 512 >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20content_5fclass_2c_20stacksize_20_3e_10',['Content_stack< content_class, stackSize >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20error_2c_20stacksize_20_3e_11',['Content_stack< Error, stackSize >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20frame_5fmodbusrtu_2c_20stacksize_20_3e_12',['Content_stack< Frame_modbusRTU, STACKSIZE >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20frametype_2c_20stacksize_20_3e_13',['Content_stack< frameType, STACKSIZE >',['../class_content__stack.html',1,'']]], - ['content_5fstack_3c_20message_2c_20stacksize_20_3e_14',['Content_stack< Message, stackSize >',['../class_content__stack.html',1,'']]] + ['chararray_0',['CharArray',['../class_char_array.html',1,'']]], + ['comminterface_1',['CommInterface',['../class_comm_interface.html',1,'']]], + ['comminterface_3c_20softwareserial_20_3e_2',['CommInterface< SoftwareSerial >',['../class_comm_interface.html',1,'']]], + ['comminterface_5fmodbusrtu_3',['CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html',1,'']]], + ['comminterfacebase_4',['CommInterfaceBase',['../class_comm_interface_base.html',1,'']]], + ['content_5',['Content',['../class_content.html',1,'']]], + ['content_3c_20errorcontent_5ft_2c_20string_20_3e_6',['Content< ErrorContent_t, String >',['../class_content.html',1,'']]], + ['content_3c_20message_5fcontent_5ft_2c_20string_20_3e_7',['Content< Message_content_t, String >',['../class_content.html',1,'']]], + ['content_3c_20string_2c_20chararray_20_3e_8',['Content< String, CharArray >',['../class_content.html',1,'']]], + ['content_5fstack_9',['Content_stack',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20char_2c_20512_20_3e_10',['Content_stack< char, 512 >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20content_5fclass_2c_20stacksize_20_3e_11',['Content_stack< content_class, stackSize >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20error_2c_20stacksize_20_3e_12',['Content_stack< Error, stackSize >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20frame_5fmodbusrtu_2c_20stacksize_20_3e_13',['Content_stack< Frame_modbusRTU, STACKSIZE >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20frametype_2c_20stacksize_20_3e_14',['Content_stack< frameType, STACKSIZE >',['../class_content__stack.html',1,'']]], + ['content_5fstack_3c_20message_2c_20stacksize_20_3e_15',['Content_stack< Message, stackSize >',['../class_content__stack.html',1,'']]] ]; diff --git a/docs/html/search/files_0.js b/docs/html/search/files_0.js index 22c0bc2..b693661 100644 --- a/docs/html/search/files_0.js +++ b/docs/html/search/files_0.js @@ -1,8 +1,10 @@ var searchData= [ - ['comminterface_2eh_0',['CommInterface.h',['../_comm_interface_8h.html',1,'']]], - ['comminterface_5fmodbusrtu_2ecpp_1',['CommInterface_modbusRTU.cpp',['../_comm_interface__modbus_r_t_u_8cpp.html',1,'']]], - ['comminterface_5fmodbusrtu_2eh_2',['CommInterface_modbusRTU.h',['../_comm_interface__modbus_r_t_u_8h.html',1,'']]], - ['content_2eh_3',['Content.h',['../_content_8h.html',1,'']]], - ['content_5fstack_2eh_4',['Content_stack.h',['../_content__stack_8h.html',1,'']]] + ['chararray_2ecpp_0',['CharArray.cpp',['../_char_array_8cpp.html',1,'']]], + ['chararray_2eh_1',['CharArray.h',['../_char_array_8h.html',1,'']]], + ['comminterface_2eh_2',['CommInterface.h',['../_comm_interface_8h.html',1,'']]], + ['comminterface_5fmodbusrtu_2ecpp_3',['CommInterface_modbusRTU.cpp',['../_comm_interface__modbus_r_t_u_8cpp.html',1,'']]], + ['comminterface_5fmodbusrtu_2eh_4',['CommInterface_modbusRTU.h',['../_comm_interface__modbus_r_t_u_8h.html',1,'']]], + ['content_2eh_5',['Content.h',['../_content_8h.html',1,'']]], + ['content_5fstack_2eh_6',['Content_stack.h',['../_content__stack_8h.html',1,'']]] ]; diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js index fc85212..cce61d8 100644 --- a/docs/html/search/functions_2.js +++ b/docs/html/search/functions_2.js @@ -1,13 +1,14 @@ var searchData= [ - ['checkcrc16_0',['checkCRC16',['../class_frame__modbus_r_t_u.html#a4c47818dc37cda1cd7ba792989bcb0ea',1,'Frame_modbusRTU']]], - ['clearerrorstate_1',['clearErrorState',['../class_error_state.html#a2a2b91200168f27971ff6e63a8ab0e38',1,'ErrorState']]], - ['clearresponse_2',['clearResponse',['../class_service_base.html#ae959e3c9fa34b4c021e3d28a4c74222b',1,'ServiceBase::clearResponse()'],['../class_service.html#a75817b19f202f1696c3609a3f9578cb9',1,'Service::clearResponse()']]], - ['comminterface_3',['CommInterface',['../class_comm_interface.html#a036d6ee859c4aa352083626e3d852da2',1,'CommInterface']]], - ['comminterface_5fmodbusrtu_4',['CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html#ac349c7e4dafa46ea96d89ed808a67b07',1,'CommInterface_modbusRTU']]], - ['comminterfacebase_5',['CommInterfaceBase',['../class_comm_interface_base.html#ac1c7e099dc4fce9e9c93a93cbf3c133e',1,'CommInterfaceBase']]], - ['communicate_6',['communicate',['../class_service_interface.html#aeaebdad7101c0a66bee56edc4e6a19c1',1,'ServiceInterface::communicate()'],['../class_service_interface__modbus_r_t_u.html#ad1afd9540b980f8d4d8f2c947ce10a65',1,'ServiceInterface_modbusRTU::communicate()']]], - ['content_7',['Content',['../class_content.html#a2d300bab9c7fe3f9efb537139d8efba9',1,'Content::Content(content_type content)'],['../class_content.html#a017ed819c621340a1c77c59f93729c42',1,'Content::Content(representation_type representation)']]], - ['content_5fstack_8',['Content_stack',['../class_content__stack.html#abf24a26a21202c7bc916b820a4c698fd',1,'Content_stack']]], - ['content_5fto_5frep_9',['content_to_rep',['../class_content.html#a1f6eb4cb7073a5dc6c30d8566caff6c5',1,'Content']]] + ['chararray_0',['CharArray',['../class_char_array.html#a146ef9bb0b947f92e5f0ccb80b768c81',1,'CharArray::CharArray()'],['../class_char_array.html#ac79f104c9a63490a71f4a05f7fc2539b',1,'CharArray::CharArray(const CharArray &other)']]], + ['checkcrc16_1',['checkCRC16',['../class_frame__modbus_r_t_u.html#a4c47818dc37cda1cd7ba792989bcb0ea',1,'Frame_modbusRTU']]], + ['clearerrorstate_2',['clearErrorState',['../class_error_state.html#a2a2b91200168f27971ff6e63a8ab0e38',1,'ErrorState']]], + ['clearresponse_3',['clearResponse',['../class_service_base.html#ae959e3c9fa34b4c021e3d28a4c74222b',1,'ServiceBase::clearResponse()'],['../class_service.html#a75817b19f202f1696c3609a3f9578cb9',1,'Service::clearResponse()']]], + ['comminterface_4',['CommInterface',['../class_comm_interface.html#a036d6ee859c4aa352083626e3d852da2',1,'CommInterface']]], + ['comminterface_5fmodbusrtu_5',['CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html#ac349c7e4dafa46ea96d89ed808a67b07',1,'CommInterface_modbusRTU']]], + ['comminterfacebase_6',['CommInterfaceBase',['../class_comm_interface_base.html#ac1c7e099dc4fce9e9c93a93cbf3c133e',1,'CommInterfaceBase']]], + ['communicate_7',['communicate',['../class_service_interface.html#aeaebdad7101c0a66bee56edc4e6a19c1',1,'ServiceInterface::communicate()'],['../class_service_interface__modbus_r_t_u.html#ad1afd9540b980f8d4d8f2c947ce10a65',1,'ServiceInterface_modbusRTU::communicate()']]], + ['content_8',['Content',['../class_content.html#a2d300bab9c7fe3f9efb537139d8efba9',1,'Content::Content(content_type content)'],['../class_content.html#a017ed819c621340a1c77c59f93729c42',1,'Content::Content(representation_type representation)']]], + ['content_5fstack_9',['Content_stack',['../class_content__stack.html#abf24a26a21202c7bc916b820a4c698fd',1,'Content_stack']]], + ['content_5fto_5frep_10',['content_to_rep',['../class_content.html#a1f6eb4cb7073a5dc6c30d8566caff6c5',1,'Content']]] ]; diff --git a/docs/html/search/functions_5.js b/docs/html/search/functions_5.js index 15f6b78..c1afc9d 100644 --- a/docs/html/search/functions_5.js +++ b/docs/html/search/functions_5.js @@ -2,7 +2,7 @@ var searchData= [ ['finishedsending_0',['finishedSending',['../class_comm_interface_base.html#ad0438ac0d164b6179f742dec21be715d',1,'CommInterfaceBase::finishedSending()'],['../class_comm_interface.html#a9a27c7221b188bde1632a7c44f79b493',1,'CommInterface::finishedSending()']]], ['flush_1',['flush',['../classarduino_mocking_1_1_software_serial.html#a5785050c0162a9c4285b822d1dd940a1',1,'arduinoMocking::SoftwareSerial']]], - ['frame_2',['Frame',['../class_frame.html#ad2e5946cf41d4817e750500acf05d02b',1,'Frame::Frame()'],['../class_frame.html#a14e6a51db150c7d0bc1f2ce08d680e7b',1,'Frame::Frame(pduString *pdu)'],['../class_frame.html#a27d6b1db5f7dda4713bb1f0cfc67b180',1,'Frame::Frame(frameString *frame)']]], - ['frame_5fmodbusrtu_3',['Frame_modbusRTU',['../class_frame__modbus_r_t_u.html#a6009ce4dda11184e6e0055baf09b280a',1,'Frame_modbusRTU::Frame_modbusRTU(pduString *pdu, char *slaveId, char *functionCode)'],['../class_frame__modbus_r_t_u.html#a591ed00bcf27673a8534bfdb07dfa121',1,'Frame_modbusRTU::Frame_modbusRTU(frameString *frame)'],['../class_frame__modbus_r_t_u.html#ac8bde306d324d44d9d6adc6bc718e3a5',1,'Frame_modbusRTU::Frame_modbusRTU()'],['../class_frame__modbus_r_t_u.html#aeefc27c92fbcc096f4181869e918712e',1,'Frame_modbusRTU::Frame_modbusRTU(const Frame_modbusRTU &other)']]], + ['frame_2',['Frame',['../class_frame.html#ad2e5946cf41d4817e750500acf05d02b',1,'Frame::Frame()'],['../class_frame.html#a5e8a875fe8a7b74dd779cc77bb457bf6',1,'Frame::Frame(String *pdu)'],['../class_frame.html#ae87e5f4bdf967c1081005b2260441863',1,'Frame::Frame(CharArray *frame)']]], + ['frame_5fmodbusrtu_3',['Frame_modbusRTU',['../class_frame__modbus_r_t_u.html#a162254e271d86cbc5761ec0f8e9d20f3',1,'Frame_modbusRTU::Frame_modbusRTU(String *pdu, char *slaveId, char *functionCode)'],['../class_frame__modbus_r_t_u.html#a5e80b5c1bf550713de304605fcc1825b',1,'Frame_modbusRTU::Frame_modbusRTU(CharArray *frame)'],['../class_frame__modbus_r_t_u.html#ac8bde306d324d44d9d6adc6bc718e3a5',1,'Frame_modbusRTU::Frame_modbusRTU()']]], ['full_4',['full',['../class_content__stack.html#a200a86b0f3bdfa24e4a56b5e02efb02a',1,'Content_stack']]] ]; diff --git a/docs/html/search/functions_6.js b/docs/html/search/functions_6.js index 291b655..af982f1 100644 --- a/docs/html/search/functions_6.js +++ b/docs/html/search/functions_6.js @@ -6,15 +6,16 @@ var searchData= ['get_5frepresentation_3',['get_representation',['../class_content.html#a206c6c8ebf9f5f84c571d8d9dfbdd40c',1,'Content']]], ['get_5fresponse_4',['get_response',['../class_service_base.html#ab59dbe94f663838461cdd00536f46c0c',1,'ServiceBase::get_response()'],['../class_service.html#a601e6d2878ce2b292a3b7c6428f0d51f',1,'Service::get_response()']]], ['get_5fserviceid_5',['get_ServiceID',['../class_service_base.html#a10d3306ab361be7854734c80eb30dc1d',1,'ServiceBase::get_ServiceID()'],['../class_service.html#a4d0e8aca49451e363888ca46c2742b2e',1,'Service::get_ServiceID()']]], - ['getdeviceid_6',['getDeviceId',['../class_comm_interface__modbus_r_t_u.html#acced18055fd7b7157e66155b1346d20f',1,'CommInterface_modbusRTU']]], - ['getelement_7',['getElement',['../class_content__stack.html#a5ac2a896da7724281d9d85eb239f5084',1,'Content_stack']]], - ['geterrorstate_8',['getErrorState',['../class_error_state.html#a55090bb1772cd8c20c936b5a9cf4f2ce',1,'ErrorState']]], - ['getframe_9',['getFrame',['../class_frame.html#a2aa3fb0eb3fc7248bda4684a57b3bf27',1,'Frame']]], + ['getdata_6',['getData',['../class_char_array.html#aca5000ba20e3e1a4b6efd128c8dd62dd',1,'CharArray']]], + ['getdeviceid_7',['getDeviceId',['../class_comm_interface__modbus_r_t_u.html#acced18055fd7b7157e66155b1346d20f',1,'CommInterface_modbusRTU']]], + ['getelement_8',['getElement',['../class_content__stack.html#a5ac2a896da7724281d9d85eb239f5084',1,'Content_stack']]], + ['geterrorstate_9',['getErrorState',['../class_error_state.html#a55090bb1772cd8c20c936b5a9cf4f2ce',1,'ErrorState']]], ['getfunctioncode_10',['getFunctionCode',['../class_frame__modbus_r_t_u.html#a02b47ac99a90a57c64b17f291190b13d',1,'Frame_modbusRTU']]], - ['getnumberofservices_11',['getNumberOfServices',['../class_service_cluster_base.html#acbc08bddc57dbe90665216f5b2dedd35',1,'ServiceClusterBase::getNumberOfServices()'],['../class_service_cluster.html#a507a50d20b2764c77200a73971935971',1,'ServiceCluster::getNumberOfServices()']]], - ['getpdu_12',['getPDU',['../class_frame.html#abfe1ce91d1d7080940628ba6acdc7196',1,'Frame']]], + ['gethexstring_11',['getHexString',['../class_char_array.html#ab6ae6efb0622d58bd8ae2aa77cce6b00',1,'CharArray']]], + ['getnumberofservices_12',['getNumberOfServices',['../class_service_cluster_base.html#acbc08bddc57dbe90665216f5b2dedd35',1,'ServiceClusterBase::getNumberOfServices()'],['../class_service_cluster.html#a507a50d20b2764c77200a73971935971',1,'ServiceCluster::getNumberOfServices()']]], ['getpdu_5ffrom_5fservices_13',['getPDU_from_services',['../class_service_interface.html#ab4112c2b2eb29d1e0ade95e4f3c07030',1,'ServiceInterface']]], - ['getreceivedframe_14',['getReceivedFrame',['../class_comm_interface_base.html#a27a15e83d148ddd98d7116a225a3a30d',1,'CommInterfaceBase::getReceivedFrame()'],['../class_comm_interface.html#a446d6dfeb4dd695c061f1ff1c926fb51',1,'CommInterface::getReceivedFrame()']]], + ['getreceivedframe_14',['getReceivedFrame',['../class_comm_interface_base.html#a24de53b6a6f3150b9c2f904fbf872ef5',1,'CommInterfaceBase::getReceivedFrame()'],['../class_comm_interface.html#ab8f43fd2837a027c0008859567ced8de',1,'CommInterface::getReceivedFrame()']]], ['getservice_5fbyid_15',['getService_byID',['../class_service_cluster_base.html#ae025282a6ef15d01eaba440bdf73a750',1,'ServiceClusterBase::getService_byID()'],['../class_service_cluster.html#ae40a5207d621ccd428297ae8f3bbbf40',1,'ServiceCluster::getService_byID()']]], - ['getservice_5fbypos_16',['getService_byPos',['../class_service_cluster_base.html#a15023dc39ae2ceeb678d38f9bb51b172',1,'ServiceClusterBase::getService_byPos()'],['../class_service_cluster.html#a9e24f14fb13116a5f7bb7a551b8c5d22',1,'ServiceCluster::getService_byPos()']]] + ['getservice_5fbypos_16',['getService_byPos',['../class_service_cluster_base.html#a15023dc39ae2ceeb678d38f9bb51b172',1,'ServiceClusterBase::getService_byPos()'],['../class_service_cluster.html#a9e24f14fb13116a5f7bb7a551b8c5d22',1,'ServiceCluster::getService_byPos()']]], + ['getsize_17',['getSize',['../class_char_array.html#a384344479de289fff7c98966f0b079be',1,'CharArray']]] ]; diff --git a/docs/html/search/functions_9.js b/docs/html/search/functions_9.js index 1077397..fa435ad 100644 --- a/docs/html/search/functions_9.js +++ b/docs/html/search/functions_9.js @@ -1,4 +1,8 @@ var searchData= [ - ['operator_3d_0',['operator=',['../class_frame__modbus_r_t_u.html#af22baa4f3962f3f4e9d9d86c2155bc45',1,'Frame_modbusRTU']]] + ['operator_21_3d_0',['operator!=',['../class_char_array.html#ab801f84f8b8b84f089b8d574d9f0f7dd',1,'CharArray']]], + ['operator_2b_3d_1',['operator+=',['../class_char_array.html#af571946b68108c9cb95c6b046073227f',1,'CharArray']]], + ['operator_3d_2',['operator=',['../class_char_array.html#a5a3f1e26bd80a96b7cc36a5e0b984860',1,'CharArray::operator=(const CharArray &other)'],['../class_char_array.html#a065e4ef970ec3952d129d14c947400e1',1,'CharArray::operator=(const String &other)']]], + ['operator_3d_3d_3',['operator==',['../class_char_array.html#ad530feb6d6970e84df2056ef7b338da5',1,'CharArray']]], + ['operator_5b_5d_4',['operator[]',['../class_char_array.html#a388f6ed3f703102118c210c1a7c79ef6',1,'CharArray::operator[](size_t index)'],['../class_char_array.html#ae79eeb2b6c5b4fc80ffcd599e82239e6',1,'CharArray::operator[](size_t index) const']]] ]; diff --git a/docs/html/search/functions_c.js b/docs/html/search/functions_c.js index fb35f6c..b8f6427 100644 --- a/docs/html/search/functions_c.js +++ b/docs/html/search/functions_c.js @@ -3,7 +3,7 @@ var searchData= ['send_0',['send',['../class_comm_interface.html#a458e3da4ff47bdf6cc9f0a5f956c80dd',1,'CommInterface::send()'],['../class_comm_interface__modbus_r_t_u.html#a0e78a2a6e3b5b029609c2b16c21bd85b',1,'CommInterface_modbusRTU::send()']]], ['sendcycle_1',['sendCycle',['../class_comm_interface.html#a8670e37fdefcfeca579e99b6051fe3da',1,'CommInterface']]], ['sendmessage_2',['sendMessage',['../class_message_service.html#ac8e64d87d453ae6a6631891bdce42bef',1,'MessageService']]], - ['sendnewframe_3',['sendNewFrame',['../class_comm_interface_base.html#abc912fe242ac43255912b2f9bb9ee6fd',1,'CommInterfaceBase::sendNewFrame()'],['../class_comm_interface.html#a21c8ee8eddb3011e89b950f1b5264664',1,'CommInterface::sendNewFrame()']]], + ['sendnewframe_3',['sendNewFrame',['../class_comm_interface_base.html#afb11f519c50f1e5a7ec22bd5f253a2ce',1,'CommInterfaceBase::sendNewFrame()'],['../class_comm_interface.html#a3cf21e5181e56d234dbe9e52e6f2cb70',1,'CommInterface::sendNewFrame()']]], ['servicecluster_4',['ServiceCluster',['../class_service_cluster.html#a3fddf1a55492bf5438cd55bb9d4cc91f',1,'ServiceCluster']]], ['serviceinterface_5',['ServiceInterface',['../class_service_interface.html#acc70c85786fa2e133f90683f60ebf67f',1,'ServiceInterface']]], ['serviceinterface_5fmodbusrtu_6',['ServiceInterface_modbusRTU',['../class_service_interface__modbus_r_t_u.html#aa8ce2b3a043c2ed435c84e1b4a2c1cba',1,'ServiceInterface_modbusRTU']]], diff --git a/docs/html/search/functions_f.js b/docs/html/search/functions_f.js index 825f890..59ab2c2 100644 --- a/docs/html/search/functions_f.js +++ b/docs/html/search/functions_f.js @@ -1,14 +1,15 @@ var searchData= [ - ['_7ecomminterface_5fmodbusrtu_0',['~CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html#ae10bee9bfea696f21ab0732420f65241',1,'CommInterface_modbusRTU']]], - ['_7ecomminterfacebase_1',['~CommInterfaceBase',['../class_comm_interface_base.html#a04f23e3fad55bfe5d149e78ec5843388',1,'CommInterfaceBase']]], - ['_7econtent_5fstack_2',['~Content_stack',['../class_content__stack.html#a9f6ead53f4a1337740962f3e26134c02',1,'Content_stack']]], - ['_7eerror_3',['~Error',['../class_error.html#a1a45d42a3a035d510333cdfeb36a0e93',1,'Error']]], - ['_7eerrorstate_4',['~ErrorState',['../class_error_state.html#a1343b13a9feac276a1a26a523dfae1a5',1,'ErrorState']]], - ['_7eframe_5',['~Frame',['../class_frame.html#abec8c7bccdfc88cb4da137caae9f73d6',1,'Frame']]], - ['_7eframe_5fmodbusrtu_6',['~Frame_modbusRTU',['../class_frame__modbus_r_t_u.html#a981fc8dff661e9ac46ea378f17a28e9a',1,'Frame_modbusRTU']]], - ['_7emessage_7',['~Message',['../class_message.html#a3f7275462831f787a861271687bcad67',1,'Message']]], - ['_7eservicebase_8',['~ServiceBase',['../class_service_base.html#aa97f10faae142933b99784497f3aeb2e',1,'ServiceBase']]], - ['_7eserviceclusterbase_9',['~ServiceClusterBase',['../class_service_cluster_base.html#a8027755899da79046ec66cd5d1a34b6e',1,'ServiceClusterBase']]], - ['_7eserviceinterface_5fmodbusrtu_10',['~ServiceInterface_modbusRTU',['../class_service_interface__modbus_r_t_u.html#a23666158d2a1b544174587843bb95808',1,'ServiceInterface_modbusRTU']]] + ['_7echararray_0',['~CharArray',['../class_char_array.html#ae13f8ca8c3f0de90cb43edff3753199a',1,'CharArray']]], + ['_7ecomminterface_5fmodbusrtu_1',['~CommInterface_modbusRTU',['../class_comm_interface__modbus_r_t_u.html#ae10bee9bfea696f21ab0732420f65241',1,'CommInterface_modbusRTU']]], + ['_7ecomminterfacebase_2',['~CommInterfaceBase',['../class_comm_interface_base.html#a04f23e3fad55bfe5d149e78ec5843388',1,'CommInterfaceBase']]], + ['_7econtent_5fstack_3',['~Content_stack',['../class_content__stack.html#a9f6ead53f4a1337740962f3e26134c02',1,'Content_stack']]], + ['_7eerror_4',['~Error',['../class_error.html#a1a45d42a3a035d510333cdfeb36a0e93',1,'Error']]], + ['_7eerrorstate_5',['~ErrorState',['../class_error_state.html#a1343b13a9feac276a1a26a523dfae1a5',1,'ErrorState']]], + ['_7eframe_6',['~Frame',['../class_frame.html#abec8c7bccdfc88cb4da137caae9f73d6',1,'Frame']]], + ['_7eframe_5fmodbusrtu_7',['~Frame_modbusRTU',['../class_frame__modbus_r_t_u.html#a981fc8dff661e9ac46ea378f17a28e9a',1,'Frame_modbusRTU']]], + ['_7emessage_8',['~Message',['../class_message.html#a3f7275462831f787a861271687bcad67',1,'Message']]], + ['_7eservicebase_9',['~ServiceBase',['../class_service_base.html#aa97f10faae142933b99784497f3aeb2e',1,'ServiceBase']]], + ['_7eserviceclusterbase_10',['~ServiceClusterBase',['../class_service_cluster_base.html#a8027755899da79046ec66cd5d1a34b6e',1,'ServiceClusterBase']]], + ['_7eserviceinterface_5fmodbusrtu_11',['~ServiceInterface_modbusRTU',['../class_service_interface__modbus_r_t_u.html#a23666158d2a1b544174587843bb95808',1,'ServiceInterface_modbusRTU']]] ]; diff --git a/docs/html/search/searchdata.js b/docs/html/search/searchdata.js index 05e432c..c93c401 100644 --- a/docs/html/search/searchdata.js +++ b/docs/html/search/searchdata.js @@ -6,7 +6,7 @@ var indexSectionsWithContent = 3: "cefms", 4: "abcdefgimoprstw~", 5: "cimrs", - 6: "ps", + 6: "s", 7: "e", 8: "acfnsu", 9: "cfimops", diff --git a/docs/html/search/typedefs_0.js b/docs/html/search/typedefs_0.js index 2b314b0..e89e6c3 100644 --- a/docs/html/search/typedefs_0.js +++ b/docs/html/search/typedefs_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['pdustring_0',['pduString',['../_frame_8h.html#a482f50c6b69835c5a4abdd201a2d40df',1,'Frame.h']]] + ['string_0',['String',['../namespacearduino_mocking.html#a074bce778184555fd29d1370a36298bf',1,'arduinoMocking']]] ]; diff --git a/docs/html/search/variables_3.js b/docs/html/search/variables_3.js index beafe32..aef6afe 100644 --- a/docs/html/search/variables_3.js +++ b/docs/html/search/variables_3.js @@ -1,8 +1,8 @@ var searchData= [ - ['receivebuffer_0',['receiveBuffer',['../class_comm_interface.html#aa2cedf4d8d25ab2a0a04278c976383d9',1,'CommInterface']]], + ['receivebuffer_0',['receiveBuffer',['../class_comm_interface.html#a16f63bbe5fbe3e4b328ac4bf9727eebf',1,'CommInterface']]], ['receiver_5fid_1',['receiver_id',['../struct_message__content__t.html#a0c1e2ca71214ff401635a9cd21c65cee',1,'Message_content_t']]], - ['recitem_2',['recItem',['../class_service_interface.html#ac69502c2d78c4a046c5d3219d637f1b3',1,'ServiceInterface']]], + ['recitem_2',['recItem',['../class_service_interface.html#a5564df6dabbaab51556a9dffe37b2444',1,'ServiceInterface']]], ['recstack_3',['recStack',['../class_service_interface.html#a7793efd070a56f021ce56a372b13c2fa',1,'ServiceInterface']]], ['representation_4',['representation',['../class_content.html#aa667f2d6f2ec335fb5ac1204f4cdc0b8',1,'Content']]] ]; diff --git a/docs/html/search/variables_4.js b/docs/html/search/variables_4.js index 8a81f14..55f71ee 100644 --- a/docs/html/search/variables_4.js +++ b/docs/html/search/variables_4.js @@ -1,8 +1,8 @@ var searchData= [ - ['sendbuffer_0',['sendBuffer',['../class_comm_interface.html#a158b6fec22811cd97732ca9bada05873',1,'CommInterface']]], + ['sendbuffer_0',['sendBuffer',['../class_comm_interface.html#a129b3eda32cb5a57087e87c612423589',1,'CommInterface']]], ['sender_5fid_1',['sender_id',['../struct_message__content__t.html#ad18914f4dbe4131a1cb38cedbdb3069a',1,'Message_content_t']]], - ['senditem_2',['sendItem',['../class_service_interface.html#a1e08cf764cea2084e1f425e32f44d2c1',1,'ServiceInterface']]], + ['senditem_2',['sendItem',['../class_service_interface.html#ae4aa045a41f0040cacbc20d9dccc3db7',1,'ServiceInterface']]], ['sendstack_3',['sendStack',['../class_service_interface.html#a38bd169d6286c4ddbda050b7f28d093a',1,'ServiceInterface']]], ['serial_4',['Serial',['../namespacearduino_mocking.html#ace877ffb508b19b20cbc06b8f9837359',1,'arduinoMocking']]], ['services_5',['services',['../class_service_interface.html#ad1f915c1a536af5c73aa1315fd035535',1,'ServiceInterface']]] diff --git a/lib/Frame/CharArray.cpp b/lib/Frame/CharArray.cpp new file mode 100644 index 0000000..22e9eb6 --- /dev/null +++ b/lib/Frame/CharArray.cpp @@ -0,0 +1,246 @@ +/** + * @file CharArray.cpp + * @author Felix Schuelke (flxscode@gmail.com) + * @brief + * @version 0.1 + * @date 2024-08-18 + * + * @copyright * Copyright (C) 2024 Felix Schuelke + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include "CharArray.h" + +/** + * @brief Construct a new empty Char Array object (0 byte) + * + */ +CharArray::CharArray() : data(nullptr), size(0) {} + +/** + * @brief Destroy the Char Array object + * + */ +CharArray::~CharArray() { + if (data != nullptr) delete[] data; +} + +/** + * @brief constructor for Arduino-String + * + * Initializes a new CharArray object with the content of the String-object. + * + * @param other The String-Object + */ +CharArray::CharArray(const String& str) { + size_t new_size = str.length(); + extendArray(new_size); + strcpy(data, str.c_str()); +} + +/** + * @brief Copy constructor. + * + * Initializes a new CharArray object as a copy of another CharArray object. + * + * @param other The other CharArray object to copy. + * + * @details This constructor performs a deep copy of all the data from `other`, + * ensuring that the new object is an exact copy of the source object. + */ +CharArray::CharArray(const CharArray& other) : size(other.size) { + data = new char[size]; + memcpy(data, other.data, size); +} + +/** + * @brief Assignment operator + * + * This operator assigns the values from another object of the same type to the current object. + * + * @param other The other CharArray object whose values will be assigned. + * @return A reference to the current object after assignment. + * + * @details This operator performs a deep copy of the data from `other`, ensuring that the current object + * becomes an exact copy of `other`. + */ +CharArray& CharArray::operator=(const CharArray& other) { + if (this != &other) { + delete[] data; + size = other.size; + data = new char[size]; + memcpy(data, other.data, size); + } + return *this; +} + +/** + * @brief Assignment operator for String-assignment + * + * This operator assigns the values from a String-object to the current object. + * + * @param other The String object whose values will be assigned. + * @return A reference to the current object after assignment. + * + */ +CharArray& CharArray::operator=(const String& str) { + size_t new_size = str.length(); + extendArray(new_size); + strcpy(data, str.c_str()); + return *this; +} + + +/** + * @brief Read-Access the element at the specified index. + * + * Returns a reference to the element at the given index in the char array. + * If the index is out of bounds, a refernce to a dummy nullterminator will be returned. + * + * @param index The index of the element to access. + * @return char& A reference to the element at the specified index. + */ +const char& CharArray::operator[](size_t index) const { + static char dummy = '\0'; + if (index >= size) { + return dummy; + } + return data[index]; +} + +/** + * @brief Write-Access the element at the specified index. + * + * Returns a reference to the element at the given index in the char array. + * If the index is out of bounds, a the array will be extended. + * + * @param index The index of the element to access. + * @return char& A reference to the element at the specified index. + */ +char& CharArray::operator[](size_t index){ + if (index >= size) { + extendArray(index+1); + } + return data[index]; +} + +/** + * @brief += Operator to append a single character + * + * @param c char to append + * @return CharArray& + */ +CharArray& CharArray::operator+=(char c) { + // Allocate a new array with one extra space + extendArray(size +1); + // add c on last index + data[size - 1] = c; + // Return the current object to allow chaining + return *this; +} + +/** + * @brief resizes the array to store more items + * + * @param extendedSize new size for array + * @return char* Pointer to the extended heap-memory + */ +void CharArray::extendArray(size_t extendedSize){ + // Allocate a new array extended space + char* newData = new char[extendedSize]; + // Copy existing data to new array + for (size_t i = 0; i < size; i++) { + newData[i] = data[i]; + } + // update the size + size = extendedSize; + // Delete old array + delete[] data; + data = newData; +} + +/** + * @brief Equality Operator + * + * @param other + * @return bool + */ +bool CharArray::operator==(const CharArray& other) const { + // Check if sizes are the same + if (size != other.size) { + return false; + } + + // Check each element for equality + for (size_t i = 0; i < size; i++) { + if (data[i] != other.data[i]) { + return false; + } + } + + return true; +} + +/** + * @brief Inequality Operator + * + * @param other + * @return bool + */ +bool CharArray::operator!=(const CharArray& other) const { + return !(*this == other); +} + +/** + * @brief Retrieves the size of the char array. + * + * Returns the number of elements in the char array. + * + * @return size_t The size of the char array. + */ +size_t CharArray::getSize() const { + return size; +} + +/** + * @brief Provides direct access to the internal char array. + * + * Returns a pointer to the internal char array. This allows direct manipulation + * of the data stored in the array. + * + * @return char* A pointer to the internal char array. + */ +const char* CharArray::getData() const { + return data; +} + +String CharArray::getHexString(){ + String hexRepresentation = ""; + + // iterate through the array + for (int i = 0; i < size; i++) { + hexRepresentation += "0x"; + + // transform the byte to hex + char hexCharBuffer[3]; + sprintf(hexCharBuffer, "%02X", (unsigned char)data[i]); + hexRepresentation += String(hexCharBuffer); + + // append space + if (i!=size-1) hexRepresentation += " "; + } + return hexRepresentation; +} + diff --git a/lib/Frame/CharArray.h b/lib/Frame/CharArray.h new file mode 100644 index 0000000..318f0ad --- /dev/null +++ b/lib/Frame/CharArray.h @@ -0,0 +1,190 @@ +/** + * @file CharArray.h + * @author Felix Schuelke (flxscode@gmail.com) + * @brief + * @version 0.1 + * @date 2024-08-18 + * + * @copyright * Copyright (C) 2024 Felix Schuelke + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#ifndef CHARARRAY_H +#define CHARARRAY_H + +#ifdef ARDUINO + #include // include Arduino-Library for platformIO-build +#else + #include + using namespace arduinoMocking; +#endif + +/** + * @brief Class for storing char-array (byte-array) together with size. The Array is stored on Heap-memory + * and is extended by adding bytes with "+=" or by write-access to an index larger than the current size. + */ +class CharArray { +private: + /// @brief pointer to first array-byte to the data stored on heap-memory + char* data; + + /// @brief number of byte stored + size_t size; + + /** + * @brief extends the size of the array to store more items, return + * + * @param extendedSize new size for array + * @return char* Pointer to the extended heap-memory + */ + void extendArray(size_t extendedSize); + +public: + /** + * @brief Construct a new empty Char Array object (0 byte) + * + */ + CharArray(); + + + /** + * @brief Destroy the Char Array object + * + */ + ~CharArray(); + + /** + * @brief constructor for Arduino-String + * + * Initializes a new CharArray object with the content of the String-object. + * + * @param other The String-Object + */ + CharArray(const String& str); + + /** + * @brief Copy constructor. + * + * Initializes a new CharArray object as a copy of another CharArray object. + * + * @param other The other CharArray object to copy. + * + * @details This constructor performs a deep copy of all the data from `other`, + * ensuring that the new object is an exact copy of the source object. + */ + CharArray(const CharArray& other); + + /** + * @brief Assignment operator. + * + * This operator assigns the values from another object of the same type to the current object. + * + * @param other The other CharArray object whose values will be assigned. + * @return A reference to the current object after assignment. + * + * @details This operator performs a deep copy of the data from `other`, ensuring that the current object + * becomes an exact copy of `other`. + */ + CharArray& operator=(const CharArray& other); + + /** + * @brief Assignment operator for String-assignment + * + * This operator assigns the values from a String-object to the current object. + * + * @param other The String object whose values will be assigned. + * @return A reference to the current object after assignment. + * + */ + CharArray& operator=(const String& other); + + /** + * @brief Write-Access the element at the specified index. + * + * Returns a reference to the element at the given index in the char array. + * If the index is out of bounds, a the array will be extended. + * + * @param index The index of the element to access. + * @return char& A reference to the element at the specified index. + */ + char& operator[](size_t index); + + /** + * @brief Read-Access the element at the specified index. + * + * Returns a reference to the element at the given index in the char array. + * If the index is out of bounds, a refernce to a dummy nullterminator will be returned. + * + * @param index The index of the element to access. + * @return char& A reference to the element at the specified index. + */ + const char& operator[](size_t index) const; + + + /** + * @brief += Operator to append a single character + * + * @param c char to append + * @return CharArray& + */ + CharArray& operator+=(char c); + + /** + * @brief Equality Operator + * + * @param other + * @return bool + */ + bool operator==(const CharArray& other) const; + + /** + * @brief Inequality Operator + * + * @param other + * @return bool + */ + bool operator!=(const CharArray& other) const; + + + /** + * @brief Retrieves the size of the char array. + * + * Returns the number of elements in the char array. + * + * @return size_t The size of the char array. + */ + size_t getSize() const; + + /** + * @brief Provides direct access to the internal char array. + * + * Returns a pointer to the internal char array. This allows direct manipulation + * of the data stored in the array. + * + * @return char* A pointer to the internal char array. + */ + const char* getData() const; + + /** + * @brief Get the Hex-Values of the Array as a String + * + * @return String + */ + String getHexString(); +}; + + + +#endif // CHARARRAY_H diff --git a/lib/Frame/Frame.cpp b/lib/Frame/Frame.cpp index 11b26c8..58e5742 100644 --- a/lib/Frame/Frame.cpp +++ b/lib/Frame/Frame.cpp @@ -25,25 +25,13 @@ #include "Frame.h" // Default Constructor -Frame::Frame() : Content(frameString()) {} +Frame::Frame() : Content(CharArray()) {} // Constructor for creating Frame from PDU -Frame::Frame(pduString* pdu) : Content(*pdu) {} +Frame::Frame(String* pdu) : Content(*pdu) {} // Constructor for creating Frame-Object from byte-frame -Frame::Frame(frameString* frame) : Content(*frame) {} +Frame::Frame(CharArray* frame) : Content(*frame) {} // Destructor -Frame::~Frame() {} - -// Get string-formatted PDU (Content) from Frame-Object -String Frame::getPDU(){ - pduString p = *get_content(); - return String(p); -} - -// Get string formatted byte-Frame (Representation) from Frame-Object -String Frame::getFrame(){ - frameString* str = get_representation(); - return String(*str); -} \ No newline at end of file +Frame::~Frame() {} \ No newline at end of file diff --git a/lib/Frame/Frame.h b/lib/Frame/Frame.h index db2a1b0..ec664a7 100644 --- a/lib/Frame/Frame.h +++ b/lib/Frame/Frame.h @@ -31,12 +31,7 @@ #endif #include - -/** Typedefinitions for Constructor-parameters of the Frame-class - * necessary to distinguish between construction from PDU (Content) or from byte-frame (Representation) -*/ -using pduString = String; -using frameString = const char*; +#include /** * @author Felix Schuelke (flxscode@gmail.com) @@ -49,10 +44,10 @@ The derived classes define: In the abstract concept of "Content" the byte-Frame itself is interpreted as the Content-Representation The "Content"-Object represents the PDU transmitted to the services * - * @tparam pduString type-definition for a String-Object containing the Payload of the frame ("Content") - * @tparam frameString type-definition for a const-char-pointer pointing to the byte-formatted frame + * @tparam String: type of Payload of the frame ("Content") + * @tparam CharArray: type of byte-formatted frame ("Representation") */ -class Frame: public Content{ +class Frame: public Content{ public: /** * @brief Construct a new empty Frame object @@ -69,29 +64,15 @@ class Frame: public Content{ /** * @brief Constructor for creating Frame-instance from pdu (Content) * - * @param pdu pointer to pduString containing the payload of the frame + * @param pdu pointer to String containing the payload of the frame */ - Frame(pduString* pdu); + Frame(String* pdu); /** * @brief Constructor for creating Frame-Object from byte-frame (Representation) * - * @param frame pointer to frameString containing the byte-frame (Representation) of the frame - */ - Frame(frameString* frame); - - /** - * @brief get the pdu (Content) as String from the frame-object - * - * @return String with frame-payload - */ - String getPDU(); - - /** - * @brief Get the byte-frame (Representation) as String from the frame-object - * - * @return String with byte-frame (Representation) + * @param frame pointer to the char-array-object containing the byte-representation */ - String getFrame(); + Frame(CharArray* frame); }; #endif // FRAME_H \ No newline at end of file diff --git a/lib/Interface/CommInterface.h b/lib/Interface/CommInterface.h index a3f4b2b..b4c0dae 100644 --- a/lib/Interface/CommInterface.h +++ b/lib/Interface/CommInterface.h @@ -31,7 +31,7 @@ using namespace arduinoMocking; #endif -#include +#include #include /** @@ -62,9 +62,9 @@ class CommInterfaceBase: public ErrorState /** * @brief Add a new Frame to the send-buffer * - * @param sendFrame Pointer to String-Object with frame to be send next + * @param sendFrame Pointer to CharArray-Object with frame to be send next */ - virtual void sendNewFrame(String* sendFrame){}; + virtual void sendNewFrame(CharArray* sendFrame){}; /** * @brief Check, if the Frame was sent and the CommInterface is ready to send the next Frame @@ -77,15 +77,15 @@ class CommInterfaceBase: public ErrorState /** * @brief Define the destination, the next received Frame should be copied to ba a pointer to an empty String-Object * - * @param destFrameBuffer pointer to an empty String-Object, the next received frame should be stored in + * @param destFrameBuffer pointer to an empty CharArray-Object, the next received frame should be stored in */ - virtual void getReceivedFrame(String* destFrameBuffer){}; + virtual void getReceivedFrame(CharArray* destFrameBuffer){}; /** * @brief Check, if a new Frame was received * - * @return true a new frame was received and stored on the with getReceivedFrame specified String-Object - * @return false no new frame was received, getReceivedFrame specified String-Object still empty + * @return true a new frame was received and stored on the with getReceivedFrame specified Frame-Object + * @return false no new frame was received, getReceivedFrame specified Frame-Object still empty */ virtual bool receivedNewFrame(){}; @@ -126,13 +126,10 @@ class CommInterface: public CommInterfaceBase{ interface_type* interface; /// @brief pointer to the next frame to be send, set to nullptr if Frame was sent - String* sendBuffer = nullptr; + CharArray* sendBuffer = nullptr; - /// @brief pointer to String-object, a received frame should be stored at, set to nullptr if Frame was copied to destination - String* receiveBuffer = nullptr; - - // Send a Frame - // True, if a frame was send successfully + /// @brief pointer to CharArray-object, a received frame should be stored at, set to nullptr if Frame was copied to destination + CharArray* receiveBuffer = nullptr; /** * @brief Send the frame, sendBuffer is pointing to @@ -166,9 +163,9 @@ class CommInterface: public CommInterfaceBase{ * @brief Specify the next frame to be sent by the interface, * no overwrite, if the sendBuffer is already pointing to another frame * - * @param sendFrame String-pointer to next frame to be send + * @param sendFrame pointer to next Frame-object to be send */ - void sendNewFrame(String* sendFrame){ + void sendNewFrame(CharArray* sendFrame){ if (sendBuffer == nullptr) { sendBuffer = sendFrame; // set the send-buffer-ptr to the Frame, that has to be sent @@ -190,10 +187,10 @@ class CommInterface: public CommInterfaceBase{ /** * @brief Define the destination, the next received Frame should be stored at * - * @param destFrameBuffer pointer to String-object, the next received Frame should be stored at + * @param externalRecBuffer pointer to CharArray-object, the next received Frame should be stored at */ - void getReceivedFrame(String* destFrameBuffer){ - receiveBuffer = destFrameBuffer; // set the receive-buffer-ptr to the destination, the next received Frame should be stored at + void getReceivedFrame(CharArray* externalRecBuffer){ + receiveBuffer = externalRecBuffer; // set the receive-buffer-ptr to the destination, the next received Frame should be stored at }; /** diff --git a/lib/Interface/ServiceInterface.h b/lib/Interface/ServiceInterface.h index d275c80..cd9831e 100644 --- a/lib/Interface/ServiceInterface.h +++ b/lib/Interface/ServiceInterface.h @@ -89,10 +89,10 @@ class ServiceInterface: public ErrorState{ Content_stack sendStack; /// @brief Item to be sent next - String sendItem; + CharArray sendItem; /// @brief Item received last - String recItem; + CharArray recItem; /** * @brief Add all PDUs provided by the services to the sendstack, @@ -159,14 +159,13 @@ class ServiceInterface: public ErrorState{ while (!sendStack.empty()) { if (comm_interface->finishedSending()){ - Frame* frameToSend = sendStack.getElement(); // Get next item from the send-stack - sendItem = frameToSend->getFrame(); // Extract Frame from Item - String* sendItemAdr = &sendItem; - comm_interface->sendNewFrame(sendItemAdr); // Impart Frame that has to be sent next - sendStack.deleteElement(); // delete Item from send-stack - comm_interface->sendCycle(); // execute sending + Frame* frameToSend = sendStack.getElement(); // Get next item from the send-stack + sendItem = *frameToSend->get_representation(); // buffer Frame as char-array + comm_interface->sendNewFrame(&sendItem); // Impart Frame that has to be sent next to the CommInterface + sendStack.deleteElement(); // delete Item from send-stack + comm_interface->sendCycle(); // execute sending }else{ - comm_interface->sendCycle(); // execute sending + comm_interface->sendCycle(); // execute sending }; // check the commInterfaces ErrorState @@ -196,14 +195,13 @@ class ServiceInterface: public ErrorState{ #endif // Handle receivebuffer while (comm_interface->receivedNewFrame() && !recStack.full()){ - if (recItem != ""){ // Item not empty - frameString frameStr = recItem.c_str(); // conversion for identification as framestring in Frame-Class-Constructor - frameType recItemFrame(&frameStr); // Construct Frame-Class derived Object (nullptr if failed) + if (recItem.getSize() != 0){ // Item not empty + frameType recItemFrame(&recItem); // Construct Frame-Class derived Object (nullptr if failed) if (recItemFrame.isValid()){ recStack.addElement(recItemFrame); // Add the received element to the stack }else{ raiseError(framingError);} // frame-construction failed - recItem = ""; // Clear rec-Item + recItem = CharArray(); // Clear rec-Item } // check the commInterfaces ErrorState diff --git a/lib/MessageService/MessageService.cpp b/lib/MessageService/MessageService.cpp index da66700..2f21e51 100644 --- a/lib/MessageService/MessageService.cpp +++ b/lib/MessageService/MessageService.cpp @@ -45,8 +45,7 @@ void MessageService::stackProcessing() { printMessage(last_msg); // Ack the received Message - sendAck(last_msg); - + if (!(last_msg->get_content()->msg_text=="ACK")) sendAck(last_msg); // delete the element the response was generated for rec_stack.deleteElement(0); }; diff --git a/lib/ModbusRTU/CommInterface_modbusRTU.cpp b/lib/ModbusRTU/CommInterface_modbusRTU.cpp index 7ed3eac..8a75782 100644 --- a/lib/ModbusRTU/CommInterface_modbusRTU.cpp +++ b/lib/ModbusRTU/CommInterface_modbusRTU.cpp @@ -35,20 +35,10 @@ CommInterface_modbusRTU::~CommInterface_modbusRTU() { } // Sending -bool CommInterface_modbusRTU::send(){ - // Serial debugging - #ifdef DEBUG - Serial.println("Interface started sending:"); - #endif - - if (sendBuffer==nullptr) return false; // check, if the sendbuffer-ptr is set to a valid memory - interface->write(sendBuffer->c_str(), sendBuffer->length()); // write the byte-converted string to the interface - interface->flush(); // ensure, interfaces sending-buffer is completely empty before returning - - // Serial debugging - #ifdef DEBUG - Serial.println(*sendBuffer); - #endif +bool CommInterface_modbusRTU::send(){ + if (sendBuffer==nullptr) return false; // check, if the sendbuffer-ptr is set to a valid memory + interface->write(sendBuffer->getData(), sendBuffer->getSize()); // write the byte-converted string to the interface + interface->flush(); // ensure, interfaces sending-buffer is completely empty before returning return true; }; @@ -57,10 +47,6 @@ bool CommInterface_modbusRTU::send(){ // after a frame was received within the receive-timeout, the function returns true // the Comm-Interfece is not checking any Content of the frame bool CommInterface_modbusRTU::receive(){ - // Serial debugging - #ifdef DEBUG - Serial.println("Interface is receiving..."); - #endif unsigned long startTime = micros(); // Time, the function gets called uint16_t numBytes = 0; // Received number of bytes bool receivingFlag = (deviceId == '\0') ? true:false; // interface started receiving a frame (Slavemode: only if adressed to the device-ID, Mastermode: each frame) @@ -68,10 +54,6 @@ bool CommInterface_modbusRTU::receive(){ // Wait for a relevant Frame while (!interface->available()) { if (micros() - startTime >= _recTimeout) { - // Serial debugging - #ifdef DEBUG - Serial.println("Timeout: No Frame received in specified timespan..."); - #endif return false; // No Frame received in specified timespan } } @@ -79,39 +61,36 @@ bool CommInterface_modbusRTU::receive(){ startTime = micros(); // redefine the time for measuring timeouts // Receive a relevant frame as long as timeout and frame length are ok + bool appendNullByte = false; while (numBytes < MAXFRAMESIZE) { // check if the char in buffer is the device-ID or receiving started already if (interface->available() && (receivingFlag || (deviceId==interface->peek()))) { - receivingFlag = true; // Set the receive-flag - startTime = micros(); // redefine the time for measuring timeouts - *receiveBuffer+= char(interface->read()); // Write the received char to the specified buffer - numBytes++; // increase frame-length-counter - }else if(micros() - startTime >= _charTimeout) break; // if no char is received, wait for timeout + receivingFlag = true; // Set the receive-flag + startTime = micros(); // redefine the time for measuring timeouts + + // Append a nullbyte + if (appendNullByte){ + *receiveBuffer+= '\0'; + appendNullByte = false;} + + *receiveBuffer+= char(interface->read()); // Write the received char to the specified buffer + numBytes++; // increase frame-length-counter + } + // if no char is received, wait for timeout + else if(micros() - startTime >= _charTimeout) break; + // detect nullbyte if the next char is received below charTimeout + else if (micros() - startTime >= _nullByteSilenece) appendNullByte = true; }; // wait for Frame-timeout to ensure frame is complete, raise Error, if the silence-time is violated - if((_clearRxBuffer()>0) & (*receiveBuffer!="")){ + if((_clearRxBuffer()>0) & (receiveBuffer->getSize()!=0)){ (numBytes>=MAXFRAMESIZE) ? raiseError(frameLengthError):raiseError(arbitrationError); } // handle the Arbitration-Error with waiting for bus-silence if(getErrorState()==arbitrationError) while(_clearRxBuffer()!=0); - // Serial debugging - #ifdef DEBUG - Serial.print("Received "); - Serial.print(numBytes); - Serial.println("bytes:"); - Serial.print(*receiveBuffer); - Serial.print("\n"); - #endif - - // Serial debugging - #ifdef DEBUG - Serial.println("Interface has stopped receiving..."); - #endif - // Frame received and written to specified rec-buffer return true; }; @@ -134,6 +113,9 @@ size_t CommInterface_modbusRTU::_clearRxBuffer() { void CommInterface_modbusRTU::_calculateTimeouts(uint16_t baudrate) { uint8_t bitsPerChar = 11; // Bits per character defined in specification uint16_t timePerChar = (bitsPerChar * 1000000) / baudrate; + // Silence-time for nullbyte on bus + _nullByteSilenece = timePerChar *0.9; + // Char- and frametimeout if (baudrate <= 19200) { // Set charTimeout to 1.5 times the time to send one character _charTimeout = timePerChar * 1.5; diff --git a/lib/ModbusRTU/CommInterface_modbusRTU.h b/lib/ModbusRTU/CommInterface_modbusRTU.h index 5a60f6f..03fb52f 100644 --- a/lib/ModbusRTU/CommInterface_modbusRTU.h +++ b/lib/ModbusRTU/CommInterface_modbusRTU.h @@ -36,7 +36,7 @@ #include -/// @brief debugging flag to prit debugging-information on Serial +/// @brief debugging flag to print debugging-information on Serial //#define DEBUG /// @brief maximum number of Bytes a frame can contain @@ -119,6 +119,9 @@ class CommInterface_modbusRTU: public CommInterface{ /// @brief time to wait for response during the receive-cycle [microseconds] unsigned long _recTimeout = 1000000; + /// @brief Silenecetime for nullbyte between two chars (between 0.9 * time per char and char-timeout) + unsigned long _nullByteSilenece; + /** * @brief Calculate all timeouts based on the specified baudrate * diff --git a/lib/ModbusRTU/Frame_modbusRTU.cpp b/lib/ModbusRTU/Frame_modbusRTU.cpp index 0ab68ee..1653d8a 100644 --- a/lib/ModbusRTU/Frame_modbusRTU.cpp +++ b/lib/ModbusRTU/Frame_modbusRTU.cpp @@ -24,15 +24,14 @@ #include "Frame_modbusRTU.h" // Construct Modbus-RRU-Frame from given PDU (Content) -Frame_modbusRTU::Frame_modbusRTU(pduString* pdu, char* slaveId, char* functionCode) : +Frame_modbusRTU::Frame_modbusRTU(String* pdu, char* slaveId, char* functionCode) : Frame(pdu), slaveId(*slaveId), functionCode(*functionCode) { content_to_rep(); }; // Construct Modbus-RTU-Frame from given Byte-Frame (Representation) -Frame_modbusRTU::Frame_modbusRTU(frameString* frame) : +Frame_modbusRTU::Frame_modbusRTU(CharArray* frame) : Frame(frame) { - copy_to_heap(&representation); rep_to_content(); }; @@ -44,44 +43,35 @@ Frame_modbusRTU::Frame_modbusRTU() : // Deconstructor Frame_modbusRTU::~Frame_modbusRTU(){ - if (buffer!=nullptr) delete[] buffer; - buffer = nullptr; }; // Convert the given Content (PDU) to Representation (Frame) void Frame_modbusRTU::content_to_rep(){ size_t pduLength = content.length(); // get the length of the Content (PDU) - size_t buffersize = PREFIXSIZE+SUFFIXSIZE+pduLength + 1; // Calculate the necessary size for the buffer + null-termination - delete[] buffer; - buffer = new char[buffersize]; // Create representation-buffer - + // Prefix - buffer[0] = slaveId; // Byte 0: Slave-Address - buffer[1] = functionCode; // Byte 1: Modbus-RTU function-code + representation[0] = slaveId; // Byte 0: Slave-Address + representation[1] = functionCode; // Byte 1: Modbus-RTU function-code // Content for (size_t i = 0; i < pduLength; ++i) { - buffer[i+PREFIXSIZE] = content[i]; // Byte 2 to end of PDU: Content (PDU) + representation[i+PREFIXSIZE] = content[i]; // Byte 2 to end of PDU: Content (PDU) } // CRC - uint16_t crc = calcCRC16(buffer, pduLength+PREFIXSIZE); - buffer[pduLength + PREFIXSIZE] = crc & 0xFF; // Last 2 Bytes: Append CRC (Little Endian: Low Byte first, then High Byte) - buffer[pduLength + PREFIXSIZE + 1] = (crc >> 8) & 0xFF; - - // Null terminator - buffer[buffersize] = '\0'; // Append null-termination to the buffer - representation = buffer; // Set representation to point to the buffer + uint16_t crc = calcCRC16(representation.getData(), pduLength+PREFIXSIZE); + representation[pduLength + PREFIXSIZE] = crc & 0xFF; // Last 2 Bytes: Append CRC (Little Endian: Low Byte first, then High Byte) + representation[pduLength + PREFIXSIZE + 1] = (crc >> 8) & 0xFF; }; // Convert the given Representation (Frame) to Content (PDU) // leaves Content empty, if Frames is shorter than expected void Frame_modbusRTU::rep_to_content(){ - size_t len = strlen(representation); // Get the length of the representation (frame) - if (len > (PREFIXSIZE + SUFFIXSIZE)) + // Framesize is has payload + if (representation.getSize() > (PREFIXSIZE + SUFFIXSIZE)) { // PDU (Content) - for (size_t i = PREFIXSIZE; i < len-SUFFIXSIZE; ++i) { + for (size_t i = PREFIXSIZE; i < representation.getSize()-SUFFIXSIZE; ++i) { content += representation[i]; // Write PDU from representation (frame) to Content } @@ -98,22 +88,8 @@ char Frame_modbusRTU::getFunctionCode(){ return functionCode; }; - -// Copy the representation pointing to an outside defined char-array to heap-memory -// has to be called to ensure, that destructor is deleting from heap and not from stack -void Frame_modbusRTU::copy_to_heap(const char** str_ptr) { - size_t len = strlen(*str_ptr); // Get the length of the referenced string - delete[] buffer; - buffer = new char[len+1]; // create new char-array on heap - for (size_t i = 0; i < len; ++i) { - buffer[i] = (*str_ptr)[i]; // copy each character to heap - } - buffer[len] = '\0'; // ensure null-termination - *str_ptr = buffer; // set the reference to the created char-array on heap-memory - }; - // Calculate the CRC16-value of the given buffer -unsigned short Frame_modbusRTU::calcCRC16(char* crcBuffer, uint8_t size){ +unsigned short Frame_modbusRTU::calcCRC16(const char* crcBuffer, uint8_t size){ unsigned short crc16 = CRC16VALUE; for (int i = 0; i < size; i++) { crc16 ^= static_cast(crcBuffer[i]); @@ -128,43 +104,8 @@ unsigned short Frame_modbusRTU::calcCRC16(char* crcBuffer, uint8_t size){ return crc16; }; -// Check the CRC16-value for the given buffer +// Check the CRC16-value of the frame bool Frame_modbusRTU::checkCRC16(){ - uint8_t size = strlen(representation); // Get the length of the representation - char* crcBuffer = new char[size]; - memcpy(crcBuffer, representation, size); // copy representation + null-termination to temp-buffer - bool result = calcCRC16(crcBuffer, size) == 0; // if rest is 0 crc was correct - delete[] crcBuffer; - return result; + // if rest is 0 crc was correct + return calcCRC16(representation.getData(), representation.getSize()) == 0; }; - -// Copy constructor -Frame_modbusRTU::Frame_modbusRTU(const Frame_modbusRTU& other) : Frame(other) { - // Copy the derived-class-specific attributes - slaveId = other.slaveId; - functionCode = other.functionCode; - Frame::operator=(other); // Call base class assignment operator - - // Copy dynamically allocated memory - if (!buffer) buffer = new char[1]; // initialize buffer - copy_to_heap(&representation); // copy buffer from assigned instance and re-allocate representation-ptr to prevent double-free - -} - -// Assignment operator -Frame_modbusRTU& Frame_modbusRTU::operator=(const Frame_modbusRTU& other) { - if (this == &other) { - return *this; // handle self-assignment - } - - // Copy the derived-class-specific attributes - slaveId = other.slaveId; - functionCode = other.functionCode; - Frame::operator=(other); // Call base class assignment operator - - // Copy dynamically allocated memory - if (!buffer) buffer = new char[1]; // initialize buffer - copy_to_heap(&representation); // copy buffer from assigned instance and re-allocate representation-ptr to prevent double-free - - return *this; -} \ No newline at end of file diff --git a/lib/ModbusRTU/Frame_modbusRTU.h b/lib/ModbusRTU/Frame_modbusRTU.h index 1a8da6a..81fad8f 100644 --- a/lib/ModbusRTU/Frame_modbusRTU.h +++ b/lib/ModbusRTU/Frame_modbusRTU.h @@ -69,7 +69,7 @@ class Frame_modbusRTU: public Frame{ * @param slaveId * @param functionCode */ - Frame_modbusRTU(pduString* pdu, char* slaveId, char* functionCode); + Frame_modbusRTU(String* pdu, char* slaveId, char* functionCode); /** * @brief Construct Modbus-RTU-Frame from given Byte-Frame (Representation). Copy the representation, the argument is pointing to, @@ -78,7 +78,7 @@ class Frame_modbusRTU: public Frame{ * * @param frame const char** to a modbus-rtu-frame to construct the Frame-object from */ - Frame_modbusRTU(frameString* frame); + Frame_modbusRTU(CharArray* frame); /** * @brief Construct empty Modbus-RTU-Frame @@ -92,30 +92,6 @@ class Frame_modbusRTU: public Frame{ */ ~Frame_modbusRTU(); - /** - * @brief Copy constructor. - * - * Initializes a new Frame_modbusRTU object as a copy of another Frame_modbusRTU object. - * - * @param other The other Frame_modbusRTU object to copy. - * - * @details This constructor performs a deep copy of all the data from `other`, - * ensuring that the new object is an exact copy of the source object. - */ - Frame_modbusRTU(const Frame_modbusRTU& other); - - /** - * @brief Assignment operator. - * - * This operator assigns the values from another object of the same type to the current object. - * - * @param other The other Frame_modbusRTU object whose values will be assigned. - * @return A reference to the current object after assignment. - * - * @details This operator performs a deep copy of the data from `other`, ensuring that the current object - * becomes an exact copy of `other`. - */ - Frame_modbusRTU& operator=(const Frame_modbusRTU& other); /** * @brief Verifies the CRC16 checksum of the current Modbus RTU frame. @@ -145,9 +121,6 @@ class Frame_modbusRTU: public Frame{ /// @brief Modbus-RTU-function-code char functionCode = '\0'; - /// @brief buffer for allocating heap-memory of dynamic length to the frames-representation - char* buffer = new char[1]; - /** * @brief Converts the given Content (PDU) to the Modbus RTU frame representation. * @@ -193,26 +166,7 @@ class Frame_modbusRTU: public Frame{ * mask during the calculation. The function iterates over each byte in the buffer, updating the * checksum according to the Modbus RTU CRC16 standard. */ - unsigned short calcCRC16(char* buffer, uint8_t size); - - /** - * @brief Copies the representation pointing to an externally defined char-array to heap memory. - * - * This function ensures that the provided string, which may reside in stack memory, - * is copied to heap memory. This is necessary to ensure that the destructor correctly - * frees memory from the heap and avoids attempting to delete stack-allocated memory. - * - * @param str_ptr A double pointer to the externally defined char-array that will be copied to heap memory. - * - * @details The function allocates a new buffer on the heap, copies the contents of the given - * string into this buffer, and ensures null-termination. After copying, it updates the pointer - * reference to point to the newly allocated heap memory. - * - * @note The function deletes any previously allocated heap memory pointed to by `buffer` - * before allocating the new memory. - */ - void copy_to_heap(const char** str_ptr); - + unsigned short calcCRC16(const char* buffer, uint8_t size); }; diff --git a/lib/ModbusRTU/ServiceInterface_modbusRTU.cpp b/lib/ModbusRTU/ServiceInterface_modbusRTU.cpp index f340b3c..12ac48b 100644 --- a/lib/ModbusRTU/ServiceInterface_modbusRTU.cpp +++ b/lib/ModbusRTU/ServiceInterface_modbusRTU.cpp @@ -42,7 +42,7 @@ void ServiceInterface_modbusRTU::getPDU_from_services() if (sendStack.full()) break; // exit the loop if no space left in send stack ServiceBase* destinationService = services->getService_byPos(i); // Pointer to the destination-Service while (destinationService->responseAvailable()){ // skip iteration if the services response is empty - pduString servicePdu = destinationService->get_response(); // get the response-PDU provided by the service + String servicePdu = destinationService->get_response(); // get the response-PDU provided by the service char deviceId = *destinationService->get_InstanceID(); // initialize the device-id by instance-id // Handle service-type specific conversions @@ -82,7 +82,7 @@ void ServiceInterface_modbusRTU::addPDU_to_services() recStack.deleteElement(); // discard invalid Frame (no Service found) continue; } - String pdu = receivedFrame->getPDU(); // Get the Frames payload + String pdu = *receivedFrame->get_content(); // Get the Frames payload destinationService->impart_pdu(&pdu); // Add a Content-Object created from PDU to the Services receive-stack } recStack.deleteElement(); // Delete the item added to services rec-stack from the interface-rec-stack diff --git a/platformio.ini b/platformio.ini index f9a564f..1861857 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,7 +32,6 @@ test_testing_command = ${platformio.build_dir}/${this.__env__}/firmware.elf lib_deps = featherfly/SoftwareSerial @ ^1.0 - joaolopesf/SerialDebug@^0.9.82 lib_extra_dirs = lib test_build_src = true @@ -60,7 +59,6 @@ test_testing_command = ${platformio.build_dir}/${this.__env__}/firmware.elf lib_deps = featherfly/SoftwareSerial @ ^1.0 - joaolopesf/SerialDebug@^0.9.82 lib_extra_dirs = lib test_build_src = true @@ -80,4 +78,3 @@ build_flags = -Wno-c++11-extensions test_filter = native/* test_build_src = false -lib_deps = joaolopesf/SerialDebug@^0.9.82 diff --git a/src/main.cpp b/src/main.cpp index 4d30742..d02daaf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,12 @@ /** * @file main.cpp * @author Felix Schuelke (flxscode@gmail.com) - * @brief + * @brief This main is an example-implementation of a simple modbus-messenger to demonstrate the usage + * of a layer-7-service in the program. + * The String typed in by the user via serial-interface is sent to the device with PARTNER_DEVICE_ID. + * All received Messages and raised errors are displayed on serial-monitor. + * Switch PARTNER_DEVICE_ID and DEVICE_ID before uploading to the Partner-device. + * * @version 0.1 * @date 2024-08-18 * @@ -35,6 +40,8 @@ #include #define DEVICE_ID 'A' // Modbus-RTU specific Device-ID +#define PARTNER_DEVICE_ID 'B' // Modbus-RTU specific Device-ID of an Partner-Device + #define BAUDRATE 9600 #define RX 2 #define TX 3 @@ -73,17 +80,18 @@ void setup() { Serial.begin(9600); serialInterface.begin(BAUDRATE); Serial.println("Setup..."); - msgService.sendMessage('B', "Setup..."); + msgService.sendMessage(PARTNER_DEVICE_ID, "Setup..."); }; void loop() { String s = ""; + // wait for a user-input while (Serial.available() != 0) { // data available - s = Serial.readString(); //read until timeout - s.trim(); + s = Serial.readString(); // read until timeout + s.trim(); // formatting }; - if (s!="") msgService.sendMessage('B',s); - serviceinterface.communicate(); + if (s!="") msgService.sendMessage(PARTNER_DEVICE_ID,s); // send a message to the Partner-device with the given text + serviceinterface.communicate(); // execute the communication-cycle }; #else diff --git a/test/manual/test_CharArray.cpp b/test/manual/test_CharArray.cpp new file mode 100644 index 0000000..7ff53cf --- /dev/null +++ b/test/manual/test_CharArray.cpp @@ -0,0 +1,77 @@ +/** + * @file test_CharArray.cpp + * @author Felix Schuelke (flxscode@gmail.com) + * @brief + * @version 0.1 + * @date 2024-08-18 + * + * @copyright * Copyright (C) 2024 Felix Schuelke + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +#include +#include +#include + +void showCharArrayStats(CharArray buffer,String comment){ + // show comment + Serial.print(comment); + + // show size + Serial.print("\tSize:\t"); + Serial.print(buffer.getSize()); + + // show data as string + const char* data = buffer.getData(); + Serial.print(":\tData as string:\t"); + if (data != nullptr) Serial.print(String(data).substr(0, buffer.getSize())); + + // show data as hex-array + Serial.print("\tData as hex-array:\t"); + Serial.println(buffer.getHexString()); + +} + +void test_CharArray(){ + CharArray buffer; + // check default constructor + showCharArrayStats(buffer,"Default constructor"); + // check insertion at non existing index (automated array-extension) + buffer[3] = 'a'; + showCharArrayStats(buffer,"Added char a at position 3"); + // check appending + buffer += 'b'; + showCharArrayStats(buffer,"Appended char b at last index"); + // check insertion at existing index + buffer[0] = '1'; + showCharArrayStats(buffer,"Added char 1 at position 0"); +} + +void test_CharArrayComparison(){ + CharArray buffer; + // check comparison for empty objects + if (buffer == CharArray()) Serial.println("Empty buffer object equal to default constructor"); + + // check comparison for objects with same content + CharArray cmpBuffer = buffer; //assignment + buffer[3]='a'; + if (buffer != cmpBuffer) Serial.println("Compare-buffer not equal to buffer"); + cmpBuffer[3]='a'; + if (buffer == cmpBuffer) Serial.println("Compare-buffer equal to buffer"); +} + +int main(){ + test_CharArray(); + test_CharArrayComparison(); +} \ No newline at end of file diff --git a/test/manual/test_CommInterface.cpp b/test/manual/test_CommInterface.cpp index 76ad3d7..7f09155 100644 --- a/test/manual/test_CommInterface.cpp +++ b/test/manual/test_CommInterface.cpp @@ -35,8 +35,9 @@ class ExmplCommInterface: public CommInterface{ // Send the Frame from Send-buffer bool send() override { if (sendBuffer!=nullptr){ - outgoingFrame = *sendBuffer; // set the outgoing frame to the value stored in the sendbuffer - std::cout<<"Sending:\t"<getData(); // set the outgoing frame to the value stored in the sendbuffer + Serial.print("Sending:\t"); + Serial.print(outgoingFrame); return true; } else{ @@ -47,8 +48,12 @@ class ExmplCommInterface: public CommInterface{ // Receive a Frame and write it to Receive-buffer bool receive() override { if (incomingFrame != ""){ - std::cout<<"Receiving:\t"<{ public: ExmplCommInterface(): CommInterface(0, 9600){} // Example Interface with value 0 (only used for cycle counting), Example Baudrate of 9600 bps - std::string incomingFrame = ""; // Simulation for an incoming Frame - std::string outgoingFrame = ""; // Simulation for an outgoing Frame + String incomingFrame = ""; // Simulation for an incoming Frame + String outgoingFrame = ""; // Simulation for an outgoing Frame }; @@ -78,25 +83,25 @@ std::string simulateAnswer(std::string outgoingFrame){ int main() { // Example Sendstack - Content_stack sendStack; + Content_stack sendStack; for (size_t i = 0; i < STACKSIZE; i++) { - std::string frame = std::to_string(i) + "nd outgoing Frame"; + String frame = std::to_string(i) + "nd outgoing Frame"; sendStack.addElement(frame); } // Example Rec-Stack with 3 elements - Content_stack recStack; + Content_stack recStack; // instantiate the Communication-Interface ExmplCommInterface comm_interface; // initialize Sending - std::string send_element = *(sendStack.getElement()); + CharArray send_element = *(sendStack.getElement()); comm_interface.sendNewFrame(&send_element); // initialize Receiving - std::string rec_element; + CharArray rec_element; comm_interface.getReceivedFrame(&rec_element); // Simulate Communication-Cycles @@ -119,7 +124,7 @@ int main() { // Handle receivebuffer if (comm_interface.receivedNewFrame()) { - recStack.addElement(rec_element); // Add the received element to the stack + recStack.addElement(rec_element.getData()); // Add the received element to the stack comm_interface.getReceivedFrame(&rec_element); // Impart memory the received item has to be stored at } diff --git a/test/native/test_Interface/test_Interface.cpp b/test/native/test_Interface/test_CommInterface.cpp similarity index 56% rename from test/native/test_Interface/test_Interface.cpp rename to test/native/test_Interface/test_CommInterface.cpp index bc039d4..175d886 100644 --- a/test/native/test_Interface/test_Interface.cpp +++ b/test/native/test_Interface/test_CommInterface.cpp @@ -23,20 +23,21 @@ #include #include +#include #include // ---------------------------------------Test CommInterface--------------------------------------- // ExmplCommInterface-Class as an exemple implementation of an CommInterface-Template Based Instance // with interface-type is an integer (instead of e.g. SoftwareSerial) -// The Interface is writing the Outgoing Frame to the public variable "outgoingFRame" to simulate the frame written to the bus +// The Interface is writing the Outgoing Frame to the public variable "outgoingFrame" to simulate the frame written to the bus // and is receiving Frames with reading the public variable "incoming Frame" each Communicationcycle class ExmplCommInterface: public CommInterface{ private: // Send the Frame from Send-buffer bool send() override { if (sendBuffer!=nullptr){ - outgoingFrame = *sendBuffer; // set the outgoing frame to the value stored in the sendbuffer + outgoingFrame = sendBuffer->getHexString(); // set the outgoing frame to the value stored in the sendbuffer return true; } else{ @@ -46,8 +47,11 @@ class ExmplCommInterface: public CommInterface{ // Receive a Frame and write it to Receive-buffer bool receive() override { - if (incomingFrame != ""){ - *receiveBuffer = incomingFrame; // copy the value of the incoming frame to the receivebuffer + if (incomingFrame != CharArray()){ + for (size_t i = 0; i < incomingFrame.getSize(); i++) + { + *receiveBuffer += incomingFrame.getData()[i]; + } return true; }else{ return false; @@ -56,19 +60,25 @@ class ExmplCommInterface: public CommInterface{ public: ExmplCommInterface(): CommInterface(0, 9600){} // Example Interface with value 0 (only used for cycle counting), Example Baudrate of 9600 bps - std::string incomingFrame = ""; // Simulation for an incoming Frame - std::string outgoingFrame = ""; // Simulation for an outgoing Frame + CharArray incomingFrame; // Simulation for an incoming Frame as a CharArray + String outgoingFrame = ""; // Simulation for an outgoing Frame as hex-representation }; // ---------------------------------------Test CommInterface Sending--------------------------------------- void test_CommInterface_sending(void) { #define STACKSIZE 3 - std::string frame; + + // Frame-content + CharArray frame; + // Example Sendstack - Content_stack sendStack; + Content_stack sendStack; for (size_t i = 0; i < STACKSIZE; i++) { - frame = "outgoing Frame no. "+std::to_string(i); // initialize Sendstack with 3 exampleframes + frame = "This is Frame no. "; + frame += '\0'; // add nullterminator for testing (e.g. if it appears in crc) + frame += 0xFF; // add example hex-value + frame += (char)(i+1); // append the number of the frame sendStack.addElement(frame); } @@ -76,7 +86,7 @@ void test_CommInterface_sending(void) { ExmplCommInterface comm_interface; // initialize Sending - std::string send_element = *(sendStack.getElement()); + CharArray send_element = *(sendStack.getElement()); comm_interface.sendNewFrame(&send_element); // Simulate Communication-Cycles @@ -87,22 +97,24 @@ void test_CommInterface_sending(void) { sendStack.deleteElement(); // Delete the sent element from stack if (!sendStack.empty()) { - send_element = *(sendStack.getElement()); // Get the next Element to be sent + send_element = *(sendStack.getElement()); // Get the next Element to be sent comm_interface.sendNewFrame(&send_element); // Impart Frame that has to be sent next }; }; // Communicate - comm_interface.sendCycle(); // Execute the Communication-Interfaces Comm-Cycle (Send-Receive-Cycle) + comm_interface.sendCycle(); // Execute the Communication-Interfaces Send-Cycle to send //Check for the excepted outgoing Frame if (i exmplFrameStack; + + // Frame-content + CharArray frame; + + // Example Sendstack + Content_stack exmplStack; for (size_t i = 0; i < STACKSIZE; i++) { - frame = "outgoing Frame no. "+std::to_string(i); // initialize Stack with 3 exampleframes - exmplFrameStack.addElement(frame); + frame = "This is Frame no. "; + frame += '\0'; // add nullterminator for testing (e.g. if it appears in crc) + frame += 0xFF; // add example hex-value + frame += (char)(i+1); // append the number of the frame + exmplStack.addElement(frame); } - // Example Rec-Stack with 3 elements - Content_stack recStack; - // instantiate the Communication-Interface ExmplCommInterface comm_interface; + // Receive-Stack to store received frames (not part of CommInterface) + Content_stack recStack; + // initialize Receiving - String rec_element; + CharArray rec_element; comm_interface.getReceivedFrame(&rec_element); // Simulate Communication-Cycles - for (int i = 0; i < 8; i++) + for (size_t i = 0; i < 8; i++) { // Impart the simulated received Frame - if (!exmplFrameStack.empty()) + if (!exmplStack.empty()) { - comm_interface.incomingFrame = *(exmplFrameStack.getElement()); - exmplFrameStack.deleteElement(); + comm_interface.incomingFrame = *(exmplStack.getElement()); + exmplStack.deleteElement(); }; // Communicate - comm_interface.receiveCycle(); // Execute the Communication-Interfaces Comm-Cycle (Send-Receive-Cycle) - + comm_interface.receiveCycle(); // Execute the Communication-Interfaces Comm-Cycle (Send-Receive-Cycle) // Handle receivebuffer if (comm_interface.receivedNewFrame()) { recStack.addElement(rec_element); // Add the received element to the stack + rec_element = CharArray(); comm_interface.getReceivedFrame(&rec_element); // Impart memory the received item has to be stored at } // Reset the incoming Frame simulation - comm_interface.incomingFrame = ""; + comm_interface.incomingFrame = CharArray(); // Check for the excepted received Frame if (i