test: Rename zigbee_proxy to zigbee_proxy_tap

This commit is contained in:
puddly
2026-09-09 20:07:16 +00:00
parent 1c71adb6ca
commit 8aae67b7b2
16 changed files with 43 additions and 43 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ void USBUartComponent::loop() {
this->chunk_pool_.release(chunk);
// Invoke the RX callback (if registered) immediately after data lands in the
// ring buffer. This lets consumers such as ZigbeeProxy process incoming bytes
// ring buffer. This lets consumers such as ZigbeeProxyTap process incoming bytes
// in the same loop iteration they are delivered, avoiding an extra wakeup cycle.
if (channel->rx_callback_) {
channel->rx_callback_();
+1 -1
View File
@@ -160,7 +160,7 @@ class USBUartChannelBase : public uart::UARTComponent, public Parented<USBUartCo
/// Register a callback invoked immediately after data is pushed to the input ring buffer.
/// Called from USBUartComponent::loop() in the main loop context.
/// Allows consumers (e.g. ZigbeeProxy) to process bytes in the same loop iteration
/// Allows consumers (e.g. ZigbeeProxyTap) to process bytes in the same loop iteration
/// they arrive, eliminating one full main-loop-wakeup cycle of latency.
void set_rx_callback(std::function<void()> cb) { this->rx_callback_ = std::move(cb); }
@@ -10,9 +10,9 @@ DEPENDENCIES = ["serial_proxy"]
CONF_SERIAL_PROXY_ID = "serial_proxy_id"
zigbee_proxy_ns = cg.esphome_ns.namespace("zigbee_proxy")
ZigbeeProxy = zigbee_proxy_ns.class_(
"ZigbeeProxy", cg.Component, serial_proxy.SerialProxyTap
zigbee_proxy_tap_ns = cg.esphome_ns.namespace("zigbee_proxy_tap")
ZigbeeProxyTap = zigbee_proxy_tap_ns.class_(
"ZigbeeProxyTap", cg.Component, serial_proxy.SerialProxyTap
)
@@ -29,7 +29,7 @@ def _final_validate(config: ConfigType) -> ConfigType:
CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(ZigbeeProxy),
cv.GenerateID(): cv.declare_id(ZigbeeProxyTap),
cv.Required(CONF_SERIAL_PROXY_ID): cv.use_id(serial_proxy.SerialProxy),
}
).extend(cv.COMPONENT_SCHEMA)
@@ -42,6 +42,6 @@ async def to_code(config: ConfigType) -> None:
var = cg.new_Pvariable(config[CONF_ID], sp)
await cg.register_component(var, config)
cg.add_define("USE_ZIGBEE_PROXY")
cg.add_define("USE_ZIGBEE_PROXY_TAP")
# Compiles the tap interface into serial_proxy; without it the port is a plain byte pipe
cg.add_define("USE_SERIAL_PROXY_TAP")
@@ -1,8 +1,8 @@
#include "ash_detector.h"
#ifdef USE_ZIGBEE_PROXY
#ifdef USE_ZIGBEE_PROXY_TAP
namespace esphome::zigbee_proxy {
namespace esphome::zigbee_proxy_tap {
// Control byte of an RSTACK, and the only ASH version byte that can follow it
static constexpr uint8_t ASH_RSTACK_CONTROL = 0xC1;
@@ -245,6 +245,6 @@ bool AshDetector::take_pending_ack(uint8_t &ack_num) {
return true;
}
} // namespace esphome::zigbee_proxy
} // namespace esphome::zigbee_proxy_tap
#endif // USE_ZIGBEE_PROXY
#endif // USE_ZIGBEE_PROXY_TAP
@@ -1,14 +1,14 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_ZIGBEE_PROXY
#ifdef USE_ZIGBEE_PROXY_TAP
#include "ash_protocol.h"
#include <cstddef>
#include <cstdint>
namespace esphome::zigbee_proxy {
namespace esphome::zigbee_proxy_tap {
// Decides when it is safe to acknowledge NCP frames on a client's behalf.
//
@@ -99,6 +99,6 @@ class AshDetector {
bool ack_owed_{false};
};
} // namespace esphome::zigbee_proxy
} // namespace esphome::zigbee_proxy_tap
#endif // USE_ZIGBEE_PROXY
#endif // USE_ZIGBEE_PROXY_TAP
@@ -1,6 +1,6 @@
#include "ash_protocol.h"
namespace esphome::zigbee_proxy {
namespace esphome::zigbee_proxy_tap {
static const uint16_t CRC_NIBBLE_TABLE[16] = {0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF};
@@ -38,4 +38,4 @@ size_t ash_build_ack_frame(uint8_t *output, uint8_t ack_num) {
return pos;
}
} // namespace esphome::zigbee_proxy
} // namespace esphome::zigbee_proxy_tap
@@ -3,7 +3,7 @@
#include <cstddef>
#include <cstdint>
namespace esphome::zigbee_proxy {
namespace esphome::zigbee_proxy_tap {
// ASH Protocol Constants
static constexpr uint8_t ASH_FLAG_BYTE = 0x7E; // Frame delimiter
@@ -48,4 +48,4 @@ static constexpr size_t ASH_ACK_FRAME_MAX_SIZE = 8;
// ASH_ACK_FRAME_MAX_SIZE bytes, and returns its length.
size_t ash_build_ack_frame(uint8_t *output, uint8_t ack_num);
} // namespace esphome::zigbee_proxy
} // namespace esphome::zigbee_proxy_tap
@@ -1,18 +1,18 @@
#include "zigbee_proxy.h"
#include "zigbee_proxy_tap.h"
#ifdef USE_ZIGBEE_PROXY
#ifdef USE_ZIGBEE_PROXY_TAP
#include "esphome/core/log.h"
namespace esphome::zigbee_proxy {
namespace esphome::zigbee_proxy_tap {
static const char *const TAG = "zigbee_proxy";
static const char *const TAG = "zigbee_proxy_tap";
void ZigbeeProxy::setup() { this->parent_->set_tap(this); }
void ZigbeeProxyTap::setup() { this->parent_->set_tap(this); }
void ZigbeeProxy::dump_config() { ESP_LOGCONFIG(TAG, "Zigbee Proxy:\n Port: %s", this->parent_->get_name()); }
void ZigbeeProxyTap::dump_config() { ESP_LOGCONFIG(TAG, "Zigbee Proxy Tap:\n Port: %s", this->parent_->get_name()); }
void ZigbeeProxy::on_device_rx(const uint8_t *data, size_t len) {
void ZigbeeProxyTap::on_device_rx(const uint8_t *data, size_t len) {
for (size_t i = 0; i < len; i++) {
// Observation only: the detector never gates forwarding, so it adds no latency and a
// frame it cannot parse still reaches the client, which judges it for itself.
@@ -37,7 +37,7 @@ void ZigbeeProxy::on_device_rx(const uint8_t *data, size_t len) {
}
}
void ZigbeeProxy::on_client_tx(const uint8_t *data, size_t len) {
void ZigbeeProxyTap::on_client_tx(const uint8_t *data, size_t len) {
// Scanning this direction only matters while waiting for the version command that
// completes the handshake. Outside that window it is skipped entirely -- which is what
// makes a firmware upload, all of which flows this way, essentially free.
@@ -49,13 +49,13 @@ void ZigbeeProxy::on_client_tx(const uint8_t *data, size_t len) {
}
}
void ZigbeeProxy::on_protocol_disabled() {
void ZigbeeProxyTap::on_protocol_disabled() {
// A client turning protocol handling off is usually about to reflash the radio, so the
// handshake we saw says nothing about what will be on the wire next. Forget it: a real
// ASH session announces itself again with an RSTACK.
this->detector_.reset();
}
} // namespace esphome::zigbee_proxy
} // namespace esphome::zigbee_proxy_tap
#endif // USE_ZIGBEE_PROXY
#endif // USE_ZIGBEE_PROXY_TAP
@@ -1,13 +1,13 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_ZIGBEE_PROXY
#ifdef USE_ZIGBEE_PROXY_TAP
#include "esphome/components/serial_proxy/serial_proxy.h"
#include "esphome/core/component.h"
#include "ash_detector.h"
namespace esphome::zigbee_proxy {
namespace esphome::zigbee_proxy_tap {
// Acknowledges the ASH frames of an EZSP NCP on behalf of a remote client, so the NCP's
// ack timeout is measured against this device rather than against the network round trip
@@ -17,9 +17,9 @@ namespace esphome::zigbee_proxy {
// It never carries client traffic: the serial proxy owns the port and the bytes, and this
// component only observes them. The sole exception is the acknowledgement itself, and it
// is sent only once the handshake has proven the port really is carrying ASH.
class ZigbeeProxy : public serial_proxy::SerialProxyTap, public Component {
class ZigbeeProxyTap : public serial_proxy::SerialProxyTap, public Component {
public:
explicit ZigbeeProxy(serial_proxy::SerialProxy *parent) : parent_(parent) {}
explicit ZigbeeProxyTap(serial_proxy::SerialProxy *parent) : parent_(parent) {}
void setup() override;
void dump_config() override;
@@ -45,6 +45,6 @@ class ZigbeeProxy : public serial_proxy::SerialProxyTap, public Component {
bool was_armed_{false};
};
} // namespace esphome::zigbee_proxy
} // namespace esphome::zigbee_proxy_tap
#endif // USE_ZIGBEE_PROXY
#endif // USE_ZIGBEE_PROXY_TAP
+1 -1
View File
@@ -198,7 +198,7 @@
#define USE_VALVE
#define USE_WATER_HEATER
#define USE_WATER_HEATER_VISUAL_OVERRIDES
#define USE_ZIGBEE_PROXY
#define USE_ZIGBEE_PROXY_TAP
#define USE_ZWAVE_PROXY
#define USE_ZWAVE_PROXY_TAP
@@ -14,7 +14,7 @@ uart:
rx_pin: ${rx_pin}
baud_rate: 115200
# The port owns the UART and carries every byte; zigbee_proxy only taps it
# The port owns the UART and carries every byte; zigbee_proxy_tap only taps it
serial_proxy:
- id: zigbee_serial
uart_id: zigbee_uart
@@ -16,11 +16,11 @@ usb_uart:
baud_rate: 460800
# The tapped port may be a USB CDC ACM channel just as well as a hardware UART:
# zigbee_proxy never touches the UART itself, so it does not care which it is.
# zigbee_proxy_tap never touches the UART itself, so it does not care which it is.
serial_proxy:
- id: zigbee_usb_serial
uart_id: zigbee_usb_channel
name: Zigbee
zigbee_proxy:
zigbee_proxy_tap:
serial_proxy_id: zigbee_usb_serial
@@ -7,5 +7,5 @@ esp32:
<<: !include common.yaml
zigbee_proxy:
zigbee_proxy_tap:
serial_proxy_id: zigbee_serial
@@ -7,5 +7,5 @@ esp8266:
<<: !include common.yaml
zigbee_proxy:
zigbee_proxy_tap:
serial_proxy_id: zigbee_serial
@@ -4,5 +4,5 @@ substitutions:
<<: !include common.yaml
zigbee_proxy:
zigbee_proxy_tap:
serial_proxy_id: zigbee_serial