Discovering available comm ports

From Rxtx

Revision as of 06:45, 20 September 2007 by WgiD93 (Talk | contribs)
Jump to: navigation, search

Tavoli legno Labbra carnose Fotoromanzi erotici gratis Cazzi neri grossi Gambling poker Tettone free Sexocean Accessorio fotocamera digitali Gruppo continuita Barche vendita Vasco rossi Mature girls Anal fuck Prostitute tettone Cazzi di animali Offerta stage torino Video incesto sorella Busty mom Vendita supporto dvd r Adsl tv canale elenco gratis porno Tomtom mobile Sorteggio unire it Hot free sex ebony Hotel 4 stella sorrento Cane bulldog inglese allevamento Vera pokemon hentai Viaggio sharm el sheikh Bulma tette Scuola privata recitazione Spagna vacanza Adsl copertura rete Matita Latte miele radio Isvap Cerniera veneto Driver lexmark stampante Link http mondowrestling forum free net Gioiello cesare paciotti Toquinho Svezzamento bambino Gay orgy Destiny s child Pagamento bollo auto online Ww esselunga it Scopata amatoriale donna russa Pinne rondine Galassia Mondolibri Foot fetish extreme Troie xxx Configurare mms tim Jumpy it Pimbolo Brasiliane pompinare Porno fighe Tuttouomini nudi Coolio s babes Webalice it Gioco dell oca Alguer it Campeggio palinuro Frase di auguri primo compleanno Testi mermaid melody Canottaggio Fighe con animali Janis joplin Grasse ciccione Hotel agrigento Porno clip Sexy secretary Moto guzzi usata Cral sicilia Sofia loren nuda Video c18 Ragazze esibizioniste Crepes Tette bagnate Londra hotel Vacanza rodi Annuncio transex escort roma Il quotidiano di basilicata Hotel san vincenzo Www centoxcento it Lavatrici bosh Vendita mobili usati milano Arabe troie Rossana doll Simona valli pornostar Fondi pensioni unicredito Sicilia appartamento vacanza Pussy gallery Karaoke van basco Avana Edwige fenech Winfax freeware Tutto tette Whirpool it Robin hood Flower delivery Traduttore istantaneo ef 75300mm f4 0 5 6 iii fuck it versione femminile la mama spider man di buble canon ef 55200 dvd to vcd avi divx converter biblioteche udine capocchia wlan cf tesi macroeconomia goose game sizzla red rat mustek 1000 www giochi com maxtor onetouch 300 carta effetto velluto la guerra per bande router wifi adsl belkin hp psc1215 ram kingston 512mb ktt3311 siti di immagini di nudisti in spiaggia landi kotal we will rock you sony hi racconto eros scaricare suoneria nokia mandrake linux cd 1 cattolica albergo lancia lybra sw lx lexmark cartucce inkjet drago yagi antenna batterie per videocamere sony sank rock golf 5 gps bt bed and breckfast potenza poczuj to circolare ministeriale 2495 del 1954 mtaa 332 charli zaa trattamento delle acque apparecchi e impianti budapest viaggio hoplocampa pci 128 cu je cazo basi karaoke scaricare gratis fotocamere macro zoccole nude puttane troie asus a8n sli del orangutan mp3 da ascoltare tv monitor lcd padre padrone di gavino ledda giada de black nuda ingrid coronado mesa que mas aplauda viben le avventure di peter pan confessions 2 i ragazzi del cimitero ati amd portatili sector orologio occhiali dior inni militari decoder satellitari component scheda audio firewire incontri a civitavecchia meteo regionale visaya edyta bartosiewicz krzysztof krawczyk fille de 16 ans alex in pericolo semplicita carla urban hurghada vacanze enel 5 climax mesa que mas aplauda dvd home theatre denon valle roveto corato obiettivi sigma per nikon biografia monet microsoft 3 0 desica fare il dj gianciotto hp ipaq h2210 www fotosex com intel pentium 4 533mhz figuras literarias scuole superiori subiaco smoot criminal mujeres desnudas ram sdram 133 256mb prestatore di manodopera waltdisney pavarotti and friends mp3 e mp4 This code snippet shows how to iretrive the available comms ports on your computer. A CommPort is available if it is not being used by another application. Note the differrence between the two examples is that the version for JDK 5.0 up uses generics:

JDK <= 1.4

   /**
     * @return    A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
     */
    public static HashSet getAvailableSerialPorts() {
        HashSet h = new HashSet();
        Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
        while (thePorts.hasMoreElements()) {
            CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
            switch (com.getPortType()) {
            case CommPortIdentifier.PORT_SERIAL:
                try {
                    CommPort thePort = com.open("CommUtil", 50);
                    thePort.close();
                    h.add(com);
                } catch (PortInUseException e) {
                    System.out.println("Port, "   com.getName()   ", is in use.");
                } catch (Exception e) {
                    System.err.println("Failed to open port "   com.getName());
                    e.printStackTrace();
                }
            }
        }
        return h;
    }

JDK >= 5.0

   /**
     * @return    A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
     */
    public static HashSet<CommPortIdentifier> getAvailableSerialPorts() {
        HashSet<CommPortIdentifier> h = new HashSet<CommPortIdentifier>();
        Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
        while (thePorts.hasMoreElements()) {
            CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
            switch (com.getPortType()) {
            case CommPortIdentifier.PORT_SERIAL:
                try {
                    CommPort thePort = com.open("CommUtil", 50);
                    thePort.close();
                    h.add(com);
                } catch (PortInUseException e) {
                    System.out.println("Port, "   com.getName()   ", is in use.");
                } catch (Exception e) {
                    System.err.println("Failed to open port "   com.getName());
                    e.printStackTrace();
                }
            }
        }
        return h;
    }
Personal tools