eltorio / RtkGps

Playing with rtklib on android
Other
214 stars 102 forks source link

Support for multiple FTDI USB Ports in on device #3

Open tyler123durden opened 9 years ago

tyler123durden commented 9 years ago

It would be very nice if you could ad support for multiple USB serial ports in one FTDI device (eg FT2232). Thus one could choose the port to connect. This would be useful, because I have an NV08C with to serial ports connected to an FT2232 and the raw data port is on the second port. I think it wouldn't be much work, by giving an index to openByIndex():

private void connect()
{
  if (ftDev == null) {
    if (devCount > 0) //A compatible FTDI has been found (probably only one)
    {
      D2xxManager.FtDeviceInfoListNode[] deviceList = new D2xxManager.FtDeviceInfoListNode[devCount];
      ftD2xx.getDeviceInfoList(devCount, deviceList);
      if (ftDev == null) {
        ftDev = ftD2xx.openByIndex(this.parentContext, 0);
      } else {
        synchronized (ftDev) {
          ftDev = ftD2xx.openByIndex(this.parentContext, 0);
        }
      }
    }
  }
}

thomas
eltorio commented 9 years ago

Thanks a lot, sure I’ll add it, I reduce the upgrade rhythm due to some people comments, I’ll make a new version soon

Le 10 févr. 2015 à 11:23, Thomas Hartmann notifications@github.com a écrit :

It would be very nice if you could ad support for multiple USB serial ports in one FTDI device (eg FT2232). Thus one could choose the port to connect. This would be useful, because I have an NV08C with to serial ports connected to an FT2232 and the raw data port is on the second port. I think it wouldn't be much work, by giving an index to openByIndex():

private void connect() { if (ftDev == null) { if (devCount > 0) //A compatible FTDI has been found (probably only one) { D2xxManager.FtDeviceInfoListNode[] deviceList = new D2xxManager.FtDeviceInfoListNode[devCount]; ftD2xx.getDeviceInfoList(devCount, deviceList); if (ftDev == null) { ftDev = ftD2xx.openByIndex(this.parentContext, 0); } else { synchronized (ftDev) { ftDev = ftD2xx.openByIndex(this.parentContext, 0); } } } } } — Reply to this email directly or view it on GitHub https://github.com/eltorio/RtkGps/issues/3.

tyler123durden commented 9 years ago

Great, thanks in advance.