@@ -89,7 +89,7 @@ void StackchanSystemConfig::loadConfig(fs::FS& fs, const char *yaml_filename) {
8989 // JSONファイルが見つからない場合はデフォルト値を利用します。
9090 setDefaultParameters ();
9191 }
92- if (_secret_config_filename > 0 ) {
92+ if (_secret_config_filesize > 0 ) {
9393 loadSecretConfig (fs, _secret_config_filename.c_str (), _secret_config_filesize);
9494 }
9595 if (_extend_config_filesize > 0 ) {
@@ -108,13 +108,13 @@ void StackchanSystemConfig::loadSecretConfig(fs::FS& fs, const char* yaml_filena
108108 M5_LOGE (" yaml file read error: %s\n " , yaml_filename);
109109 M5_LOGE (" error%s\n " , err.c_str ());
110110 }
111- if (_secret_info_show ) {
111+ if (_secret_config_show ) {
112112 // 個人的な情報をログに表示する。
113113 M5_LOGI (" =======================================================================================" );
114114 M5_LOGI (" 下記の情報は公開してはいけません。(The following information must not be disclosed.)" );
115115 M5_LOGI (" " );
116116 serializeJsonPretty (doc, Serial);
117- setSecretSettings (doc);
117+ setSecretConfig (doc);
118118 M5_LOGI (" " );
119119 printSecretParameters ();
120120 M5_LOGI (" ここまでの情報は公開してはいけません。(No information should be disclosed so far.)" );
@@ -174,7 +174,7 @@ void StackchanSystemConfig::setSystemConfig(DynamicJsonDocument doc) {
174174 _servo[AXIS_X].start_degree = 90 ;
175175 _servo[AXIS_Y].start_degree = 90 ;
176176 }
177- _secret_info_show = doc[" sercret_info_show " ].as <bool >();
177+ _secret_config_show = doc[" secret_config_show " ].as <bool >();
178178 _secret_config_filename = doc[" secret_config_filename" ].as <String>();
179179 _secret_config_filesize = doc[" secret_config_filesize" ];
180180 _extend_config_filename = doc[" extend_config_filename" ].as <String>();
@@ -186,9 +186,9 @@ void StackchanSystemConfig::setSecretConfig(DynamicJsonDocument doc) {
186186 _secret_config.wifi_info .ssid = doc[" wifi" ][" ssid" ].as <String>();
187187 _secret_config.wifi_info .password = doc[" wifi" ][" password" ].as <String>();
188188
189- _secret_config.apikey .stt = doc[" apikey" ][" stt" ].as <String>();
190- _secret_config.apikey . aiservice = doc[" apikey" ][" aiservice" ].as <String>();
191- _secret_config.apikey .tts = doc[" apikey" ][" tts" ].as <String>();
189+ _secret_config.api_key .stt = doc[" apikey" ][" stt" ].as <String>();
190+ _secret_config.api_key . ai_service = doc[" apikey" ][" aiservice" ].as <String>();
191+ _secret_config.api_key .tts = doc[" apikey" ][" tts" ].as <String>();
192192
193193}
194194
@@ -216,8 +216,6 @@ void StackchanSystemConfig::printAllParameters() {
216216 M5_LOGI (" move_max:%d" , _servo_interval[i].move_max );
217217 }
218218 M5_LOGI (" mode_num:%d" , _mode_num);
219- M5_LOGI (" WiFi SSID: %s" , _wifi.ssid .c_str ());
220- M5_LOGI (" WiFi PASS: %s" , _wifi.password .c_str ());
221219 M5_LOGI (" Bluetooth_device_name:%s" , _bluetooth.device_name .c_str ());
222220 M5_LOGI (" Bluetooth_starting_state:%s" , _bluetooth.starting_state ? " true" :" false" );
223221 M5_LOGI (" Bluetooth_start_volume:%d" , _bluetooth.start_volume );
@@ -235,16 +233,17 @@ void StackchanSystemConfig::printAllParameters() {
235233 M5_LOGI (" SecretConfigFileSize: %d" , _secret_config_filesize);
236234 M5_LOGI (" ExtendConfigFileName: %s" , _extend_config_filename.c_str ());
237235 M5_LOGI (" ExtendConfigFileSize: %d" , _extend_config_filesize);
236+ M5_LOGI (" secret_config_show:%s" , _secret_config_show ? " true" :" false" );
238237
239238 printExtParameters ();
240239}
241240
242241void StackchanSystemConfig::printSecretParameters () {
243242 M5_LOGI (" wifi_ssid: %s" , _secret_config.wifi_info .ssid .c_str ());
244243 M5_LOGI (" wifi_passws: %s" , _secret_config.wifi_info .password .c_str ());
245- M5_LOGI (" apikey_stt: %s" , _secret_config.apikey .stt .c_str ());
246- M5_LOGI (" apikey_aiservice: %s" , _secret_config.apikey . aiservice .c_str ());
247- M5_LOGI (" apikey_tts: %s" , _secret_config.apikey .tts .c_str ());
244+ M5_LOGI (" apikey_stt: %s" , _secret_config.api_key .stt .c_str ());
245+ M5_LOGI (" apikey_aiservice: %s" , _secret_config.api_key . ai_service .c_str ());
246+ M5_LOGI (" apikey_tts: %s" , _secret_config.api_key .tts .c_str ());
248247}
249248void StackchanSystemConfig::loadExtendConfig (fs::FS& fs, const char * filename, uint32_t yaml_size) { };
250249void StackchanSystemConfig::setExtendSettings (DynamicJsonDocument doc) { if ( _extend_config_filename == " " ) return ; };
0 commit comments