The work_queue sample illustrates three reaction styles available for using zbus. The first is a listener that reacts by callback; use it should for urgent reaction. The second is a listener that responds by callback; instead of executing the code, it pushes a job to a work queue that will be executed shortly but not immediately. The last one is the subscriber that reacts using a queue; use it for an asynchronous reaction where the developer would like to control the flow. Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
22 lines
347 B
C
22 lines
347 B
C
/*
|
|
* Copyright (c) 2022 Rodrigo Peixoto <rodrigopex@gmail.com>
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#ifndef _MESSAGES_H_
|
|
#define _MESSAGES_H_
|
|
#include <stdint.h>
|
|
|
|
struct version_msg {
|
|
uint8_t major;
|
|
uint8_t minor;
|
|
uint16_t build;
|
|
};
|
|
|
|
struct sensor_msg {
|
|
uint32_t temp;
|
|
uint32_t press;
|
|
uint32_t humidity;
|
|
};
|
|
|
|
#endif /* _MESSAGES_H_ */
|