TwiceAsNice  2019-02-18
Functions
windozeHelpers Namespace Reference

namespace with helper functions for windows usb and win32api funcitons More...

Functions

bool EnumerateDevice (const uint16_t DeviceNum, HDEVINFO &deviceInfo, SP_DEVICE_INTERFACE_DATA &interfaceData, std::string &errMsg)
 
std::string GetLastWinError ()
 
bool Search4UsbDevice (const uint16_t DeviceNum)
 
void FetchUsbDevicePath (const uint16_t DeviceNum, CString &path)
 
void FetchUsbDriverVersion (const uint16_t DeviceNum, std::string &version)
 
void GetVidAndPid (const uint16_t DeviceNum, uint16_t &vid, uint16_t &pid)
 
std::vector< std::vector< uint16_t > > GetDevicesWin ()
 
bool IsDeviceAlreadyOpen (uint16_t deviceNum)
 

Detailed Description

namespace with helper functions for windows usb and win32api funcitons

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright(c) 2009 Apogee Instruments, Inc.

Function Documentation

◆ EnumerateDevice()

bool windozeHelpers::EnumerateDevice ( const uint16_t  DeviceNum,
HDEVINFO &  deviceInfo,
SP_DEVICE_INTERFACE_DATA &  interfaceData,
std::string &  errMsg 
)

◆ FetchUsbDevicePath()

void windozeHelpers::FetchUsbDevicePath ( const uint16_t  DeviceNum,
CString &  path 
)

Returns the UNC path for the Apogee device at the input DeviceNum. Throws a std::runtime exception if the device is not found.

Parameters
[in]DeviceNumDevice number to look for
[out]pathUNC device path

◆ FetchUsbDriverVersion()

void windozeHelpers::FetchUsbDriverVersion ( const uint16_t  DeviceNum,
std::string &  version 
)

◆ GetDevicesWin()

std::vector< std::vector<uint16_t> > windozeHelpers::GetDevicesWin ( )

◆ GetLastWinError()

std::string windozeHelpers::GetLastWinError ( )

Returns the result of the GetLastError function call as a std::string

Returns
std::string

◆ GetVidAndPid()

void windozeHelpers::GetVidAndPid ( const uint16_t  DeviceNum,
uint16_t vid,
uint16_t pid 
)

◆ IsDeviceAlreadyOpen()

bool windozeHelpers::IsDeviceAlreadyOpen ( uint16_t  deviceNum)

◆ Search4UsbDevice()

bool windozeHelpers::Search4UsbDevice ( const uint16_t  DeviceNum)

Searches for an Apogee with the input device number

Parameters
[in]DeviceNumDevice number to look for
Returns
true = device found, false = device not found.