Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DidacticNetwork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
letsgoING
Libraries
DidacticNetwork
Commits
683baac5
Commit
683baac5
authored
3 years ago
by
Anian Bühler
Browse files
Options
Downloads
Patches
Plain Diff
changed DATA to PAYLOAD
parent
59b8ea52
No related branches found
No related tags found
2 merge requests
!3
Dev to master
,
!2
Dev to Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/didacticNet.cpp
+6
-6
6 additions, 6 deletions
src/didacticNet.cpp
with
6 additions
and
6 deletions
src/didacticNet.cpp
+
6
−
6
View file @
683baac5
...
...
@@ -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
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment