mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 16:30:22 +00:00
Prefix the poll result enumerators, report a reset after connect as ECONNRESET, and test the set_sockaddr contract on host
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
esphome:
|
||||
name: socket-set-sockaddr
|
||||
on_boot:
|
||||
then:
|
||||
- lambda: |-
|
||||
// Exercise the contract callers rely on: 0 for text that is not an
|
||||
// address, the sockaddr length otherwise, broadcast included
|
||||
struct sockaddr_storage addr;
|
||||
auto *sa = reinterpret_cast<struct sockaddr *>(&addr);
|
||||
ESP_LOGI("test", "SET_SOCKADDR invalid=%u valid=%u broadcast=%u",
|
||||
(unsigned) socket::set_sockaddr(sa, sizeof(addr), "not an address", 1234),
|
||||
(unsigned) socket::set_sockaddr(sa, sizeof(addr), "192.0.2.1", 1234),
|
||||
(unsigned) socket::set_sockaddr(sa, sizeof(addr), "255.255.255.255", 1234));
|
||||
|
||||
host:
|
||||
api:
|
||||
logger:
|
||||
level: INFO
|
||||
Reference in New Issue
Block a user