Vuo  2.0.0
Functions | Variables
VuoHidDevices.cc File Reference

Description

VuoHid implementation.

Definition in file VuoHidDevices.cc.

Go to the source code of this file.

Functions

void VuoHid_getDeviceUsage (IOHIDDeviceRef device, uint32_t *usagePage, uint32_t *usage)
 Given a device, returns its usagePage and usage. More...
 
void VuoHid_getDeviceDescription (IOHIDDeviceRef device, VuoText *manufacturer, VuoText *product, VuoInteger *vendorID, VuoInteger *productID)
 Given a device, returns strings describing its manufacturer and product model. More...
 
VuoInteger VuoHid_getLocation (void *d)
 Given an IOHIDDeviceRef, returns its hopefully-unique Vuo-specific location (based on kIOHIDLocationIDKey and kUSBInterfaceNumber). More...
 
bool VuoHid_isElementValid (void *e)
 Returns true if the specified IOHIDElementRef is valid (contains usable data). More...
 
VuoHidControl VuoHid_getControlForElement (void *e)
 Creates a VuoHidControl from the values of the specified IOHIDElementRef. More...
 
VuoList_VuoHidDevice VuoHid_getDeviceList (void)
 Returns a list of the currently-avaialble HID devices. More...
 
static void VuoHid_devicesChanged (void *context, IOReturn result, void *sender, IOHIDDeviceRef device)
 Invoked by the IONotification system when a HID device is added or removed. More...
 
void VuoHid_use (void)
 Indicates that the caller needs to get notifications about HID devices. More...
 
void VuoHid_disuse (void)
 Indicates that the caller no longer needs notifications about HID devices. More...
 
void VuoHid_addDevicesChangedTriggers (VuoOutputTrigger(devices, VuoList_VuoHidDevice))
 Adds a trigger callback, to be invoked whenever the list of known HID devices changes. More...
 
void VuoHid_removeDevicesChangedTriggers (VuoOutputTrigger(devices, VuoList_VuoHidDevice))
 Removes a trigger callback previously added by VuoHid_addDevicesChangedTriggers. More...
 

Variables

static VuoTriggerSet< VuoList_VuoHidDeviceVuoHid_deviceCallbacks
 Trigger functions to call when the list of devices changes. More...
 
unsigned int VuoHid_useCount = 0
 Process-wide count of callers (typically node instances) interested in notifications about Hid devices. More...
 
IOHIDManagerRef VuoHid_manager
 Manages notifications about HID devices. More...
 
bool VuoHid_devicesChangedCalled = false
 Has VuoHid_devicesChanged been called since our HID Manager was initialized? More...
 
bool VuoHid_devicesChangedInitialized = false
 Has HID Manager initialization completed? More...
 

Function Documentation

◆ VuoHid_addDevicesChangedTriggers()

void VuoHid_addDevicesChangedTriggers ( VuoOutputTrigger(devices, VuoList_VuoHidDevice )

Adds a trigger callback, to be invoked whenever the list of known HID devices changes.

Call VuoHid_use() before calling this.

This function may be called from any thread.

Definition at line 457 of file VuoHidDevices.cc.

◆ VuoHid_devicesChanged()

static void VuoHid_devicesChanged ( void *  context,
IOReturn  result,
void *  sender,
IOHIDDeviceRef  device 
)
static

Invoked by the IONotification system when a HID device is added or removed.

Definition at line 366 of file VuoHidDevices.cc.

◆ VuoHid_disuse()

void VuoHid_disuse ( void  )

Indicates that the caller no longer needs notifications about HID devices.

This function may be called from any thread.

Definition at line 437 of file VuoHidDevices.cc.

◆ VuoHid_getControlForElement()

VuoHidControl VuoHid_getControlForElement ( void *  e)

Creates a VuoHidControl from the values of the specified IOHIDElementRef.

Definition at line 191 of file VuoHidDevices.cc.

◆ VuoHid_getDeviceDescription()

void VuoHid_getDeviceDescription ( IOHIDDeviceRef  device,
VuoText manufacturer,
VuoText product,
VuoInteger vendorID,
VuoInteger productID 
)

Given a device, returns strings describing its manufacturer and product model.

Definition at line 76 of file VuoHidDevices.cc.

◆ VuoHid_getDeviceList()

VuoList_VuoHidDevice VuoHid_getDeviceList ( void  )

Returns a list of the currently-avaialble HID devices.

Definition at line 215 of file VuoHidDevices.cc.

◆ VuoHid_getDeviceUsage()

void VuoHid_getDeviceUsage ( IOHIDDeviceRef  device,
uint32_t *  usagePage,
uint32_t *  usage 
)

Given a device, returns its usagePage and usage.

Definition at line 50 of file VuoHidDevices.cc.

◆ VuoHid_getLocation()

VuoInteger VuoHid_getLocation ( void *  d)

Given an IOHIDDeviceRef, returns its hopefully-unique Vuo-specific location (based on kIOHIDLocationIDKey and kUSBInterfaceNumber).

Definition at line 136 of file VuoHidDevices.cc.

◆ VuoHid_isElementValid()

bool VuoHid_isElementValid ( void *  e)

Returns true if the specified IOHIDElementRef is valid (contains usable data).

Definition at line 162 of file VuoHidDevices.cc.

◆ VuoHid_removeDevicesChangedTriggers()

void VuoHid_removeDevicesChangedTriggers ( VuoOutputTrigger(devices, VuoList_VuoHidDevice )

Removes a trigger callback previously added by VuoHid_addDevicesChangedTriggers.

This function may be called from any thread.

Definition at line 468 of file VuoHidDevices.cc.

◆ VuoHid_use()

void VuoHid_use ( void  )

Indicates that the caller needs to get notifications about HID devices.

This function may be called from any thread.

Definition at line 380 of file VuoHidDevices.cc.

Variable Documentation

◆ VuoHid_deviceCallbacks

VuoTriggerSet<VuoList_VuoHidDevice> VuoHid_deviceCallbacks
static

Trigger functions to call when the list of devices changes.

Definition at line 44 of file VuoHidDevices.cc.

◆ VuoHid_devicesChangedCalled

bool VuoHid_devicesChangedCalled = false

Has VuoHid_devicesChanged been called since our HID Manager was initialized?

Definition at line 360 of file VuoHidDevices.cc.

◆ VuoHid_devicesChangedInitialized

bool VuoHid_devicesChangedInitialized = false

Has HID Manager initialization completed?

Definition at line 361 of file VuoHidDevices.cc.

◆ VuoHid_manager

IOHIDManagerRef VuoHid_manager

Manages notifications about HID devices.

Definition at line 359 of file VuoHidDevices.cc.

◆ VuoHid_useCount

unsigned int VuoHid_useCount = 0

Process-wide count of callers (typically node instances) interested in notifications about Hid devices.

Definition at line 358 of file VuoHidDevices.cc.