🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #338

problem using seial port in

#338
From: Jeroen
Date: Sat, 21 Feb 2004 22:04
29 lines
1848 bytes
Hi,

For a project at school I need to read data from port COM2. I used som 
examples from internet and created a project on it. Running the app it 
looks like there is no COM port available.
This statment retuns null 
System.out.println((CommPortIdentifier)portList.nextElement());  Tried 
everything but something is missing.

selection of the code:
============================================
package talk2com;
import javax.comm.*;
import java.io.*;
import java.util.Enumeration;

public class Talk2Com {
   //Construct the application
   public Talk2Com(){
}

   public static void main(String[] args) throws NoSuchPortException {
     Enumeration portList = CommPortIdentifier.getPortIdentifiers();
     System.out.println((CommPortIdentifier)portList.nextElement());
}
===================================================================

Thanks Jeroen
jeroen.k@gmx.net
Technical Details
Message-ID: <4037d605@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,55cc7c15114d5e87,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2004-02-21 14:09:39 PST
Date: Sat, 21 Feb 2004 23:04:55 +0100
From: Jeroen <jeroen@nospam.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: problem using seial port in 
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 82.161.16.226
Message-ID: <4037d605@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1077401093 82.161.16.226 (21 Feb 2004 14:04:53 -0800)
Lines: 30
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail