VirtualBox

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

Last change on this file since 56720 was 56584, checked in by vboxsync, 10 years ago

Main/RemoteUSBDevice: convert to API wrapper usage

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