13 ESP_LOGW(TAG,
"Packet of %zu bytes is larger than %zu",
size, this->max_packet_size_);
29 ESP_LOGW(TAG,
"Radio busy for %" PRIu32
"ms, %s", busy_ms,
30 sent ? LOG_STR_LITERAL(
"sent anyway") : LOG_STR_LITERAL(
"tried to send anyway, which failed"));
38 ESP_LOGV(TAG,
"Empty packet not sent");
46 ESP_LOGW(TAG,
"%s: The radio failed to set up, so nothing can be sent", this->
name_);
56 if (packet.size() > this->max_packet_size_) {
57 ESP_LOGV(TAG,
"%s: Packet of %zu bytes is larger than %zu, dropped", this->
name_, packet.size(),
58 this->max_packet_size_);
65 meta_data.
rssi = rssi;
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 enable_loop()
Enable this component's loop.
void disable_loop()
Disable this component's loop.
void received()
A packet arrived, so the peer has taken its turn.
void end_busy()
Ends the busy period, when the radio is seen to be free other than by a send.
void sent(uint32_t now, uint32_t pass)
A packet was sent, ending at now, in the loop pass that started at pass.
uint32_t busy_for(uint32_t now) const
How long the current busy period has lasted at now.
bool may_send(bool busy, uint32_t now, uint32_t pass)
True if a packet may be sent at now, in the loop pass that started at pass; busy says whether the rad...
A buffer class that efficiently represents a composite buffer with three sections:
void note_received_(bool understood)
Called by a layer for each received packet it understood, or could not make sense of.
const size_t max_packet_size_
void on_receive_from_interface_(const PacketBuffer &data, const PacketMetaData &meta_data)
This function should be called by implementing classes with received data to be passed to any listene...
void receive_(std::span< const uint8_t > packet, float rssi, float snr)
void radio_not_ready_(bool failed)
Warns once when a send finds the radio failed; until its setup has run, sends are refused quietly.
bool skip_empty_() const
Returns true for an empty packet, which the radios cannot send, so there is nothing to retry.
bool sent_(bool sent, bool busy)
Returns sent, after ending the busy period and warning if the packet was sent over a radio that seeme...
bool check_size_(size_t size) const
False if a packet of this size is too large.
ListenBeforeTalk listen_before_talk_
bool may_send_(bool busy)
False if sending must wait, as the radio is busy or the peer may be about to reply; starts loop() to ...
void radio_free_()
Ends the busy period when loop() finds the radio free.
virtual uint32_t current_time_ms() const
The time now, not the loop's start: earlier sends in the same loop pass may have waited seconds for t...
ESPHOME_LOG_TAG(TAG, "packet_interface.addressing")
Application App
Global storage of Application pointer - only one Application can exist.