[Rxtx] RXTXCommDriver.registerSpecifiedPorts

Francesco Agosti ago70 at yahoo.com
Sun Apr 22 12:43:19 MDT 2012


Hello, I am new around here, so, I am not sure how this process should work...

I am trying to have the RXTX working on BeagleBone, using the "internal" UARTS ttyO0..5 (with an usb virtual serial ttyUSB0 it worked smoothly, thanks to Otavio who ported the compiled part).

One of the things I bumped into is the registerSpecifiedPorts.
I have slightly modified it as visible below (added the StringTokenizer to parse all the possible ext folders if more than one is specified).
I might eventually come across some more trivial things like these ones, does it make sense that I "contribute" them?
If yes, how? (Is there a doc describing the process?)

Thanks.
Francesco

P.S. did anyone manage to have ttyOx working with RXTX on the BeagleBone?

...
try
    {
                      StringTokenizer extFolders = new StringTokenizer(System.getProperty("java.ext.dirs"),
                                                                      System.getProperty("path.separator",":"));
                     while (extFolders.hasMoreTokens())
                     {  
      String ext_dir=extFolders.nextToken()+System.getProperty("file.separator","/");
                      if ((new File(ext_dir+"gnu.io.rxtx.properties")).exists())
      {
                       if (debug) System.out.println("Lading "+ext_dir+"gnu.io.rxtx.properties");
                       FileInputStream rxtx_prop=new FileInputStream(ext_dir+"gnu.io.rxtx.properties");
       Properties p=new Properties();
       p.load(rxtx_prop);
       System.setProperties(p);
       for (Iterator it = p.keySet().iterator(); it.hasNext();) 
                       {
        String key = (String) it.next();
        System.setProperty(key, p.getProperty(key));
       }
                      }
                     } // end while
                    }catch(Exception e){
if (debug){
    System.out.println("The file: gnu.io.rxtx.properties doesn't exists.");
    System.out.println(e.toString());
    }//end if
                 }//end catch

...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20120422/1aa31cfc/attachment-0025.htm>


More information about the Rxtx mailing list