diff options
author | Sven Gothel <[email protected]> | 2015-03-21 23:01:12 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-21 23:01:12 +0100 |
commit | 0c5c4be020c2d55540058a49b2a879f46d5a1e13 (patch) | |
tree | 00f84c2ca18cc233b826014094b9cad0769a3ea5 /LibOVR/Src/OVR_Linux_HIDDevice.h | |
parent | cbbd775b6c754927632c333ff01424a0d2048c7c (diff) | |
parent | e490c3c7f7bb5461cfa78a214827aa534fb43a3e (diff) |
Merge branch 'vanilla_0.4.4' and resolve conflicts
TODO: Validate for removed patches due to relocation
Resolved Conflicts:
LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp
LibOVR/Src/OVR_Linux_HMDDevice.cpp
LibOVR/Src/OVR_OSX_HMDDevice.cpp
LibOVR/Src/OVR_Profile.cpp
LibOVR/Src/OVR_Sensor2Impl.cpp
LibOVR/Src/OVR_SensorFusion.cpp
LibOVR/Src/OVR_SensorImpl.cpp
LibOVR/Src/OVR_Win32_DeviceStatus.cpp
LibOVR/Src/OVR_Win32_HIDDevice.cpp
LibOVR/Src/OVR_Win32_HIDDevice.h
LibOVR/Src/OVR_Win32_HMDDevice.cpp
Diffstat (limited to 'LibOVR/Src/OVR_Linux_HIDDevice.h')
-rw-r--r-- | LibOVR/Src/OVR_Linux_HIDDevice.h | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/LibOVR/Src/OVR_Linux_HIDDevice.h b/LibOVR/Src/OVR_Linux_HIDDevice.h deleted file mode 100644 index 52f2d69..0000000 --- a/LibOVR/Src/OVR_Linux_HIDDevice.h +++ /dev/null @@ -1,135 +0,0 @@ -/************************************************************************************ -Filename : OVR_Linux_HIDDevice.h -Content : Linux HID device implementation. -Created : June 13, 2013 -Authors : Brant Lewis - -Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved. - -Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License"); -you may not use the Oculus VR Rift SDK except in compliance with the License, -which is provided at the time of installation or download, or which -otherwise accompanies this software in either electronic or hard copy form. - -You may obtain a copy of the License at - -http://www.oculusvr.com/licenses/LICENSE-3.1 - -Unless required by applicable law or agreed to in writing, the Oculus VR SDK -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -*************************************************************************************/ - -#ifndef OVR_LINUX_HIDDevice_h -#define OVR_LINUX_HIDDevice_h - -#include "OVR_HIDDevice.h" -#include "OVR_Linux_DeviceManager.h" -#include <libudev.h> - -namespace OVR { namespace Linux { - -class HIDDeviceManager; - -//------------------------------------------------------------------------------------- -// ***** Linux HIDDevice - -class HIDDevice : public OVR::HIDDevice, public DeviceManagerThread::Notifier -{ -private: - friend class HIDDeviceManager; - -public: - HIDDevice(HIDDeviceManager* manager); - - // This is a minimal constructor used during enumeration for us to pass - // a HIDDevice to the visit function (so that it can query feature reports). - HIDDevice(HIDDeviceManager* manager, int device_handle); - - virtual ~HIDDevice(); - - bool HIDInitialize(const String& path); - void HIDShutdown(); - - virtual bool SetFeatureReport(UByte* data, UInt32 length); - virtual bool GetFeatureReport(UByte* data, UInt32 length); - - // DeviceManagerThread::Notifier - void OnEvent(int i, int fd); - double OnTicks(double tickSeconds); - - bool OnDeviceNotification(MessageType messageType, - HIDDeviceDesc* device_info, - bool* error); - -private: - bool initInfo(); - bool openDevice(const char* dev_path); - void closeDevice(bool wasUnplugged); - void closeDeviceOnIOError(); - bool setupDevicePluggedInNotification(); - - bool InMinimalMode; - HIDDeviceManager* HIDManager; - int DeviceHandle; // file handle to the device - HIDDeviceDesc DevDesc; - - enum { ReadBufferSize = 96 }; - UByte ReadBuffer[ReadBufferSize]; - - UInt16 InputReportBufferLength; - UInt16 OutputReportBufferLength; - UInt16 FeatureReportBufferLength; -}; - - -//------------------------------------------------------------------------------------- -// ***** Linux HIDDeviceManager - -class HIDDeviceManager : public OVR::HIDDeviceManager, public DeviceManagerThread::Notifier -{ - friend class HIDDevice; - -public: - HIDDeviceManager(Linux::DeviceManager* Manager); - virtual ~HIDDeviceManager(); - - virtual bool Initialize(); - virtual void Shutdown(); - - virtual bool Enumerate(HIDEnumerateVisitor* enumVisitor); - virtual OVR::HIDDevice* Open(const String& path); - - static HIDDeviceManager* CreateInternal(DeviceManager* manager); - - void OnEvent(int i, int fd); - -private: - bool initializeManager(); - bool initVendorProductVersion(udev_device* device, HIDDeviceDesc* pDevDesc); - bool getPath(udev_device* device, String* pPath); - bool getIntProperty(udev_device* device, const char* key, int32_t* pResult); - bool getStringProperty(udev_device* device, - const char* propertyName, - OVR::String* pResult); - bool getFullDesc(udev_device* device, HIDDeviceDesc* desc); - bool GetDescriptorFromPath(const char* dev_path, HIDDeviceDesc* desc); - - bool AddNotificationDevice(HIDDevice* device); - bool RemoveNotificationDevice(HIDDevice* device); - - DeviceManager* DevManager; - - udev* UdevInstance; // a handle to the udev library instance - udev_monitor* HIDMonitor; - int HIDMonHandle; // the udev_monitor file handle - - Array<HIDDevice*> NotificationDevices; -}; - -}} // namespace OVR::Linux - -#endif // OVR_Linux_HIDDevice_h |