Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

DeviceManager Programmer Notes

Guido Sanchez edited this page Apr 30, 2017 · 5 revisions

Device Manager

This parent class contains and updates all of specific device managers for PSMoveService. It also is the front end for OS specific device queries.

Members

DeviceManagerConfig

IPlatformDeviceAPI

// OS specific implementation of hotplug notification

Controller Manager

Tracker Manager

HMD Manager

Functions

startup()

/**< Initialize the interfaces for each specific manager. */

update()

/**< Poll all connected devices for each specific manager. */

get_device_property()

handle_device_connected() / handle_device_disconnected()

DeviceTypeManager

Members

Last Reconnect Time

Last Poll Time

Device Views

ServerDeviceViewPtr

Device List Dirty Flag

Functions

startup()

shutdown()

poll()

publish()

ServerDeviceViewPtr getDeviceViewPtr(int device_id)

    /**
    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.
    */

handle_device_connected() / handle_device_disconnected()

ServerDeviceView

Members

Has Unpublished State Flag

Poll No Data Count

Sequence Number

Last New Data Timestamp

Device ID

Functions

open()

const class DeviceEnumerator *enumerator

close()

poll()

publish()

matchesDeviceEnumerator()

const class DeviceEnumerator *enumerator

getDevice()

    virtual IDeviceInterface*         

IDeviceInterface

Functions

matchesDeviceEnumerator()

Takes DeviceEnumerator Return true if device path matches

open()

// Opens the HID device for the device at the given enumerator

getIsReadyToPoll()

poll()

// Polls for new device data

getMaxPollFailureCount()

// Get the number of milliseconds we're willing to accept no data from the device before we disconnect it

getDeviceType()

// Returns what type of device CommonDeviceState::eDeviceType

getState()

virtual const CommonDeviceState * getState(int lookBack = 0) const = 0; 
// Fetch the device state at the given sample index.
// A lookBack of 0 corresponds to the most recent data.

Device Enumerator Programmer Notes

Clone this wiki locally