--- a/cadMousePro-daemon/src/cadMousePro.cpp Mon Aug 19 17:38:48 2019 +0200
+++ b/cadMousePro-daemon/src/cadMousePro.cpp Mon Aug 19 17:55:50 2019 +0200
@@ -27,16 +27,22 @@
CLI cli(argc, argv);
std::wcout << L"cadMousePro" << std::endl;
- HIDDevice mouse(0x256f, 0xc652, nullptr);
- std::wcout << L"mouse opened" << std::endl;
- std::wcout << L"manufacturer: " << mouse.getManufacturerName() << std::endl;
- std::wcout << L"product: " << mouse.getProductName() << std::endl;
- // std::wcout << L"serial number: " << mouse.getSerialNumber() << std::endl; // throws exception
CLIParser cliParser;
CLIConfiguration configuration = cliParser.parse(cli.arguments());
- mouse.sendFeatureReport(configuration.cadMouseConfig.serialize());
+ if (configuration.daemon) {
+ // TODO: run D-Bus service
+ std::wcout << L"will start daemon" << std::endl;
+ } else {
+ HIDDevice mouse(0x256f, 0xc652, nullptr);
+ std::wcout << L"mouse opened" << std::endl;
+ std::wcout << L"manufacturer: " << mouse.getManufacturerName() << std::endl;
+ std::wcout << L"product: " << mouse.getProductName() << std::endl;
+ // std::wcout << L"serial number: " << mouse.getSerialNumber() << std::endl; // throws exception
+
+ mouse.sendFeatureReport(configuration.cadMouseConfig.serialize());
+ }
return CLI::EXIT_CODE_SUCCESS;
} catch (const HIDException& e) {