From 683baac558145595985d85e43f679bf64ef1e658 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anian=20B=C3=BChler?=
 <anian.buehler@reutlingen-university.de>
Date: Fri, 2 Jul 2021 12:41:10 +0200
Subject: [PATCH] changed DATA to PAYLOAD

---
 src/didacticNet.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/didacticNet.cpp b/src/didacticNet.cpp
index 54dacbc..d1608ab 100644
--- a/src/didacticNet.cpp
+++ b/src/didacticNet.cpp
@@ -73,7 +73,7 @@ bool didacticPSNet::sendData(){
 	while(_sendBufferMessage[counter]!= '\0'){
 		_port->write(_sendBufferMessage[counter]);
 		counter++;
-		if(counter > MAX_LEN_TOPICS + MAX_LEN_DATA + 5){
+		if(counter > MAX_LEN_TOPICS + MAX_LEN_PAYLOAD + 5){
 		return false;
 		}
 	}
@@ -156,7 +156,7 @@ bool didacticPSNetClient::publish(char* topic,  char* data){
     _dataToSend = false;
 		return false;
 	}
-	if(dataLength <= MAX_LEN_DATA){
+	if(dataLength <= MAX_LEN_PAYLOAD){
 		for(int i = 0; i < dataLength; i++){
 			_sendBufferMessage[2+topicLength+1+i] = data[i];
 		}
@@ -183,7 +183,7 @@ bool didacticPSNetClient::publish(char* topic, int topicLength, char* data , int
     _dataToSend = false;
 		return false;
 	}
-	if(dataLength <= MAX_LEN_DATA){
+	if(dataLength <= MAX_LEN_PAYLOAD){
 		for(int i = 0; i < dataLength; i++){
 			_sendBufferMessage[2+topicLength+1+i] = data[i];
 		}
@@ -314,7 +314,7 @@ bool didacticPSNetClient::handleData(){
   topicLength = extractData(2, MAX_LEN_TOPICS, _bufferTopic, MSG_SEPARATOR);
   if(topicLength > 0){
     currentTopicNr = getTopicNr(_bufferTopic);
-    dataLength  = extractData(topicLength+3, MAX_LEN_DATA, _bufferData, MSG_DELIMITER);
+    dataLength  = extractData(topicLength+3, MAX_LEN_PAYLOAD, _bufferData, MSG_DELIMITER);
     if( currentTopicNr >= 0){
       saveData( _bufferData, currentTopicNr);
       callback(_topic[currentTopicNr], topicLength, _data[currentTopicNr], dataLength);
@@ -374,7 +374,7 @@ bool didacticPSNetBroker::handleData(){
     topicLength = extractData(2, MAX_LEN_TOPICS, _bufferTopic, MSG_SEPARATOR);
     if(topicLength > 0){
       currentTopicNr = getTopicNr(_bufferTopic);
-      dataLength  = extractData(topicLength+3, MAX_LEN_DATA, _bufferData, MSG_DELIMITER);
+      dataLength  = extractData(topicLength+3, MAX_LEN_PAYLOAD, _bufferData, MSG_DELIMITER);
       if( currentTopicNr >= 0){
         writeDataToTopic(currentTopicNr, _bufferTopic, _bufferData);
         update(_topic[currentTopicNr], topicLength, _data[currentTopicNr], dataLength);
@@ -408,7 +408,7 @@ bool didacticPSNetBroker::update(char* topic, int topicLength, char* data , int
     _dataToSend = false;
 		return false;
 	}
-	if(dataLength <= MAX_LEN_DATA){
+	if(dataLength <= MAX_LEN_PAYLOAD){
 		for(int i = 0; i < dataLength; i++){
 			_sendBufferMessage[2+topicLength+1+i] = data[i];
 		}
-- 
GitLab