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

+13 -13
View File
@@ -1,8 +1,8 @@
/*
* Exemplo ESP-RainMaker para ESP32
* Dispositivo: Interruptor Inteligente com controle via App e Nuvem
* 面向 ESP32 的 ESP-RainMaker 示例
* 设备:可通过应用和云端控制的智能开关
*
* Dependência (idf_component.yml):
* 依赖(idf_component.yml):
* espressif/esp_rainmaker: "^1.4.0"
*/
@@ -21,7 +21,7 @@
static const char *TAG = "app_rainmaker";
static esp_rmaker_device_t *switch_device;
/* Callback acionado quando o usuário altera o estado no App móvel */
/* 用户在移动应用中更改状态时触发的回调 */
static esp_err_t write_cb(const esp_rmaker_device_t *dev, const esp_rmaker_param_val_t val, void *priv_data, esp_rmaker_write_ctx_t *ctx)
{
if (ctx) {
@@ -31,14 +31,14 @@ static esp_err_t write_cb(const esp_rmaker_device_t *dev, const esp_rmaker_param
bool state = val.val.b;
ESP_LOGI(TAG, "Estado do interruptor alterado para: %s", state ? "LIGADO" : "DESLIGADO");
// Atualiza o parâmetro na nuvem e no aplicativo
// 更新云端和应用中的参数
esp_rmaker_param_update_and_report(priv_data, val);
return ESP_OK;
}
void app_main(void)
{
// Inicialização da memória não-volátil (NVS)
// 初始化非易失性存储(NVS)
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
@@ -46,30 +46,30 @@ void app_main(void)
}
ESP_ERROR_CHECK(err);
// Inicializa o provisionamento Wi-Fi
// 初始化 Wi-Fi 配网
app_wifi_init();
// Configura o nó RainMaker
// 配置 RainMaker 节点
esp_rmaker_config_t rainmaker_cfg = {
.enable_time_sync = true,
};
esp_rmaker_node_t *node = esp_rmaker_node_init(&rainmaker_cfg, "ESP32_SmartSwitch", "Switch");
// Cria o dispositivo padrão 'Switch'
// 创建默认的 'Switch' 设备
switch_device = esp_rmaker_switch_device_create("Luz Sala", NULL, true);
// Registra callback de escrita
// 注册写回调
esp_rmaker_device_add_cb(switch_device, write_cb, NULL);
esp_rmaker_node_add_device(node, switch_device);
// Habilita serviços adicionais (OTA e Timezone)
// 启用附加服务(OTA 和时区)
esp_rmaker_ota_enable_default();
esp_rmaker_timezone_service_enable();
// Inicia o agente RainMaker
// 启动 RainMaker 代理
esp_rmaker_start();
// Inicia o provisionamento Wi-Fi via BLE (abre no app oficial RainMaker)
// 通过 BLE 启动 Wi-Fi 配网(在官方 RainMaker 应用中打开)
app_wifi_start(POP_TYPE_RANDOM);
ESP_LOGI(TAG, "Nó RainMaker pronto! Escaneie o QR Code no app ESP RainMaker.");