FastLED 3.9.15
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/json.h"
4#include "fl/stl/stdint.h"
5#include "fl/stl/string.h"
6
7namespace fl {
8
14struct RpcResult {
15 fl::string functionName; // Name of function that executed
16 fl::json result; // Return value (null if no return)
17 u32 scheduledAt; // Timestamp when scheduled (0 for immediate)
18 u32 receivedAt; // Timestamp when RPC request received
19 u32 executedAt; // Timestamp when function executed
20 bool wasScheduled; // true if scheduled, false if immediate
21
26 fl::json to_json() const;
27};
28
32enum class RemoteClearFlags : u8 {
33 None = 0,
34 Results = 1 << 0,
35 Scheduled = 1 << 1,
36 Functions = 1 << 2,
38};
39
40// Bitwise operators for RemoteClearFlags
42 return static_cast<RemoteClearFlags>(static_cast<u8>(a) | static_cast<u8>(b));
43}
44
46 return static_cast<RemoteClearFlags>(static_cast<u8>(a) & static_cast<u8>(b));
47}
48
49inline bool operator!(RemoteClearFlags flags) {
50 return static_cast<u8>(flags) == 0;
51}
52
53} // namespace fl
FastLED's Elegant JSON Library: fl::json
unsigned char u8
Definition stdint.h:131
FASTLED_FORCE_INLINE CRGB operator&(const CRGB &p1, const CRGB &p2) FL_NOEXCEPT
Combine two CRGB objects, taking the smallest value of each channel.
Definition crgb.h:787
bool operator!(RemoteClearFlags flags)
Definition types.h:49
RemoteClearFlags
Flags for clearing Remote state (can be OR'd together)
Definition types.h:32
@ Scheduled
Clear scheduled calls.
Definition types.h:35
@ All
Clear everything.
Definition types.h:37
@ Functions
Clear registered functions.
Definition types.h:36
@ Results
Clear results from executed functions.
Definition types.h:34
FASTLED_FORCE_INLINE CRGB operator|(const CRGB &p1, const CRGB &p2) FL_NOEXCEPT
Combine two CRGB objects, taking the largest value of each channel.
Definition crgb.h:795
Base definition for an LED controller.
Definition crgb.hpp:179
u32 executedAt
Definition types.h:19
u32 receivedAt
Definition types.h:18
fl::json result
Definition types.h:16
bool wasScheduled
Definition types.h:20
u32 scheduledAt
Definition types.h:17
fl::json to_json() const
Serialize result to JSON object (compact single-line format)
Definition types.cpp.hpp:4
fl::string functionName
Definition types.h:15
Result metadata for executed RPC calls.
Definition types.h:14