src/cadMousePro.cpp
author František Kučera <franta-hg@frantovo.cz>
Sun, 18 Aug 2019 23:30:01 +0200
branchv_0
changeset 5 6799cec5c2f8
parent 4 405aa9de65d2
child 6 975f38eb1e12
permissions -rw-r--r--
refactoring: separate into several files

#include <iostream>

#include "CadMouseConfig.h"
#include "HID.h"

int main(int argc, char** argv) {
	try {

		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

		CadMouseConfig config;

		mouse.sendFeatureReport(config.serialize());

		return 0;
	} catch (const HIDException& e) {
		std::wcout << L"HIDException: " << e.getMessage() << std::endl;
		return 1;
	}
}