2026-04-13 16:43:17 +08:00
|
|
|
#ifndef BLINKY_TIME_SYNC_EVENT_H_
|
|
|
|
|
#define BLINKY_TIME_SYNC_EVENT_H_
|
|
|
|
|
|
|
|
|
|
#include <app_event_manager.h>
|
|
|
|
|
#include <app_event_manager_profiler_tracer.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct time_sync_event {
|
|
|
|
|
struct app_event_header header;
|
|
|
|
|
uint32_t version;
|
|
|
|
|
uint32_t flags;
|
|
|
|
|
int32_t timezone_min;
|
|
|
|
|
uint64_t utc_ms;
|
|
|
|
|
uint32_t accuracy_ms;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
APP_EVENT_TYPE_DECLARE(time_sync_event);
|
|
|
|
|
|
2026-04-14 16:42:04 +08:00
|
|
|
static inline void submit_time_sync_event(uint32_t version, uint32_t flags,
|
|
|
|
|
int32_t timezone_min, uint64_t utc_ms,
|
|
|
|
|
uint32_t accuracy_ms)
|
|
|
|
|
{
|
|
|
|
|
struct time_sync_event *event = new_time_sync_event();
|
|
|
|
|
|
|
|
|
|
event->version = version;
|
|
|
|
|
event->flags = flags;
|
|
|
|
|
event->timezone_min = timezone_min;
|
|
|
|
|
event->utc_ms = utc_ms;
|
|
|
|
|
event->accuracy_ms = accuracy_ms;
|
|
|
|
|
APP_EVENT_SUBMIT(event);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 16:43:17 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* BLINKY_TIME_SYNC_EVENT_H_ */
|