VirtualBox

source: vbox/trunk/src/VBox/Main/testcase/tstUSBLinux.h@ 14981

Last change on this file since 14981 was 14711, checked in by vboxsync, 16 years ago

Devices/USB and Main: use hal and sysfs for Linux USB (currently disabled)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.2 KB
Line 
1/* $Id $ */
2/** @file
3 * VirtualBox USB Proxy Service class, test version for Linux hosts.
4 */
5
6/*
7 * Copyright (C) 2008 Sun Microsystems, Inc.
8 *
9 * Sun Microsystems, Inc. confidential
10 * All rights reserved
11 */
12
13
14#ifndef ____H_TSTUSBLINUX
15#define ____H_TSTUSBLINUX
16
17typedef int HRESULT;
18enum { S_OK = 0, E_NOTIMPL = 1 };
19
20#include <VBox/usb.h>
21#include <VBox/usbfilter.h>
22
23#include <VBox/err.h>
24
25#ifdef VBOX_USB_WITH_SYSFS
26# include "libhal.h"
27#endif
28
29#include <stdio.h>
30/**
31 * The Linux hosted USB Proxy Service.
32 */
33class USBProxyServiceLinux
34{
35public:
36 USBProxyServiceLinux() : mLastError(VINF_SUCCESS) {}
37 HRESULT initSysfs(void);
38 PUSBDEVICE getDevicesFromSysfs(void);
39 int getLastError(void) { return mLastError; }
40
41private:
42 int start(void) { return VINF_SUCCESS; }
43 static void freeDevice(PUSBDEVICE) {} /* We don't care about leaks in a test. */
44 int usbProbeInterfacesFromLibhal(const char *pszHalUuid, PUSBDEVICE pDev);
45 int mLastError;
46# ifdef VBOX_USB_WITH_SYSFS
47 /** Our connection to DBus for getting information from hal. This will be
48 * NULL if the initialisation failed. */
49 DBusConnection *mDBusConnection;
50 /** Handle to libhal. */
51 LibHalContext *mLibHalContext;
52# endif
53};
54
55#endif /* !____H_TSTUSBLINUX */
56
Note: See TracBrowser for help on using the repository browser.

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