VirtualBox

source: vbox/trunk/src/VBox/Main/include/USBDeviceImpl.h@ 95294

Last change on this file since 95294 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: USBDeviceImpl.h 93115 2022-01-01 11:31:46Z vboxsync $ */
2/** @file
3 * Header file for the OUSBDevice (IUSBDevice) class, VBoxC.
4 */
5
6/*
7 * Copyright (C) 2006-2022 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_USBDeviceImpl_h
19#define MAIN_INCLUDED_USBDeviceImpl_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "USBDeviceWrap.h"
25
26/**
27 * Object class used for maintaining devices attached to a USB controller.
28 * Generally this contains much less information.
29 */
30class ATL_NO_VTABLE OUSBDevice :
31 public USBDeviceWrap
32{
33public:
34
35 DECLARE_COMMON_CLASS_METHODS(OUSBDevice)
36
37 HRESULT FinalConstruct();
38 void FinalRelease();
39
40 // public initializer/uninitializer for internal purposes only
41 HRESULT init(IUSBDevice *a_pUSBDevice);
42 void uninit();
43
44 // public methods only for internal purposes
45 const Guid &i_id() const { return mData.id; }
46
47private:
48
49 // Wrapped IUSBDevice properties
50 HRESULT getId(com::Guid &aId);
51 HRESULT getVendorId(USHORT *aVendorId);
52 HRESULT getProductId(USHORT *aProductId);
53 HRESULT getRevision(USHORT *aRevision);
54 HRESULT getManufacturer(com::Utf8Str &aManufacturer);
55 HRESULT getProduct(com::Utf8Str &aProduct);
56 HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
57 HRESULT getAddress(com::Utf8Str &aAddress);
58 HRESULT getPort(USHORT *aPort);
59 HRESULT getPortPath(com::Utf8Str &aPortPath);
60 HRESULT getVersion(USHORT *aVersion);
61 HRESULT getSpeed(USBConnectionSpeed_T *aSpeed);
62 HRESULT getRemote(BOOL *aRemote);
63 HRESULT getBackend(com::Utf8Str &aBackend);
64 HRESULT getDeviceInfo(std::vector<com::Utf8Str> &aInfo);
65
66 struct Data
67 {
68 Data() : vendorId(0), productId(0), revision(0), port(0),
69 version(1), speed(USBConnectionSpeed_Null),
70 remote(FALSE) {}
71
72 /** The UUID of this device. */
73 const Guid id;
74
75 /** The vendor id of this USB device. */
76 const USHORT vendorId;
77 /** The product id of this USB device. */
78 const USHORT productId;
79 /** The product revision number of this USB device.
80 * (high byte = integer; low byte = decimal) */
81 const USHORT revision;
82 /** The Manufacturer string. (Quite possibly NULL.) */
83 const com::Utf8Str manufacturer;
84 /** The Product string. (Quite possibly NULL.) */
85 const com::Utf8Str product;
86 /** The SerialNumber string. (Quite possibly NULL.) */
87 const com::Utf8Str serialNumber;
88 /** The host specific address of the device. */
89 const com::Utf8Str address;
90 /** The device specific backend. */
91 const com::Utf8Str backend;
92 /** The host port number. */
93 const USHORT port;
94 /** The host port path. */
95 const com::Utf8Str portPath;
96 /** The major USB version number of the device. */
97 const USHORT version;
98 /** The speed at which the device is communicating. */
99 const USBConnectionSpeed_T speed;
100 /** Remote (VRDP) or local device. */
101 const BOOL remote;
102 };
103
104 Data mData;
105};
106
107#endif /* !MAIN_INCLUDED_USBDeviceImpl_h */
108/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette