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
d0fa9652
Verified
Commit
d0fa9652
authored
1 year ago
by
Anian Bühler
Browse files
Options
Downloads
Patches
Plain Diff
added readBooleanPayload & readIntegerPayload
parent
e77008e8
Branches
feature/scoring-chatgpt1
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
keywords.txt
+2
-0
2 additions, 0 deletions
keywords.txt
src/DidacticNet.cpp
+16
-0
16 additions, 0 deletions
src/DidacticNet.cpp
src/DidacticNet.h
+2
-0
2 additions, 0 deletions
src/DidacticNet.h
with
20 additions
and
0 deletions
keywords.txt
+
2
−
0
View file @
d0fa9652
...
@@ -27,6 +27,8 @@ available KEYWORD2
...
@@ -27,6 +27,8 @@ available KEYWORD2
readLatestTopicNr KEYWORD2
readLatestTopicNr KEYWORD2
readTopic KEYWORD2
readTopic KEYWORD2
readPayload KEYWORD2
readPayload KEYWORD2
readBooleanPayload KEYWORD2
readIntegerPayload KEYWORD2
publish KEYWORD2
publish KEYWORD2
publishOnChange KEYWORD2
publishOnChange KEYWORD2
...
...
This diff is collapsed.
Click to expand it.
src/DidacticNet.cpp
+
16
−
0
View file @
d0fa9652
...
@@ -222,8 +222,24 @@ void DidacticPSNetClient::readPayload(char *payload)
...
@@ -222,8 +222,24 @@ void DidacticPSNetClient::readPayload(char *payload)
void
DidacticPSNetClient
::
readPayload
(
char
*
topic
,
char
*
payload
)
void
DidacticPSNetClient
::
readPayload
(
char
*
topic
,
char
*
payload
)
{
{
int
topicNr
=
getTopicNr
(
topic
);
int
topicNr
=
getTopicNr
(
topic
);
if
(
topicNr
==
_newMessageTopicNr
)
{
_newMessageAvailable
=
false
;
}
readPayload
(
topicNr
,
payload
);
readPayload
(
topicNr
,
payload
);
}
}
bool
DidacticPSNetClient
::
readBooleanPayload
()
{
_newMessageAvailable
=
false
;
return
_payload
[
_newMessageTopicNr
][
0
]
==
'1'
;
}
int
DidacticPSNetClient
::
readIntegerPayload
()
{
_newMessageAvailable
=
false
;
return
atoi
(
_payload
[
_newMessageTopicNr
]);
}
// ##########################################
// ##########################################
DidacticPSNetClient
::
DidacticPSNetClient
()
DidacticPSNetClient
::
DidacticPSNetClient
()
...
...
This diff is collapsed.
Click to expand it.
src/DidacticNet.h
+
2
−
0
View file @
d0fa9652
...
@@ -201,6 +201,8 @@ public:
...
@@ -201,6 +201,8 @@ public:
void
readPayload
(
char
*
);
// new
void
readPayload
(
char
*
);
// new
void
readPayload
(
int
,
char
*
);
// new
void
readPayload
(
int
,
char
*
);
// new
void
readPayload
(
char
*
,
char
*
);
// new
void
readPayload
(
char
*
,
char
*
);
// new
bool
readBooleanPayload
();
// new
int
readIntegerPayload
();
// new
int
getMaxNrTopics
();
int
getMaxNrTopics
();
int
getSubscribedTopic
(
char
*
,
int
);
int
getSubscribedTopic
(
char
*
,
int
);
...
...
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