@@ -89,7 +89,7 @@ void StackchanSystemConfig::loadConfig(fs::FS& fs, const char *yaml_filename) {
89
89
// JSONファイルが見つからない場合はデフォルト値を利用します。
90
90
setDefaultParameters ();
91
91
}
92
- if (_secret_config_filename > 0 ) {
92
+ if (_secret_config_filesize > 0 ) {
93
93
loadSecretConfig (fs, _secret_config_filename.c_str (), _secret_config_filesize);
94
94
}
95
95
if (_extend_config_filesize > 0 ) {
@@ -108,13 +108,13 @@ void StackchanSystemConfig::loadSecretConfig(fs::FS& fs, const char* yaml_filena
108
108
M5_LOGE (" yaml file read error: %s\n " , yaml_filename);
109
109
M5_LOGE (" error%s\n " , err.c_str ());
110
110
}
111
- if (_secret_info_show ) {
111
+ if (_secret_config_show ) {
112
112
// 個人的な情報をログに表示する。
113
113
M5_LOGI (" =======================================================================================" );
114
114
M5_LOGI (" 下記の情報は公開してはいけません。(The following information must not be disclosed.)" );
115
115
M5_LOGI (" " );
116
116
serializeJsonPretty (doc, Serial);
117
- setSecretSettings (doc);
117
+ setSecretConfig (doc);
118
118
M5_LOGI (" " );
119
119
printSecretParameters ();
120
120
M5_LOGI (" ここまでの情報は公開してはいけません。(No information should be disclosed so far.)" );
@@ -174,7 +174,7 @@ void StackchanSystemConfig::setSystemConfig(DynamicJsonDocument doc) {
174
174
_servo[AXIS_X].start_degree = 90 ;
175
175
_servo[AXIS_Y].start_degree = 90 ;
176
176
}
177
- _secret_info_show = doc[" sercret_info_show " ].as <bool >();
177
+ _secret_config_show = doc[" secret_config_show " ].as <bool >();
178
178
_secret_config_filename = doc[" secret_config_filename" ].as <String>();
179
179
_secret_config_filesize = doc[" secret_config_filesize" ];
180
180
_extend_config_filename = doc[" extend_config_filename" ].as <String>();
@@ -186,9 +186,9 @@ void StackchanSystemConfig::setSecretConfig(DynamicJsonDocument doc) {
186
186
_secret_config.wifi_info .ssid = doc[" wifi" ][" ssid" ].as <String>();
187
187
_secret_config.wifi_info .password = doc[" wifi" ][" password" ].as <String>();
188
188
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>();
192
192
193
193
}
194
194
@@ -216,8 +216,6 @@ void StackchanSystemConfig::printAllParameters() {
216
216
M5_LOGI (" move_max:%d" , _servo_interval[i].move_max );
217
217
}
218
218
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 ());
221
219
M5_LOGI (" Bluetooth_device_name:%s" , _bluetooth.device_name .c_str ());
222
220
M5_LOGI (" Bluetooth_starting_state:%s" , _bluetooth.starting_state ? " true" :" false" );
223
221
M5_LOGI (" Bluetooth_start_volume:%d" , _bluetooth.start_volume );
@@ -235,16 +233,17 @@ void StackchanSystemConfig::printAllParameters() {
235
233
M5_LOGI (" SecretConfigFileSize: %d" , _secret_config_filesize);
236
234
M5_LOGI (" ExtendConfigFileName: %s" , _extend_config_filename.c_str ());
237
235
M5_LOGI (" ExtendConfigFileSize: %d" , _extend_config_filesize);
236
+ M5_LOGI (" secret_config_show:%s" , _secret_config_show ? " true" :" false" );
238
237
239
238
printExtParameters ();
240
239
}
241
240
242
241
void StackchanSystemConfig::printSecretParameters () {
243
242
M5_LOGI (" wifi_ssid: %s" , _secret_config.wifi_info .ssid .c_str ());
244
243
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 ());
248
247
}
249
248
void StackchanSystemConfig::loadExtendConfig (fs::FS& fs, const char * filename, uint32_t yaml_size) { };
250
249
void StackchanSystemConfig::setExtendSettings (DynamicJsonDocument doc) { if ( _extend_config_filename == " " ) return ; };
0 commit comments