mirror of https://github.com/AxioDL/boo.git
Expose VID/PID APIs
This commit is contained in:
parent
cb99c05284
commit
50ee248391
|
@ -50,6 +50,11 @@ public:
|
||||||
bool sendUSBInterruptTransfer(const uint8_t* data, size_t length);
|
bool sendUSBInterruptTransfer(const uint8_t* data, size_t length);
|
||||||
size_t receiveUSBInterruptTransfer(uint8_t* data, size_t length);
|
size_t receiveUSBInterruptTransfer(uint8_t* data, size_t length);
|
||||||
|
|
||||||
|
inline unsigned getVendorId();
|
||||||
|
inline unsigned getProductId();
|
||||||
|
inline std::string_view getVendorName();
|
||||||
|
inline std::string_view getProductName();
|
||||||
|
|
||||||
/* High-Level API */
|
/* High-Level API */
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
#if !WINDOWS_STORE
|
#if !WINDOWS_STORE
|
||||||
|
|
|
@ -54,6 +54,34 @@ size_t DeviceBase::receiveUSBInterruptTransfer(uint8_t* data, size_t length)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned DeviceBase::getVendorId()
|
||||||
|
{
|
||||||
|
if (m_token)
|
||||||
|
return m_token->getVendorId();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned DeviceBase::getProductId()
|
||||||
|
{
|
||||||
|
if (m_token)
|
||||||
|
return m_token->getProductId();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string_view DeviceBase::getVendorName()
|
||||||
|
{
|
||||||
|
if (m_token)
|
||||||
|
return m_token->getVendorName();
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string_view DeviceBase::getProductName()
|
||||||
|
{
|
||||||
|
if (m_token)
|
||||||
|
return m_token->getProductName();
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
#if !WINDOWS_STORE
|
#if !WINDOWS_STORE
|
||||||
const PHIDP_PREPARSED_DATA DeviceBase::getReportDescriptor()
|
const PHIDP_PREPARSED_DATA DeviceBase::getReportDescriptor()
|
||||||
|
|
Loading…
Reference in New Issue