#pragma once

#include <Windows.h>

// MCP2221A ‚Ì vender id, product id
const USHORT mcp2221a_vid = 0x04d8;
const USHORT mcp2221a_pid = 0x00dd;
const char dllname[] = "tap_switch.dll";
const wchar_t productname[] = L"TAP-RE34U SWITCHER";

const uint8_t SW_ON = 1;
const uint8_t SW_OFF = 0;

#ifdef __cplusplus
extern "C" {
#endif

//
// API prototype
//
	unsigned int __stdcall getMcp2221aNum(void);
	unsigned int __stdcall getTapSwitchNum(void);
	bool __stdcall getMcp2221aInfo(unsigned int index, std::wstring &manu, std::wstring &pro);
	bool __stdcall setMcp2221aForTapSwitch(unsigned int index);
	bool __stdcall switchTapSwitch(unsigned int index, uint8_t sw);

#ifdef __cplusplus
}
#endif

typedef unsigned int(__stdcall * _GETMCP2221ANUM)(void);
typedef unsigned int(__stdcall * _GETTAPSWITCHNUM)(void);
typedef bool(__stdcall * _GETMCP2221AINFO)(unsigned int, std::wstring &, std::wstring &);
typedef bool(__stdcall * _SETMCP2221AFORTAPSWITCH)(unsigned int);
typedef bool(__stdcall * _SWITCHTAPSWITCH)(unsigned int, uint8_t);