Skip to content
Snippets Groups Projects
Commit 683baac5 authored by Anian Bühler's avatar Anian Bühler
Browse files

changed DATA to PAYLOAD

parent 59b8ea52
Branches
No related tags found
2 merge requests!3Dev to master,!2Dev to Master
......@@ -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];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment