Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sys_notify Struct Reference

State associated with notification for an asynchronous operation. More...

#include <notify.h>

Data Structures

union  method
 

Data Fields

union sys_notify::method method
 
uint32_t volatile flags
 
int volatile result
 

Detailed Description

State associated with notification for an asynchronous operation.

Objects of this type are allocated by a client, which must use an initialization function (e.g. sys_notify_init_signal()) to configure them. Generally the structure is a member of a service-specific client structure, such as onoff_client.

Control of the containing object transfers to the service provider when a pointer to the object is passed to a service function that is documented to take control of the object, such as onoff_service_request(). While the service provider controls the object the client must not change any object fields. Control reverts to the client:

  • if the call to the service API returns an error;
  • when operation completion is posted. This may occur before the call to the service API returns.

Operation completion is technically posted when the flags field is updated so that sys_notify_fetch_result() returns success. This will happen before the signal is posted or callback is invoked. Note that although the manager will no longer reference the sys_notify object past this point, the containing object may have state that will be referenced within the callback. Where callbacks are used control of the containing object does not revert to the client until the callback has been invoked. (Re-use within the callback is explicitly permitted.)

After control has reverted to the client the notify object must be reinitialized for the next operation.

The content of this structure is not public API to clients: all configuration and inspection should be done with functions like sys_notify_init_callback() and sys_notify_fetch_result(). However, services that use this structure may access certain fields directly.

Field Documentation

◆ flags

uint32_t volatile sys_notify::flags

◆ method

union sys_notify::method sys_notify::method

◆ result

int volatile sys_notify::result

The documentation for this struct was generated from the following file: