Commapi

Can anyone help me access /dev/ttyD00* on linux machines.
I have installed the javax.comm package and can access the normal /dev/ttyS0 etc. however we have attached to our machines a 'Digi' 8 port scsi adapter card. This means we have ports /dev/ttyD000 to /dev/ttyD007 available for devices. We currently use c drivers to access these ports, but we wish to do some r&d on java applications and need to be able to read from these ports. The commapi just does not know about these ports.
Any ideas?
regards
Syddie

Hi,
I m not sure but, maybe www.serialio.com has a solution for your case.

Similar Messages

  • How can i use the commapi in an signed applet

    I have a simple code of listing all system ports,
    the code works in a simple program
    but when I use it in a signed applet i have this error :
    java.lang.NoClassDefFoundError: javax/comm/CommDriver
    Thank you for your help

    Did you include the comm api jar file in the archive tag of your applet tag?
    something along the lines of:
    archive="myapplet.jar,commapi.jar"
    and make sure it is deployed in the same directory as your myapplet.jar.

  • Commapi Returns 3 Char Hex String.

    Hi Every body,
    I'm using the COMMAPI to talk to a serial port, and I'm getting the reponse the form of a 3 char string, with each of the char being in the range 0-F (obviously a Hex Digit).
    So Far I'm converting the string into a char array and looping througth and manually converting the valueds (which will always be three chars), so i'm doing a:
    Convert to Array.
    For (i=0; i<array.lerngth;i++) {
    if (i=1) then { MulValue = 256 }
    if (i=2) then { MulValue = 16 }
    if (i=3) then { mulValue = 1}
    if (char(i) = F) DigitValue = 15
    if (char(i) = A) DigitValue = 10
    if (char(i) = 0) DigitValue = 0
    char_value = DigitValue * MulValue.
    intVal = intValue+charValue.
    return intVal,
    Can anybody think ok a more effiecnt way of doing this?, i've looked througth the API but there doesn't seem to be anything directly useful.

    How about this:
    char c = (char) Integer.parseInt(threeCharHexString, 16);

  • Linux+Netbeans+Commapi

    after following the installation instructions on this site:
    http://www.syngress.com/book_catalog/177_lego_JAVA/sample.htm
    and using this $java -jar -Djava.library.path=/usr/lib -cp . BlackBox
    finally the blackbox example using commapi is working
    Now i'm developing an application in netbeans (on linux FC2) to send data to a PIC microcontroller through the serial port using the commapi and when i try to build it or run it throws this error:
    Error loading LinuxSerialParallel: java.lang.UnsatisfiedLinkError: no LinuxSerialParallel in java.library.path
    Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink
    at com.sun.comm.Unix.isDevLink(Native Method)
    at com.sun.comm.PathBundle.add(PathBundle.java:108)
    at com.sun.comm.PlatformPortBundle.<init>(PlatformPortBundle.java:44)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
    as far as i know it seems to be missing a library(LinuxSerialParallel), if that's right, how could i solve this problem? how can i add the missing library to java.library.path?
    thanks in advance!!

    Hello,
    I need your help... I am using Netbeans+Linux+J2sdk1.4.2_9+CommApi(v3.0 Linux).
    While trying to run SimpleRead, I found the following errors:
    Found port: /dev/ttyS4
    java.io.IOException: Erro getting StatusFlags in call to ioctl(TIOCMGET)
    at com.sun.comm.LinuxSerial.nativeGetStatusFlags(Native Method)
    at com.sun.comm.LinuxSerial.isCD(LinuxSerial.java:203)
    at com.sun.comm.LinuxSerial$SSCheckStatusThread.run(LinuxSerial.java:598)
    java.io.IOException: Not all params are supported by kernel
    at com.sun.comm.LinuxSerial.nativeSerialPortParams(Native Method)
    at com.sun.comm.LinuxSerial.setSerialPortParams(LinuxSerial.java:346)
    I am using VCP ftdi_sio for the /dev/ttyS4 comm port.
    Did you encounter this errors before??
    Any help will be appreciated.... :(

  • Elements 6.0 apdproxy.exe commapi.dll missing

    On system startup the error message reports that apdproxy.exe cannot start because commapi.dll is missing. The exe is related to the starter album in PS Elements 6.0.
    Lots of people are offering a free download of commapi.dll allong with some registry scanning/cleanup product which I do not want to mess with.
    I found about 3 registry entries involving apdproxy.exe. It would be fine with me to disable the program but I do not want to cause any system problems.
    Please point me to the correct procedure for disabling apdproxy.exe.
    TIA

    Look here:  Elements forum.

  • NullPointerException on SimpleWrite ( commapi )

    Hi,
    When trying to run the commapi "SimpleWrite" example on Windows 2000 I get a NullPointerException error. (I'm using tera term pro)
    On the same machine with the same setting I have no problem running the commapi "SerialDemo" example.
    Does anyone have any idea? suggestions?
    thank you in adavnce,
    haggai.

    The source code comes with the demos.

  • Java CommAPI and HyperTerminal?

    Hey, I am trying to hardcore my Java application called COMMAPI into Hyperterminal. The logic is that, my code will be connected to designated ports on my computer that can control the light system in my room. I created the app and it connects, reads, and writes data to and from the port "COM3" in question. However, i need to somehow create a Hyperterminal shortcut that run's off of the JAVA Code. I have seen this done in C already, where the code runs through Hyperterminal and it controls all the functions of the light in the room that are on COM3.
    my code is as follows:
    Is there anyway that i Can get the Java code to run through HyperTerminal so that it can connect to the Port ?
    Thanks in Advance.
    * SimpleWrite.java
    * Created on June 27, 2006, 11:50 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class SimpleWrite implements Runnable, SerialPortEventListener {
    static CommPortIdentifier portId;
    static String messageString = "s";
    static SerialPort serialPort;
    static OutputStream outputStream;
    static Thread readThread;
    static InputStream inputStream;
    private static String TimeStamp;
    public static void main(String[] args) {
    try {
    portId = CommPortIdentifier.getPortIdentifier("COM6");
    SimpleWrite reader = new SimpleWrite();
    } catch (Exception e) {
    TimeStamp = new java.util.Date().toString();
    System.out.println(TimeStamp + " Port type: " + portId.getName());
    public SimpleWrite() {
    try {
    TimeStamp = new java.util.Date().toString();
    serialPort = (SerialPort) portId.open("SimpleWrite", 2000);
    System.out.println(TimeStamp + " Port " + portId.getName() + " opened for Input");
    } catch (PortInUseException e) {
    System.out.println("Exception found in opening serialPort");
    try {
    inputStream = serialPort.getInputStream();
    } catch (IOException e) {
    System.out.println("Exception found in creating inputStream");
    try {
    serialPort.addEventListener(this);
    } catch (TooManyListenersException e) {
    System.out.println("Exception found in adding event Listener");
    serialPort.notifyOnDataAvailable(true);
    try {
    serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    serialPort.setDTR(true);
    serialPort.setRTS(true);
    System.out.println("Baud Rate is " + serialPort.getBaudRate());
    System.out.println("Data bits set to " + serialPort.getDataBits());
    System.out.println("Stop bits set to " + serialPort.getStopBits());
    System.out.println("Parity set to " + serialPort.getParity());
    } catch (UnsupportedCommOperationException e) {
    System.out.println("Exception in setting Com Parameters found");
    readThread = new Thread(this);
    readThread.start();
    try {
    outputStream = serialPort.getOutputStream();
    outputStream.write(messageString.getBytes());
    outputStream.close();
    catch (IOException e)
    System.out.println("Exception found in sending outputStream");
    public void run() {
    try {
    Thread.sleep(100);
    } catch (InterruptedException e) {}
    public void serialEvent(SerialPortEvent event) {
    switch(event.getEventType()) {
    case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
    break;
    case SerialPortEvent.DATA_AVAILABLE:
    System.out.println("Now in Case: Data_Available");
    StringBuffer readBuffer = new StringBuffer();
    int c;
    try {
    /*while ((c=inputStream.read()) != 10){
    System.out.println(c);
    if(c!=13) readBuffer.append((char) c);
    for (int i = 0; i < 1000 ; i++)
    c=inputStream.read();
    System.out.println(c);
    String scannedInput = readBuffer.toString();
    TimeStamp = new java.util.Date().toString();
    System.out.println(TimeStamp + ": scanned input received:" + scannedInput);
    inputStream.close();
    serialPort.close();
    } catch (IOException e) {
    System.out.println("Input/Outpu Exception found");
    break;
    //Read off of port.
    }

    You need to connect your computer through a null modem cable. Use the hyperterminal in your second computer to link to the computer that has your java program.
    then on "serialEvent" use the Data_Available criteria to get the byte streams.

  • JMF+COMMAPI, JMF+JTAPI+XTAPI OR JMF+JTAPI+ibm'sJ323

    Hi all,
    we are trying to develope a program for an operation center were the policemen will call the control centre from a private telephone line in the street. The operator must received the entrance calling and dispatch it to the right department, well more or less that's what the end user want us to make.
    Now we are at the dessign stage, so we need to test the best solution. First we though about using COMMAPI, so we tried to make a little application as a test. We can hung up the modem, or dial a number through the modem from the application. We are able to get the data the modem send us in an InputStream. Here begin the problems... Do you think this InputStream we receive from the modem is the human voice that apeaks from the telephone that made the call to the modem? Then, another problem that we couldn't solve... If this InpuStream is in fact the data (the voice) received by the modem how can we convert this into a DataSource class to be able to reproduce this in the computer. We've read and tried thousand of times to use the examples in the JMF solution's place, but we couln'd work it out. We think the example more similar to our is the 'Generate LiveStream', which uses LiveStream and a custom DataSource classes. But we don't know how to use LiveStream or DataSource to make them read from our InputStream each time the modem send us data.
    Then we though that maybe it would be faster to develope the test program using XTAPI, an implementation of JTAPI ... but It was impossible to get the next code working...
    JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(
    "net.xtapi.XJtapiPeer");
    myprovider = peer.getProvider("Serial");
    or(
    myprovider =peer.getProvider"net.xtapi.serviceProvider.OpenH323");
    Terminal[] t = myprovider.getTerminals();
    becouse there was no way the a Provider, t was null...
    Then I saw that some people were talking about using ibm's J323 and I tried with, becouse they said that JTAPI was an incomplete(?) implementation of the H323 specification. OK we download the trial version but... nothing, now we got the provider, but no Terminals are abailable. We 've tried everithing and we think everithing is installed propertly. We used:
    JtapiPeer peer = JtapiPeerFactory.getJtapiPeer("com.ibm.telephony.mm.MM_JtapiPeer");
    myprovider = peer.getProvider("H.323 Endpoint;login=223.254.254.94");
    Terminal[] t = myprovider.getTerminals();
    Although you have to pay for get a license of J323, the documentation and the support is so low.
    We think the better way to solve our problem is using COMMAPI, becouse it would give us a higher control over the application and the modem, but although we have though hard on convertin InputStream into DataSource, we cannot make it work.
    I'm DESPERADO, i will GIVE YOU 10 DUKES if you help us.
    We are loosing a lot of time on this and the boss thinks cannot understand why we are going so slow, and why there are so many problems. We see there's a lot of people posting similar problems, but there are no answers. Maybe this would help a lot of peolple on this matter.
    Thanks in advance.

    How can I integrate the jmf and the openh323 project? I want to do calls using the openh323 library and transmit/receive using the JMF. However the openh323, which uses the h.245 protocol for port and channel negociation, doesn't allow to use the ports that already were negociated. So, how can i transmit using JMF to these ports?
    Please, help me.

  • Jar & CommApi problem

    Hi,
    I have an application that uses Java Communications API (javax.comm.api) under Windows 2000. Everything works just fine when I use class files. But when I put classes into a jar file, the application can't find any ports.
    The CommApi documentation says: The javax.comm.properties file must be installed to your <jdk>/lib directory. If it is not, no ports will be found by the system.
    So, the problem clearly is how to make jar file that finds the specific file?
    This is how i packed my jar file:
    jar cfmv my.jar mymanifest.txt *.classmymanifest.txt looks like this:
    Manifest-Version: 1.0
    Main-Class: MyMainClass
    Class-Path: comm.jarcomm.jar contains CommApi classes.
    CommApi also needs win32comm.dll file, which should be installed into <jdk>/bin directory.
    Any help will be appreciated.

    Hello there,
    I'm facing this problem too.
    Scenario:
    I've build an application which uses javax.comm to connect to a given virtual serial port COMx.
    I've copied all 3 required files to specified paths:
    -comm.jar in ../jre/lib/ext/commapi (even in ../jre/lib/ext/)
    -javax.comm.properties in ../jre/lib/
    -win32comm.dll in ../jre/bin/ (even in ../jdk/bin/)
    And added the path to comm.jar in Compile-time Libraries in NetBeans
    When I'm running the application in NetBeans, it works. I get the available serial ports and can connect to them.
    But when I'm building the executable .jre file, no ports are found.
    The command:
    newportList = CommPortIdentifier.getPortIdentifiers();leaves newportList void.
    My manifest.mf file contains:
    Manifest-Version: 1.0
    Class-Path: lib/comm.jar lib/swing-layout-1.0.3.jar
    Main-Class: emailtosms.eMailtoSMSgui
    Ant-Version: Apache Ant 1.7.1
    Created-By: 11.3-b02 (Sun Microsystems Inc.)
    Also in /dist/lib/ directory i have both libraries (including comm.jar)
    By double clicking my jar application everything works, the GUI has no problems, a database connection (MySQL) can be established,
    except for the part that uses javax.comm api and no ports are found whatsoever.
    Any help is greatly appreciated!

  • JMF+JTAPI, JMF+COMMAPI or JMF+ibm's J323

    Hi all,
    I've tried and tried and tried... to use JMF and COMMAPI to read data from a modem. It's human voice data. I can read from an InputStream the bytes that modem receives so, I THINK that I'm getting the voice in the InputStream as bytes (please corret me if I'm wrong). Know the proble is to transform this InputStream in a DataSource. If tried with the example of jmf's page (LiveStream and DataSource), but I have no idea about converting the InputStream to DataSource, and 'play' the InputStream by the phones. Then I tried to use XTAPI implementation of JTAPI... but It was impossible to get the next code working...
    JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(
    "net.xtapi.XJtapiPeer");
    myprovider = peer.getProvider("Serial");
    or(
    myprovider =peer.getProvider"net.xtapi.serviceProvider.OpenH323");
    Terminal[] t = myprovider.getTerminals();
    becouse there was no way the a Provider...
    Then I saw that some people were talking about using ibm's J323 and I tried with, becouse they said that JTAPI was not :
    JtapiPeer peer = JtapiPeerFactory.getJtapiPeer("com.ibm.telephony.mm.MM_JtapiPeer");
    myprovider = peer.getProvider("H.323 Endpoint;login=223.254.254.94");
    Terminal[] t = myprovider.getTerminals();
    Using this I got the Provider, but, the getTerminals method return an empty array...
    I'm DESPERADO, i GIVE YOU 10 DUKES if you help me.
    I'm loosing a lot of time in this and my boss thinks I'm touching my nose in stead of working on this, becouse at this moment I have NOTHING.

    Two other places to find out about J323:
    http://www.zurich.ibm.com/csc/distribsys/j323/j323-2.html
    ---start quote---
    Can I use the IBM J323 Engine to control my modem?
    Can I use the IBM J323 Engine send a fax?
    No. The IBM J323 Engine is an implementation of the H.323 version 2 protocol as defined by the ITU-T (International Telecommunication Union). The H.323 protocol is a Voice over IP protocol. It is used to establish phone calls over an IP network (ex: internet). Therefore the J323 Engine will only communicate with H.323 endpoints. A H.323 endpoint can be a terminal (ex: Microsoft NetMeeting) or a gateway (to connect to the PSTN - Public Switched Telephony Netwok - which is the "normal" telephony network).
    ---end quote---
    Also, I when I run J323 demo-media.bat, the "-localaddr" argument seems to map to the "login=" part of the provider string, but this devolves to simply the string used to identify you when you contact other H.323 peers. The trace I get is:
    C:\Program Files\j323\bin>C:\Java\jdk\j2sdk1.4.2\bin\java -Djmf.package=com.ibm
    .media.teljmf.TjTmProvider -Dh323.endpoint.timer.factor=3 com.ibm.ct.cphone.Main
    -trace 1 -mtrace 2 -sdfile demo.sd -locaddr "<[email protected]>"
    CPhone: Obtaining JtapiPeer "null"...
    CPhone: Obtaining Provider "H.323 Endpoint;login=<[email protected]>"...
    Setting h323.endpoint.timer.factor to '3'
    IBM J323 Engine v5.0.0
    blah blah blah

  • Commapi problems

    hi, i'm having trouble installing the commapi files and use them with the NetBeans IDE. the main problem is that i cannot open the ports because, i believe, the IDE cannot see or use the win32com.dll file.
    any ideas on solving this problem are welcome
    thank you
    Pablo

    hi...
    there are many topics about that... and you need to be more specific plz... ;)
    try this:
    * put win32com.dll in the windows system directory...
    * put the java.comm.properties file accesible in the classpath (normally, is in the lib directory of you JRE instalation)...
    * is the comm api jar file in your classpath?...
    EOF

  • Question of commapi - BlackBox could not find serial port.

    Hi,
    I have installed jdk1.5.0_04 and commapi2.0_win32 at following directory
    c:\Java\netbeans-4.1
    c:\Java\jdk1.5.0_04
    c:\Java\commapi
    C:\Program Files\Java\jre1.5.0_04
    Then I do exactly what installation instruction ask me to do
    Copy win32com.dll to c:\Java\jdk1.5.0_04\bin
    Copy comm.jar to c:\Java\jdk1.5.0_04\lib
    Copy javax.comm.properties to c:\Java\jdk1.5.0_04\lib
    However, when I run BlackBox,BlackBox still gives me a message that
    says "No serial ports found!"
    Can any one help me out, thanks in advance ?
    Daniel

    Many forum posts about installation to java 1.4. Also see:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=453195
    and
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=444673
    I had success on winXP when I installed to the JRE below Program Files/java, no success when installed to c:\j2sdk etc etc.
    The directions for setting the classpath seem bogus; I did not need to specify a class path. Simply went to the commapi/samples/BlackBox folder, then typed java BlackBox. It found a couple of ports. I think this means that (despite the post in the forum to the contrary) that the comm API can deal with the NT hardware abstraction layer (HAL) just fine.
    I'm very new to this, hope this helps.
    chris...

  • CommAPI within servlet returns no known serial ports

    I've seen a number of postings for the use of COMMAPI within a servlet but have not yet seen a solution. Working within JBuilder 6, I'm using JDK 1.3.1_04-b02, Tomcat 3.2 and COMMAPI 2.0 on Windows 2000 Pro. Everything compiles fine and I don't get any exceptions.
    However, CommPortIdentifier.getPortIdentifiers() returns null. I've used the same code standalone with no problems.
    Is the security model getting in the way and do I need to disable or configure the security to allow access from a servlet to the serial ports? Perhaps a parameter within web.xml is required? Maybe an act of God?
    Please help as I'm sure a number of people, in addition to myself, would like to know once and for all how to solve this problem.
    PS. I've already tried unjarring the commapi jar file into the jre/lib directory without success.

    DrClap,
    Thanks for the advice. After some trial and error, I got it working. I came to the following conclusions via some experimentation.
    1. comm.jar is required in the Tomcat lib directory (c:\JBuilder6\jakarta-tomcat-3.2.3\lib) but not the JDK lib directory (c:\jdk1.3.1_04\lib).
    2. Similarly, javax.comm.properties is required in the Tomcat lib directory (c:\JBuilder6\jakarta-tomcat-3.2.3\lib) but not the JDK lib directory (c:\jdk1.3.1_04\lib).
    3. win32com.dll is required in both the JDK bin directory (c:\jdk1.3.1_04\bin) and the Tomcat bin directory (c:\JBuilder6\jakarta-tomcat-3.2.3\bin).
    4. Within JBuilder, library comm.jar must be included in the Tomcat 3.2 configuration. Go to Project->Project Properties...->Webserver tab->Setup...->Paths tab->Classes tab and then add the comm.jar library at the end of the list. Adding it to the global definition of Tomcat 3.2 (Tools->Configure Libraries..., etc) did not seem to achieve the desired result. Perhaps doing so would help with new projects though.
    Perhaps you could shed some light on why this arrangement works and how the JVM resolves the various dependencies?
    Thanks.
    Karl.

  • Commapi on laptop

    I have a laptop with a USB serial (RS232) adaptor (Hawking H-UC232S).
    The serial port is shown in Ports in Windows Hardware Manager and is working correctly.
    When I install commapi I can see no serial ports, As I have installed the same Java application and commapi on a similar desktop with no problems I think the problem is with the USB device.
    I have everything installed in the correct place, Classpath setup and the properties file correctly installed.
    Has anyone come across a similar problem??
    Any ideas on how I can overcome this??

    Can you copy & paste using the {Ctrl + C} and {Ctrl + V} keyboard commands?
    If not, see this: <br />
    https://support.mozilla.com/en-US/kb/Clipboard+not+working

  • Commapi problem

    Hi all,
    m working with java commapi and getting success in various parts but m stuck to one thing actually m running the sample application SimpleRead.java with COM1 port. when i run this programme it will continously giving me the response bytes on console, i mean it continously reads the data from the device.
    my problem is i want to read the data when my device performs some action.
    this is the code of SimpleRead.java
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class SimpleRead implements Runnable, SerialPortEventListener {
    static CommPortIdentifier portId;
    static Enumeration portList;
    public boolean stopListening = false;
    InputStream inputStream;
    SerialPort serialPort;
    Thread readThread;
    public static void main(String[] args) {
    portList = CommPortIdentifier.getPortIdentifiers();
    while (portList.hasMoreElements()) {
    portId = (CommPortIdentifier) portList.nextElement();
    if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
    if (portId.getName().equals("COM1")) {
    final SimpleRead reader = new SimpleRead();
    new Thread( reader ).start();
    System.out.println("Starting thread");
    TimerTask stopTimer =
    new TimerTask() {
    public void run() {
    System.out.println("Startrun ");
    reader.stopListening = true;
    reader.close();
    Timer timer = new Timer();
    System.out.println("New timer");
    timer.schedule( stopTimer, 10000 );
    System.out.println("Stop timer");
    if (portId.getName().equals("/dev/term/a")) {
    // reader = new SimpleRead();
    public SimpleRead() {
    try {
    serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
    catch (PortInUseException e) {
    try {
    inputStream = serialPort.getInputStream();
    catch (IOException e) {
    try {
    serialPort.addEventListener(this);
    catch (TooManyListenersException e) {
    serialPort.notifyOnDataAvailable(true);
    try {
    serialPort.setSerialPortParams(19200,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    catch (UnsupportedCommOperationException e) {
    System.out.print("parameters wrong");
    readThread = new Thread(this);
    readThread.start();
    System.out.println(inputStream);//////////////////////////////
    public void close()
    serialPort.close();
    public void run() {
    while(!stopListening){
    try {
    Thread.sleep(20000);
    catch (InterruptedException e) {
    public void serialEvent(SerialPortEvent event) {
    switch(event.getEventType()) {
    case SerialPortEvent.BI:
    case SerialPortEvent.OE:
    case SerialPortEvent.FE:
    case SerialPortEvent.PE:
    case SerialPortEvent.CD:
    case SerialPortEvent.CTS:
    case SerialPortEvent.DSR:
    case SerialPortEvent.RI:
    case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
    break;
    case SerialPortEvent.DATA_AVAILABLE:
    byte[] readBuffer = new byte[20];
    try {
    while (inputStream.available() > 0) {
    int numBytes = inputStream.read(readBuffer);
    System.out.print(new String(readBuffer));
    catch (IOException e) {
    break;
    please help me in this
    Thanx in advance
    varun arora

    Hey varunarora,
    Do you mean you only want to print the data from your device only after it does something specific, like emits a break signal?
    The way this is set up, the data is read when the event
    SerialPortEvent.DATA_AVAILABLE:
    happens - that is, when the device has put data on the serial line, and it gets buffered in your UART.
    the code for Printing what's being read is part of the SerialPortEvent.DATA_AVAILABLE case, so as soon as your device puts data on the serial line, it gets buffered in system, it triggers the DATA_AVAILABLE event, it gets read by your inputstream, buffered in numBytes, and finally you print it to the console. That happens whenever anything gets put on the data line, because DATA_AVAILABLE is always triggered.
    I'm not sure exactly what it is you're looking for, if there's data on the line do you want to ignore it until some event, or are you only interested in logging specific data?
    I'm not sure I've been any help at all, sorry :-)

Maybe you are looking for