Byte payload that is either a stateless lambda or a static table, which may be in PROGMEM.
More...
|
| void | set_template (std::vector< uint8_t >(*func)(Ts...)) |
| |
| void | set_static (const uint8_t *data, uint16_t len) |
| |
| bool | is_static () const |
| |
| const uint8_t * | data () const |
| | Only valid when is_static(); may point to PROGMEM, so read it with progmem_memcpy or progmem_read_byte.
|
| |
| size_t | size () const |
| | Only valid when is_static().
|
| |
| std::vector< uint8_t > | value (const Ts &...x) const |
| |
| template<size_t N = 64, typename F > |
| void | visit (F &&fn, const Ts &...x) const |
| | Calls fn(const uint8_t *data, size_t len) with the payload readable from RAM: a lambda's vector, a static table directly, or on ESP8266 a copy of the PROGMEM table (on the stack up to N bytes).
|
| |
template<typename... Ts>
class esphome::TemplatableBytes< Ts >
Byte payload that is either a stateless lambda or a static table, which may be in PROGMEM.
8 bytes on 32-bit; codegen stores constant payloads as shared flash tables.
Definition at line 84 of file automation.h.
template<typename... Ts>
template<size_t N = 64, typename F >
Calls fn(const uint8_t *data, size_t len) with the payload readable from RAM: a lambda's vector, a static table directly, or on ESP8266 a copy of the PROGMEM table (on the stack up to N bytes).
Definition at line 106 of file automation.h.