Multiple LabQuest Mini modules support

Skip to first unread message

Charles Xie

Mar 22, 2013, 12:36:44 PM3/22/13
Hi Scott:

Thanks to your tips, this now works beautifully! We can now use as many sensors as we want in our mixed reality apps.


Charles Xie

Mar 22, 2013, 9:38:02 PM3/22/13
I think the easiest thing for me to do now is to commit only two minor additions to and a new test. Since these changes are not substantial, I don't think we need to do a fork to get them into the main source. If I do end up having to do more, I will do it through a fork. But for now, a simple commit may be sufficient to make this capacity available.

What do you think, Scott?

Or you can just add the following two methods to

public String getDeviceName(int n) throws LabQuestException {
String ret  = getDeviceName(NGIOLibrary.DEVTYPE_LABQUEST_MINI, n);
if(ret != null) {
return ret;
return ret;

private String getDeviceName(int deviceType, int n) throws LabQuestException {
IntByReference listSig = new IntByReference();
IntByReference numDevices = new IntByReference();
int ret;
Pointer openDeviceListSnapshotHandle = 
ngio.openDeviceListSnapshot(hLibrary, deviceType, 
numDevices, listSig);
int num = numDevices.getValue();
if(num <= 0){
return null;
byte [] devNameBuf = new byte[NGIOLibrary.MAX_SIZE_DEVICE_NAME];
IntByReference deviceStatusMask = new IntByReference();
ret = ngio.deviceListSnapshot_GetNthEntry(openDeviceListSnapshotHandle, n, 
devNameBuf, devNameBuf.length, deviceStatusMask);
if(ret != 0){
throw new LabQuestException();

return Native.toString(devNameBuf);

Scott Cytacki

Mar 23, 2013, 8:05:55 AM3/23/13
to org-concord-sensor
Developers using github will fork a repo for a single line change, so I think your changes are definitely worth a fork. 
It really isn't hard.

Go to this page:

For your purposes I recommend creating a new local directory of your fork by following Steps 1 and 2
And push your changes into your fork.

Then send the sensor-projects a pull request:
That page is a bit long, all you really need to do is click the "pull request" button.

In the future, I can show you how you can create a fork and push your changes to it without having to make a new local directory and copy changes into it.

You received this message because you are subscribed to the Google
Groups "org-concord-sensor" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
Google Code project for org-concord-sensor:
You received this message because you are subscribed to the Google Groups "org-concord-sensor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Scott Cytacki
The Concord Consortium

Reply all
Reply to author
0 new messages