-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the ESP32 Echo Server use Inet #534
Make the ESP32 Echo Server use Inet #534
Conversation
} | ||
ESP_LOGI(TAG, "Socket created"); | ||
ESP_LOGI(TAG, "UDP packet received from %s:%u to %s:%u (%zu bytes)", src_addr, packet_info->SrcPort, dest_addr, | ||
packet_info->DestPort, static_cast<size_t>(buffer->DataLength())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: rather than calling buffer->DataLength()
repeatedly, I'd assign it to a const value at the top of the block and then use that const value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll push a follow-up.
static const char * TAG = "echo_client"; | ||
static const char * PAYLOAD = "Message from echo client!"; | ||
|
||
static void udp_client_task(void * pvParameters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to use InetLayer
for client (maybe in a follow on PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally chose not to use Inet on the first pass of this Client. I wanted the client to emulate a pure socket echo client. Mainly to demonstrate that the Server will respond to anything, not just things delivered via CHIP components.
Like you suggested, I might migrate it in a follow-up PR if we see fit.
LGTM |
Problem
The ESP32 WiFi-echo example doesn't use the InetLayer and so doesn't pass signals through the CHIP stack
Summary of Changes
fixes #533