ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
uart
button
uart_button.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/uart/uart.h
"
5
#include "
esphome/components/button/button.h
"
6
7
namespace
esphome::uart
{
8
9
class
UARTButton
final :
public
button::Button
,
public
UARTDevice
,
public
Component
{
10
public
:
11
void
set_data
(
const
uint8_t *data, uint16_t
len
) {
12
this->
data_
= data;
13
this->
data_len_
=
len
;
14
}
15
16
void
dump_config
()
override
;
17
18
protected
:
19
void
press_action
()
override
;
20
const
uint8_t *
data_
{
nullptr
};
21
uint16_t
data_len_
{0};
22
};
23
24
}
// namespace esphome::uart
button.h
esphome::Component
Definition
component.h:147
esphome::button::Button
Base class for all buttons.
Definition
button.h:25
esphome::uart::UARTButton
Definition
uart_button.h:9
esphome::uart::UARTButton::data_len_
uint16_t data_len_
Definition
uart_button.h:21
esphome::uart::UARTButton::press_action
void press_action() override
Definition
uart_button.cpp:8
esphome::uart::UARTButton::dump_config
void dump_config() override
Definition
uart_button.cpp:13
esphome::uart::UARTButton::data_
const uint8_t * data_
Definition
uart_button.h:20
esphome::uart::UARTButton::set_data
void set_data(const uint8_t *data, uint16_t len)
Definition
uart_button.h:11
esphome::uart::UARTDevice
Definition
uart.h:15
component.h
esphome::uart
Definition
serial_proxy.h:33
esphome::len
const void size_t len
Definition
hal.h:68
uart.h
Generated by
1.12.0