-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice_info.h
More file actions
38 lines (30 loc) · 1006 Bytes
/
device_info.h
File metadata and controls
38 lines (30 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <string>
#include <vector>
#include <cstdint>
struct USBDeviceInfo {
std::wstring name;
std::wstring description;
std::wstring devicePath;
std::wstring locationInfo;
uint16_t vendorId = 0;
uint16_t productId = 0;
uint32_t maxPowerMa = 0; // Power in milliamps
std::wstring getVidPidString() const;
std::wstring getDisplayString() const;
};
struct AudioDeviceInfo {
std::wstring id;
std::wstring name;
std::wstring description;
bool isOutput = true; // true = output (speakers), false = input (mic)
bool isActive = false;
bool isDefault = false;
std::wstring getDisplayString() const;
};
// USB device enumeration
std::vector<USBDeviceInfo> enumerateUSBDevices();
// Get device info from device path (for WM_DEVICECHANGE events)
USBDeviceInfo getUSBDeviceFromPath(const std::wstring& devicePath);
// Parse VID/PID from device path
bool parseVidPid(const std::wstring& devicePath, uint16_t& vid, uint16_t& pid);