+
+ ofstream configOutput;
+ configOutput.open("usb_2548_1001.xml");
+ if (configOutput.is_open())
+ {
+ CStdString strWakeDevices;
+ for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
+ if (g_config.wakeDevices[iPtr])
+ strWakeDevices.AppendFormat(" %d" + iPtr);
+ CStdString strStandbyDevices;
+ for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
+ if (g_config.powerOffDevices[iPtr])
+ strStandbyDevices.AppendFormat(" %d" + iPtr);
+
+ configOutput <<
+ "<settings>\n" <<
+ "\t<setting id=\"enabled\" value=\"1\" />\n" <<
+ "\t<setting id=\"activate_source\" value=\"" << (int)g_config.bActivateSource << "\" />\n" <<
+ "\t<setting id=\"wake_devices\" value=\"" << strWakeDevices.c_str() << "\" />\n" <<
+ "\t<setting id=\"standby_devices\" value=\"" << strStandbyDevices.c_str() << "\" />\n" <<
+ "\t<setting id=\"cec_standby_screensaver\" value=\"" << (int)g_config.bPowerOffScreensaver << "\" />\n" <<
+ "\t<setting id=\"standby_pc_on_tv_standby\" value=\"" << (int)g_config.bPowerOffOnStandby << "\" />\n" <<
+ "\t<setting id=\"use_tv_menu_language\" value=\"" << (int)g_config.bUseTVMenuLanguage << "\" />\n" <<
+ "\t<setting id=\"physical_address\" value=\"" << hex << g_config.iPhysicalAddress << "\" />\n" <<
+ "\t<setting id=\"cec_hdmi_port\" value=\"" << g_config.iHDMIPort << "\" />\n" <<
+ "\t<setting id=\"connected_device\" value=\"" << (int)g_config.baseDevice << "\" />\n" <<
+ "\t<setting id=\"port\" value=\"\" />\n" <<
+ "\t<setting id=\"send_inactive_source\" value=\"" << (int)g_config.bSendInactiveSource << "\" />\n" <<
+ "</settings>";
+ configOutput.close();
+
+ PrintToStdOut("The configuration has been stored in 'usb_2548_1001.xml'. Copy this file to ~/.userdata/peripheral_data to use it in XBMC");
+ }