OS  v1.7.5
Documentation
Loading...
Searching...
No Matches

API interface for task Notifications. More...

Collaboration diagram for Notifications:

Enumerations

enum class  qOS::notifyMode : uint8_t { qOS::notifyMode::SIMPLE , qOS::notifyMode::QUEUED }
 An enum that defines the modes in which a notification can be delivered. More...
 

Functions

bool qOS::core::notify (notifyMode mode, task &Task, void *eventData=nullptr) noexcept
 Sends a notification generating an asynchronous event. If mode = notifyMode::SIMPLE, the method marks the task as ready for execution and the scheduler planner will launch the task immediately according to the scheduling rules (even if task is disabled) and setting the trigger flag to trigger::byNotificationSimple. If mode = notifyMode::QUEUED, the notification will insert the notification in the FIFO priority queue. The scheduler get this notification as an asynchronous event and the task will be ready for execution according to the queue order (determined by priority), even if task is in a disabled or sleep operational state. When extracted, the scheduler will set trigger flag to trigger::byNotificationQueued. Specific user-data can be passed through, and will be available inside the event_t::EventData field, only in corresponding launch. If the task is in a SLEEP operation state, the scheduler will change the operational state to AWAKEN setting the SHUTDOWN bit. Specific user-data can be passed through, and will be available in the respective callback inside the qOS::event_t::EventData field.
 
bool qOS::core::notify (notifyMode mode, void *eventData=nullptr) noexcept
 Try to spread a notification among all the tasks in the scheduling scheme.
 
bool qOS::core::hasPendingNotifications (const task &Task) const noexcept
 Check if the supplied task has pending notifications.
 

Detailed Description

API interface for task Notifications.

Enumeration Type Documentation

◆ notifyMode

enum class qOS::notifyMode : uint8_t
strong

An enum that defines the modes in which a notification can be delivered.

Enumerator
SIMPLE 

To notify a task using the simple approach.

QUEUED 

To notify a task using the FIFO priority queue.

Function Documentation

◆ hasPendingNotifications()

bool qOS::core::hasPendingNotifications ( const task & Task) const
noexcept

Check if the supplied task has pending notifications.

Note
Operation will be performed in the next scheduling cycle.
Parameters
[in]TaskThe task node
Returns
true if the task has pending notifications, false if not.

◆ notify() [1/2]

bool qOS::core::notify ( notifyMode mode,
task & Task,
void * eventData = nullptr )
noexcept

Sends a notification generating an asynchronous event. If mode = notifyMode::SIMPLE, the method marks the task as ready for execution and the scheduler planner will launch the task immediately according to the scheduling rules (even if task is disabled) and setting the trigger flag to trigger::byNotificationSimple. If mode = notifyMode::QUEUED, the notification will insert the notification in the FIFO priority queue. The scheduler get this notification as an asynchronous event and the task will be ready for execution according to the queue order (determined by priority), even if task is in a disabled or sleep operational state. When extracted, the scheduler will set trigger flag to trigger::byNotificationQueued. Specific user-data can be passed through, and will be available inside the event_t::EventData field, only in corresponding launch. If the task is in a SLEEP operation state, the scheduler will change the operational state to AWAKEN setting the SHUTDOWN bit. Specific user-data can be passed through, and will be available in the respective callback inside the qOS::event_t::EventData field.

Parameters
[in]modethe method used to send the event: notifyMode::SIMPLE or notifyMode::QUEUED.
[in]TaskThe task node.
[in]eventDataSpecific event user-data.
Returns
true on success. Otherwise false.

◆ notify() [2/2]

bool qOS::core::notify ( notifyMode mode,
void * eventData = nullptr )
noexcept

Try to spread a notification among all the tasks in the scheduling scheme.

Note
Operation will be performed in the next scheduling cycle.
Parameters
[in]modethe method used to spread the event: notifyMode::SIMPLE or notifyMode::QUEUED.
[in]eventDataSpecific event user-data.
Returns
true if success. false if any other spread operation is in progress.