This repository was archived by the owner on May 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
DeviceManager Programmer Notes
Guido Sanchez edited this page Apr 29, 2017
·
5 revisions
DeviceManager
Members
DeviceManagerConfigPtr m_config;
// OS specific implementation of hotplug notification
eDevicePlatformApiType m_platform_api_type;
IPlatformDeviceAPI *m_platform_api;
// List of registered hot-plug listeners
std::vector<DeviceHotplugListener> m_listeners;
class ControllerManager *m_controller_manager;
class TrackerManager *m_tracker_manager;
class HMDManager *m_hmd_manager;
Functions
bool startup(); /**< Initialize the interfaces for each specific manager. */
void update(); /**< Poll all connected devices for each specific manager. */
bool get_device_property(
const DeviceClass deviceClass,
const int vendor_id,
const int product_id,
const char *property_name,
char *buffer,
const int buffer_size);
void handle_device_connected(enum DeviceClass device_class, const std::string &device_path) override;
void handle_device_disconnected(enum DeviceClass device_class, const std::string &device_path) override;
DeviceTypeManager
Members
std::chrono::time_point<std::chrono::high_resolution_clock> m_last_reconnect_time;
std::chrono::time_point<std::chrono::high_resolution_clock> m_last_poll_time;
ServerDeviceViewPtr *m_deviceViews;
bool m_bIsDeviceListDirty;
Functions
virtual bool startup();
virtual void shutdown();
void poll();
virtual void publish();
/**
Returns an upcast device view ptr. Useful for generic functions that are
simple wrappers around the device functions:
open(), getIsOpen(), update(), close(), getIsReadyToPoll()
For anything that requires knowledge of the device, use the class-specific
Server<Type>ViewPtr get<Type>ViewPtr(int device_id) functions instead.
*/
ServerDeviceViewPtr getDeviceViewPtr(int device_id);
// IDeviceHotplugListener
void handle_device_connected(enum DeviceClass device_class, const std::string &device_path) override;
void handle_device_disconnected(enum DeviceClass device_class, const std::string &device_path) override;