We are implementing a Unity3D Mac/PC app that uses the Structure sensor via a C# wrapper around the core OpenNI2 oni…. functions. I would like the user to be able to plug and unplug their sensor from the computer and respond appropriately. I have passed callbacks to the oniRegisterDeviceCallbacks () function, but they are not getting called when a device is plugged in or unplugged.
The deviceConnected callback is being called one time at the very beginning during the call to oniInitialize, but after that it never gets called again. The deviceDisconnected and deviceStateChanged are never being called.
To verify that I was not doing something wrong calling the low level oni… functions, I have also tried the OpenNI DeviceConnectedListener, DeviceDisconnectedListener and DeviceStateChangedListener classes inside of a modified version of the SimpleRead sample application. The same behavior occurs. The device connected callback gets called once during initialization, and the other callbacks never get called.
Does the Structure driver not support these callbacks?
(Using OpenNI2 v2.2).