Skip to content

Commit

Permalink
OpenNI2-FreenectDriver: Expose USB VID/PID to OpenNI - fixes #422
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
  • Loading branch information
piedar committed Dec 2, 2014
1 parent 75ec2a6 commit 3c32fdb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions OpenNI2-FreenectDriver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set_target_properties(FreenectDriver PROPERTIES
add_definitions(-DPROJECT_VER="${PROJECT_VER}")

include_directories(extern/OpenNI-Linux-x64-2.2.0.33/Include)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/wrappers/cpp)

target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB})
Expand Down
13 changes: 13 additions & 0 deletions OpenNI2-FreenectDriver/src/DeviceDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <map>
#include <string>
#include "Driver/OniDriverAPI.h"
#include "freenect_internal.h"
#include "libfreenect.hpp"
#include "DepthStream.hpp"
#include "ColorStream.hpp"
Expand Down Expand Up @@ -254,6 +255,18 @@ namespace FreenectDriver
devices[info] = NULL;
deviceConnected(&info);
deviceStateChanged(&info, 0);

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);
}
else
{
WriteMessage("Unable to open device to query VID/PID");
}
}
return ONI_STATUS_OK;
}
Expand Down

0 comments on commit 3c32fdb

Please sign in to comment.