4 Replies Latest reply on Jul 31, 2008 10:45 AM by Gregory Lafrance

    Serial Port

      I tried the search feature in this forum but i couldn't find anything about my question.
      Here it is, I hope i am posting it in the right place:

      Does anybody knows how we can communicate (read/write) with a serial port using Flex 2?
        • 1. Re: Serial Port
          jcamaney Level 1
          I will try one more time.
          I want to use FLEX to build a desktop application, this application will read data from a scale connected to the serial port and this data will be used in a chart on real time.
          The thing is, how can i read the Serial Port using FLEX.
          Thanks again.
          • 2. Serial Port
            schjlatah Level 1
            Try looking into Apollo now called AIR. It is touted to give full desktop functionality to Flex apps. I haven't tried, but I don't think you can access any local resources from Flex due to security or sandbox restrictions.
            Here is a link to the Adobe labs AIR (Adobe Integrated Runtime) page.
            This might be a viable solution for you.
            However if you do find a way to access serial devices in Flex 2, I'd be very interested in knowing how to do that.
            • 3. Re: Serial Port
              Hello... i need to resolve the same problem. I am developing a flex 2 application, a web application, and now users needs to connect to client terminals scales to interact with my system. It scales are connected by serial port to client computers.
              My system have a server side java system. I would like to use a java applet to execute some code to access to serial port... but it seems impossible! I guess it will not have access

              any suggestion??
              • 4. Re: Serial Port
                Gregory Lafrance Level 6
                Here is an AIR bug report. Don't know if it will be addressed:


                It would be great if AIR could access serial ports directly from the File API. Serial port access doesn't make much sense for Flex apps in a browser, but serial port access from AIR apps will open up a number of possibilities, including syncing to PDAs and phones, robotics control, and other electronic hobby projects.

                The C# 2005 framework offers a good stream-based interface for serial communication. http://www.codeproject.com/csharp/SerialCommunication.asp

                The main things add would be:
                1) Return a list of the known serial port device names strings (COMx devices for Windows, /dev/tty* devices for Mac and Linux)
                2) Open a named serial port
                3) Configure the serial port (baud rate, framing, and flow control)
                4) Maybe an API to generate a break condition on the line
                5) Basic read/write APIs
                6) Events for received data and for framing/parity errors.