feat(i18n): finish zh-CN example comments and align Strapping term with the glossary

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Sonnet 5.5 committed 2026-11-01 22:11:17 -03:00
1 parent 1d79051250
commit 2b73b57ee6
12 files changed
+84 -84

No files matched your search

+10 -10
View File
@@ -1,8 +1,8 @@
/*
* Exemplo ESP-NOW para ESP32
* Comunicação Sem Fio Ponto-a-Ponto e Broadcast sem roteador Wi-Fi
* 面向 ESP32 的 ESP-NOW 示例
* 无需 Wi-Fi 路由器的点对点无线通信和广播
*
* Protocolo nativo integrado no ESP-IDF
* ESP-IDF 内置的原生协议
*/
#include <stdio.h>
@@ -16,7 +16,7 @@
static const char *TAG = "esp_now_demo";
// Estrutura de dados enviada no pacote
// 数据包中发送的数据结构
typedef struct {
uint32_t sensor_id;
float temperatura;
@@ -24,16 +24,16 @@ typedef struct {
uint32_t tempo_ms;
} __attribute__((packed)) dados_pacote_t;
// Endereço MAC de Broadcast (envia para todos os nós ESP-NOW por perto)
// 广播 MAC 地址(发送给附近所有 ESP-NOW 节点)
static const uint8_t broadcast_mac[ESP_NOW_ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
/* Callback executado ao enviar um pacote */
/* 发送数据包时执行的回调 */
static void on_data_sent(const uint8_t *mac_addr, esp_now_send_status_t status)
{
ESP_LOGI(TAG, "Envio concluído: %s", status == ESP_NOW_SEND_SUCCESS ? "SUCESSO (ACK)" : "FALHA");
}
/* Callback executado ao receber um pacote de outro ESP32 */
/* 接收其他 ESP32 数据包时执行的回调 */
static void on_data_recv(const esp_now_recv_info_t *recv_info, const uint8_t *data, int len)
{
if (len == sizeof(dados_pacote_t)) {
@@ -47,7 +47,7 @@ static void on_data_recv(const esp_now_recv_info_t *recv_info, const uint8_t *da
void app_main(void)
{
// Inicializa NVS e Wi-Fi em modo Station
// 以 Station 模式初始化 NVS 和 Wi-Fi
nvs_flash_init();
esp_netif_init();
esp_event_loop_create_default();
@@ -56,12 +56,12 @@ void app_main(void)
esp_wifi_set_mode(WIFI_MODE_STA);
esp_wifi_start();
// Inicializa o protocolo ESP-NOW
// 初始化 ESP-NOW 协议
ESP_ERROR_CHECK(esp_now_init());
esp_now_register_send_cb(on_data_sent);
esp_now_register_recv_cb(on_data_recv);
// Registra o peer de Broadcast
// 注册广播对端
esp_now_peer_info_t peer_info = {
.channel = 1,
.ifidx = WIFI_IF_STA,