Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Avionics
Software Development
Skyward Boardcore
Wiki
Events Cheatsheet
Changes
Page history
New page
Templates
Clone repository
[Events-cheatsheet] Added warning about events with payload
authored
6 years ago
by
Luca Mozzarelli
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Events-Cheatsheet.md
+4
-8
4 additions, 8 deletions
Events-Cheatsheet.md
with
4 additions
and
8 deletions
Events-Cheatsheet.md
View page @
d2a9206f
...
...
@@ -47,12 +47,8 @@ class MyClass : public FSM<MyClass>
private:
uint16_t
event_id
=
0
;
// ...
void
someFunction
()
{
unsigned
int
delay
=
1000
;
// Delay is defined in milliseconds
...
...
@@ -61,11 +57,8 @@ class MyClass : public FSM<MyClass>
event_id
=
sEventBroker
->
postDelayed
({
EV_TIMEOUT_SHADOW_MODE
},
TOPIC_ADA
,
delay
);
}
// ...
// Function handling events for the current state
void
MyClass
::
stateMyState
(
const
Event
&
ev
)
{
...
...
@@ -78,7 +71,9 @@ class MyClass : public FSM<MyClass>
sEventBroker
->
removeDelayed
(
shadow_delayed_event_id
);
break
;
}
// ...
}
}
...
...
@@ -116,4 +111,5 @@ void someFunction()
sEventBroker
->
post
(
ev
,
TOPIC_TC
);
}
```
```
\ No newline at end of file
**
⚠️ WARNING ⚠️
**
The
`postDelayed`
function does not work with "non-standard" events, all the payload is lost!
This diff is collapsed.
Click to expand it.