... | @@ -41,7 +41,7 @@ void someFunction() |
... | @@ -41,7 +41,7 @@ void someFunction() |
|
|
|
|
|
// Post the event EV_TIMEOUT_SHADOW_MODE on topic TOPIC_ADA delayed by 1 second
|
|
// Post the event EV_TIMEOUT_SHADOW_MODE on topic TOPIC_ADA delayed by 1 second
|
|
// NOTE THE CURLY BRACKETS AROUND THE EVENT NAME!
|
|
// NOTE THE CURLY BRACKETS AROUND THE EVENT NAME!
|
|
event_id = sEventBroker->postDelayed({EV_TIMEOUT_SHADOW_MODE}, TOPIC_ADA, delay);
|
|
event_id = sEventBroker->postDelayed<delay>({EV_TIMEOUT_SHADOW_MODE}, TOPIC_ADA);
|
|
}
|
|
}
|
|
```
|
|
```
|
|
It is good practice to save the event id returned by the function in order to remove it later.
|
|
It is good practice to save the event id returned by the function in order to remove it later.
|
... | @@ -59,7 +59,7 @@ class MyClass : public FSM<MyClass> |
... | @@ -59,7 +59,7 @@ class MyClass : public FSM<MyClass> |
|
unsigned int delay = 1000; // Delay is defined in milliseconds
|
|
unsigned int delay = 1000; // Delay is defined in milliseconds
|
|
|
|
|
|
// Store the event id
|
|
// Store the event id
|
|
event_id = sEventBroker->postDelayed({EV_TIMEOUT_SHADOW_MODE}, TOPIC_ADA, delay);
|
|
event_id = sEventBroker->postDelayed<delay>({EV_TIMEOUT_SHADOW_MODE}, TOPIC_ADA);
|
|
}
|
|
}
|
|
|
|
|
|
// ...
|
|
// ...
|
... | @@ -81,8 +81,7 @@ class MyClass : public FSM<MyClass> |
... | @@ -81,8 +81,7 @@ class MyClass : public FSM<MyClass> |
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
};
|
|
}
|
|
|
|
```
|
|
```
|
|
|
|
|
|
<!---
|
|
<!---
|
... | | ... | |