- on_resp(): a truncated RESP that can't hold its claimed ret_len no longer
reports those (stale) buffer bytes as a valid return payload; it now returns
zero return bytes, matching on_recv's fail-closed behaviour.
- on_resp/on_recv/on_send: log malformed/too-short frames (WARN) and stale
post-timeout responses (VERBOSE) so wire-format drift between host and
co-processor is observable instead of surfacing only as opaque timeouts.
- esp_now_is_peer_exist(): log a warning when the RPC itself fails, so a
transport error is distinguishable from a genuinely absent peer (the native
bool signature still forces both to return false).
The header is shared verbatim with the C co-processor firmware, so its types
must use C's `typedef struct {...} name;` idiom and a C `<stdint.h>` include,
neither of which clang-tidy's C++ modernize checks accept. Wrap the struct
block in NOLINTBEGIN/END(modernize-use-using) and select <cstdint> vs
<stdint.h> on __cplusplus so both the C++ host build and the C firmware build
stay clean.
They are written from the main loop and read from the esp-hosted RX thread;
volatile matches the treatment of the g_resp_* globals and makes the
cross-thread visibility intent explicit (per review).
- ensure_setup(): gate on a dedicated g_setup_done flag set only after all
allocations and callback registrations succeed, so a partial failure can't
make a later call believe setup completed; semaphore creation is guarded so
a retry doesn't leak handles.
- esp_now_send(): reject (data=nullptr, len>0) with ESP_ERR_ESPNOW_ARG instead
of dereferencing null, matching native semantics.
- esp_now_set_wake_window(): return ESP_ERR_NOT_SUPPORTED rather than silently
claiming success for an unforwarded power-save setting.
ESP-NOW rides the Wi-Fi PHY, so on a radio-less esp32 variant the espnow
component would otherwise fail with an inscrutable "undefined reference to
esp_now_*" at link time. Fail fast in final validation instead: the P4 must
have the esp32_hosted shim, and other radio-less variants have no ESP-NOW
path at all. Adds a P4 esp32_hosted + espnow compile test and unit tests for
the new validation.
esp-hosted proxies esp_wifi.h but not esp_now.h, and esp_wifi_remote
injects the esp_now.h header on the P4 host with no implementation, so
the esp_now_* symbols are undefined at link. On a P4 host this defines
them and forwards each call to the co-processor over esp-hosted's
CustomRpc channel, letting the espnow component link and run unchanged.