I think the easiest thing for me to do now is to commit only two minor additions to LabQuestLibrary.java 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.
public String getDeviceName(int n) throws LabQuestException {
searchForDevices();
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){
closeDeviceListSnapshot(openDeviceListSnapshotHandle);
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();
}
closeDeviceListSnapshot(openDeviceListSnapshotHandle);
return Native.toString(devNameBuf);
}