Skip to content

Commit 9958dc4

Browse files
committed
feat: version cmd change to output json
1 parent 39464e7 commit 9958dc4

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

main/boards/sensecap-watcher/sensecap_watcher.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -502,32 +502,32 @@ class SensecapWatcher : public WifiBoard {
502502
.func_w_context = [](void *context,int argc, char** argv) -> int {
503503
auto self = static_cast<SensecapWatcher*>(context);
504504
auto app_desc = esp_app_get_description();
505-
printf("type: xiaozhi agent\n");
506-
printf("version: %s\n", app_desc->version);
507-
printf("camera: %d\n",self->GetCamera() == nullptr ? 0 : 1);
508505
const char* region = "UNKNOWN";
509506
#if defined(CONFIG_LANGUAGE_ZH_CN)
510-
region = "CN";
507+
region = "CN";
511508
#elif defined(CONFIG_LANGUAGE_EN_US)
512-
region = "US";
509+
region = "US";
513510
#elif defined(CONFIG_LANGUAGE_JA_JP)
514-
region = "JP";
511+
region = "JP";
515512
#elif defined(CONFIG_LANGUAGE_ES_ES)
516-
region = "ES";
513+
region = "ES";
517514
#elif defined(CONFIG_LANGUAGE_DE_DE)
518-
region = "DE";
515+
region = "DE";
519516
#elif defined(CONFIG_LANGUAGE_FR_FR)
520-
region = "FR";
517+
region = "FR";
521518
#elif defined(CONFIG_LANGUAGE_IT_IT)
522-
region = "IT";
519+
region = "IT";
523520
#elif defined(CONFIG_LANGUAGE_PT_PT)
524-
region = "PT";
521+
region = "PT";
525522
#elif defined(CONFIG_LANGUAGE_RU_RU)
526-
region = "RU";
523+
region = "RU";
527524
#elif defined(CONFIG_LANGUAGE_KO_KR)
528-
region = "KR";
525+
region = "KR";
529526
#endif
530-
printf("region: %s\n", region);
527+
printf("{\"type\":0,\"name\":\"VER?\",\"code\":0,\"data\":{\"software\":\"%s\",\"hardware\":\"watcher xiaozhi agent\",\"camera\":%d,\"region\":\"%s\"}}\n",
528+
app_desc->version,
529+
self->GetCamera() == nullptr ? 0 : 1,
530+
region);
531531
return 0;
532532
},
533533
.context =this

0 commit comments

Comments
 (0)