×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / Help, I want to receive data from COM1 port , how can I achieve this in Java, is there bean or something else easy to use in VisualAge? Thanks
    • Don't understand why you want to do such a lower-level thing. I have no idea how to do it. I guess you need use JNI.
      • So, It's really easy in VC++, I just finished this staff, but boss ask me if we can move this staff thing to Java.
        • Sorry, I do not exactly how to do it. However, I can assure you that Java Native Interface be required here because your task is platform -dependent.
        • You can't and needn't to implement COM port coding in Java, just write it in c.And you can use CORBA to invoke C coding if you want to migrate your software to Java.
          • I agree the first part - write code in C
            It does not make sence using CORBA to access this small piece C code only to access the COM1 port.

            I agree with Jabber that JNI should be used.

            But the whole idea sounds like crazy. Why Java and the COM1 together?

            If you can treat the COM1 like a character stream (like in BASIC) you may possiblly use File/StreamReader to access the DOS device COM1 for read/write. But the quality of service may not be garanteed.
    • There's an individual package of Java2 Platform, it supports platform independent communications. For detail, go to http://java.sun.com/products/javacomm/ , GOOD LUCK!
      • Thanks a lot, guys.
        • BTW, are you in canada?