16#ifdef USE_SOCKET_TCP_LISTENER
33 " Reconnect Interval: %" PRIu32
"ms",
34 this->
server_ ? LOG_STR_LITERAL(
"Listen") : LOG_STR_LITERAL(
"Host"),
35 this->
server_ ? LOG_STR_LITERAL(
"*") : this->
link_.
host(), this->link_.port(),
36 this->link_.reconnect_interval());
37#ifdef USE_SOCKET_TCP_LISTENER
48#ifdef USE_SOCKET_TCP_LISTENER
81 size_t want = std::min(room,
sizeof(tmp));
100 size_t n = std::min(left,
sizeof(dump));
116#ifdef USE_SOCKET_TCP_LISTENER
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void publish_state(bool new_state)
Publish a new state to the front-end.
void publish_state(float state)
Publish a new state to the front-end.
void tx_commit(size_t len)
const char * host() const
bool flush_tx()
Send the front of the buffer; true once it is empty.
void close()
Close without scheduling a reconnect (shutdown).
ssize_t read(uint8_t *buf, size_t len)
Returns bytes moved, 0 when nothing can move now, -1 when the link dropped.
void begin(const char *tag)
Call from setup(). tag names this link's log lines.
uint8_t * tx_tail()
Direct access to the buffer's free tail.
void poll()
Connect state machine; call every loop while acting as a client.
void poll(TcpClientLink &link, bool may_accept)
Server state machine; call every loop.
void begin(const char *tag)
Call from setup(); tag names the log lines.
void dump_config() const
One config line per allowed network.
size_t paced_write_room(uint32_t last_write_ms)
optional< std::array< uint8_t, N > > read_array()
void write_array(const uint8_t *data, size_t len)
static constexpr size_t DISCARD_CHUNK
socket::TcpClientLink link_
sensor::Sensor * disconnects_sensor_
void on_shutdown() override
static constexpr size_t READ_CHUNK
socket::TcpListener listener_
binary_sensor::BinarySensor * connected_sensor_
void dump_config() override
ESPHOME_LOG_TAG(TAG, "uart_tcp")
Application App
Global storage of Application pointer - only one Application can exist.