Skip to content

Commit

Permalink
fix: move callbacks after vid/pid query (#619)
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
  • Loading branch information
chaoslion committed Jun 9, 2020
1 parent 5e41765 commit 2182214
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OpenNI2-FreenectDriver/src/DeviceDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,17 @@ namespace FreenectDriver
strncpy(info.uri, uri.c_str(), ONI_MAX_STR);
strncpy(info.vendor, "Microsoft", ONI_MAX_STR);
strncpy(info.name, "Kinect", ONI_MAX_STR);
devices[info] = NULL;
deviceConnected(&info);
deviceStateChanged(&info, 0);
devices[info] = NULL;

freenect_device* dev;
if (freenect_open_device(m_ctx, &dev, i) == 0)
{
info.usbVendorId = dev->usb_cam.VID;
info.usbProductId = dev->usb_cam.PID;
freenect_close_device(dev);

deviceConnected(&info);
deviceStateChanged(&info, 0);
}
else
{
Expand Down

0 comments on commit 2182214

Please sign in to comment.