NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
Loading...
Searching...
No Matches
aggregation.h File Reference

Data aggregation. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>
#include <nturt/sys/util.h>
+ Include dependency graph for aggregation.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  agg
 Data aggregation. More...
 
struct  agg_typed
 Data aggregation for a specific type. More...
 

Macros

#define AGG_FLAG_ALWAYS_PUBLISH   BIT(0)
 Flag indicating the aggregation will always publish the data, even if no members are updated.
 
#define AGG_MEMBER_FLAG_IGNORED   BIT(0)
 Flag indicating the aggregation will not monitor the update of the member.
 
#define AGG_MEMBER_FLAG_OPTIONAL   BIT(1)
 Flag indicating the aggregation will not wait for the member to be updated before publishing. However, updates to the member will cold start the aggregation from dormant.
 
#define AGG_INITIALIZER(_obj, _name, _period, _min_separation, _watermark, _flag, _publish, _user_data, ...)
 Static initializer for a dataa aggregation. Refer to AGG_DEFINE for detailed parameter descriptions.
 
#define AGG_DEFINE(name, period, min_separation, watermark, flag, publish, user_data, ...)
 Define a data aggregation named _name to monitor the update of data. May be specified as static to limit the scope of the aggregation.
 
#define AGG_MEMBER(member, ...)
 Specify a member of a struct to be monitored for aggregation. Used in AGG_TYPED_DEFINE.
 
#define AGG_DATA_INIT(val, ...)
 Intial value of the data. Used in AGG_TYPED_DEFINE.
 
#define AGG_TYPED_DEFINE(_name, _type, _init_val, _period, _min_separation, _watermark, _flag, _publish, _user_data, ...)
 Define a data aggregation named _name to monitor the update of members within a data type. May be specified as static to limit the scope of the aggregation.
 
#define AGG_TYPED_UPDATE(agg_typed, type, member, value)
 Update a member of data.
 

Typedefs

typedef void(* agg_publish_t) (struct agg *agg, void *user_data)
 Function to publish the data.
 
typedef void(* agg_typed_publish_t) (const void *data, void *user_data)
 Function to publish the data.
 

Functions

void agg_update (struct agg *agg, int idx)
 Signal the update of a data in aggregation.
 
void agg_period_timer_cb (struct k_timer *timer)
 Timer callback function for periodic publishing.
 
void agg_early_timer_cb (struct k_timer *timer)
 Timer callback function for tracking minimum separation time.
 
void agg_work_cb (struct k_work *work)
 Work callback function for the bottom half of publishing, also used for late publishing.
 
void agg_typed_publish (struct agg *agg, void *user_data)
 Publish function for data aggregation.
 

Detailed Description

Data aggregation.

Author
quantumspawner
Version
0.0.1
Date
2025-02-13