@@ -33,6 +33,7 @@ SOFTWARE.
3333#include < iostream>
3434#include < string.h>
3535#include < thread>
36+ #include < set>
3637
3738using namespace std ;
3839
@@ -73,6 +74,7 @@ int main(int argc, char* argv[])
7374 std::string mqtt_broker_url = " tcp://localhost:1883" ;
7475 unsigned int max_charge_point_current = 32u ;
7576 unsigned int max_connector_current = 32u ;
77+ std::set<std::string> diag_files = {" ocpp.db" };
7678
7779 // Check parameters
7880 if (argc > 1 )
@@ -140,6 +142,19 @@ int main(int argc, char* argv[])
140142 argc--;
141143 max_connector_current = static_cast <unsigned int >(std::atoi (*argv));
142144 }
145+ else if ((strcmp (*argv, " -f" ) == 0 ) && (argc > 1 ))
146+ {
147+ argv++;
148+ argc--;
149+ // add all files in diag file list:
150+ diag_files.insert (*argv);
151+ while ((argc > 2 ) && (*argv[1 ] != ' -' ))
152+ {
153+ argv++;
154+ argc--;
155+ diag_files.insert (*argv);
156+ }
157+ }
143158 else
144159 {
145160 param = *argv;
@@ -168,14 +183,16 @@ int main(int argc, char* argv[])
168183 std::cout << " -b : URL of the MQTT broker (Default = tcp://localhost:1883)" << std::endl;
169184 std::cout << " -m : Max current in A for the whole Charge Point (Default = 32A)" << std::endl;
170185 std::cout << " -i : Max current in A for a connector of the Charge Point (Default = 32A)" << std::endl;
186+ std::cout << " -f : Files to put in diagnostic zip. Absolute path or relative path from working directory. " << std::endl;
187+ std::cout << " Default = [ocpp.db]" << std::endl;
171188 return 1 ;
172189 }
173190 }
174191
175192 // Open configuration file
176193 std::filesystem::path path (working_dir);
177194 path /= " config.ini" ;
178- SimulatedChargePointConfig config (working_dir, path.string ());
195+ SimulatedChargePointConfig config (working_dir, path.string (), diag_files );
179196
180197 // Update configuration file
181198 std::filesystem::path db_path (working_dir);
0 commit comments