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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
letsgoING
Libraries
DidacticNetwork
Commits
cde7d6dd
Commit
cde7d6dd
authored
Dec 1, 2021
by
Anian Bühler
Browse files
Options
Downloads
Patches
Plain Diff
fixed interval error
parent
a1de1259
Branches
Branches containing commit
No related tags found
1 merge request
!5
Dev
This commit is part of merge request
!5
. Comments created here will be created in the context of that merge request.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/didacticNet.cpp
+3
-3
3 additions, 3 deletions
src/didacticNet.cpp
src/didacticNet.h
+2
-1
2 additions, 1 deletion
src/didacticNet.h
with
5 additions
and
4 deletions
src/didacticNet.cpp
+
3
−
3
Edit
View file @
cde7d6dd
...
...
@@ -43,10 +43,10 @@ bool DidacticPSNet::handleNetwork(){
handleData
();
}
}
_waitingTime
=
millis
()
+
random
(
CSMA_MIN_DELAY_MS
,
CSMA_MAX_DELAY_MS
);
_waitingTime
CSMA
=
millis
()
+
random
(
CSMA_MIN_DELAY_MS
,
CSMA_MAX_DELAY_MS
);
}
//else if(_dataToSend){
if
(
_dataToSend
&&
_waitingTime
<=
millis
()){
if
(
_dataToSend
&&
_waitingTime
Send
<=
millis
()
&&
_waitingTimeCSMA
<=
millis
()){
//send data to network
//TODO: test added CSMA_CHECKDELAY + 2nd checkData()
delayMicroseconds
(
CSMA_CHECK_DELAY_US
);
...
...
@@ -57,7 +57,7 @@ bool DidacticPSNet::handleNetwork(){
else
{
_dataToSend
=
false
;
//_waitingTime = millis()+ random(CSMA_MID_DELAY_MS, CSMA_MAX_DELAY_MS);
_waitingTime
=
millis
()
+
_intervalTime
;
//random(CSMA_MID_DELAY_MS, CSMA_MAX_DELAY_MS);
_waitingTime
Send
=
millis
()
+
_intervalTime
;
//random(CSMA_MID_DELAY_MS, CSMA_MAX_DELAY_MS);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/didacticNet.h
+
2
−
1
Edit
View file @
cde7d6dd
...
...
@@ -110,7 +110,8 @@ class DidacticPSNet
char
_sendBufferMessage
[
MAX_LEN_TOPICS
+
MAX_LEN_PAYLOAD
+
LEN_OVERHEAD
+
1
];
bool
_dataToSend
=
false
;
// int Data to send for queue?
unsigned
long
_waitingTime
=
0L
;
unsigned
long
_waitingTimeSend
=
0L
;
unsigned
long
_waitingTimeCSMA
=
0L
;
unsigned
long
_intervalTime
=
0L
;
int
_currentTopicLength
=
0
;
int
_currentPayloadLength
=
0
;
...
...
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
sign in
to comment