From 740c1230ca57a68f7dfb12db9a1d965e6a36e43d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anian=20B=C3=BChler?=
 <anian.buehler@reutlingen-university.de>
Date: Tue, 1 Feb 2022 11:02:19 +0100
Subject: [PATCH] fixed wildcard-topic for client

---
 src/didacticNet.cpp |  3 ++-
 src/didacticNet.h   | 10 +++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/didacticNet.cpp b/src/didacticNet.cpp
index 1596147..fb92ef0 100644
--- a/src/didacticNet.cpp
+++ b/src/didacticNet.cpp
@@ -299,7 +299,8 @@ bool DidacticPSNetClient::handleData(){
     payloadLength  = extractData(topicLength+3, MAX_LEN_PAYLOAD, _bufferPayload, MSG_DELIMITER);
     if( currentTopicNr >= 0){
       savePayload( _bufferPayload, currentTopicNr);
-      callback(_topic[currentTopicNr], topicLength, _payload[currentTopicNr], payloadLength);
+      //callback(_topic[currentTopicNr], topicLength, _payload[currentTopicNr], payloadLength);
+      callback(_bufferTopic, topicLength, _bufferPayload, payloadLength);
     }
   }
   return true;
diff --git a/src/didacticNet.h b/src/didacticNet.h
index 6da1922..41aac4c 100644
--- a/src/didacticNet.h
+++ b/src/didacticNet.h
@@ -18,10 +18,10 @@
 //@ publish   → on publish check topic, then send topic-update
 //? subscribe → subscribe starts update, topic filter @client
 //# update    → update to specific topic Broker to client
-#define MSG_PUBLISH   '@'
-#define MSG_SUBSCRIBE '?'
-#define MSG_UPDATE    '#'
-#define MSG_TOPIC_MULTI     '*'
+#define MSG_PUBLISH     '@'
+#define MSG_SUBSCRIBE   '?'
+#define MSG_UPDATE      '#'
+#define MSG_TOPIC_MULTI '*'
 
 //<@topic|payload>
 #define LEN_OVERHEAD  4
@@ -34,7 +34,7 @@
 #define INTERVAL_CLIENT	   500L
 #define INTERVAL_BROKER	     0L
 
-#define MAX_NR_TOPICS_CLIENT  20
+#define MAX_NR_TOPICS_CLIENT  10
 #define MAX_NR_TOPICS_BROKER  20
 #define MAX_LEN_TOPICS 		  10
 #define MAX_LEN_PAYLOAD       20
-- 
GitLab