C++
蒙塔基的钢蛋儿
这个作者很懒,什么都没留下…
展开
-
STM32 CANFD波特率计算器
STM32 CANFD波特率计算器原创 2022-07-31 15:29:00 · 2666 阅读 · 0 评论 -
STLWinUSB读写测试
#include <windows.h>#include "../STLWinUsb.h"#include <cassert>using namespace std;void CALLBACK UsbDeviceNotify(PTCHAR devicePath, DeviceChangeType_t dct, WORD vid, WORD pid){ wprintf(L"UsbDeviceNotify: devicePath:%ws,DeviceChange..原创 2021-04-22 18:11:53 · 179 阅读 · 0 评论 -
C++封装的WINUSB库:STLUsb支持热插拔检测
#include <windows.h>#include "../STLUSB.h"using namespace std;void CALLBACK UsbDeviceNotify(PTCHAR devicePath, DeviceChangeType_t dct, WORD vid, WORD pid){ wprintf(L"UsbDeviceNotify: devicePath:%ws,DeviceChangeType_t:%10ws,vid:0x%.4x,pi...原创 2021-04-21 19:33:25 · 954 阅读 · 0 评论 -
根据USB的DevicePath解析得到VID和PID的C++
wstring wdp(functionClassDeviceData->DevicePath); auto vidfind= wdp.find(L"vid_", 0); auto vidstr= L"0x"+wdp.substr(vidfind + 4, 4); auto vid = stoi(vidstr, 0, 16); auto pidfind = wdp.find(L"pid_", 0); auto pidstr = L"0x" + wdp.substr(pidfi.原创 2021-04-20 19:37:48 · 627 阅读 · 0 评论