1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    1
    Vote Rating
    0
    hayden is on a distinguished road

      0  

    Default Can Adobe AIR accessing serial port?

    Can Adobe AIR accessing serial port?


    I just have made use of Adobe AIR .I want to use printer with air . Do air have some poperties to accessing serial port or usb?
    I look up that on the Adobe AIR documents.I only found 'Adobe

  2. #2
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    It does not support any kind of direct hardware access. I do not know if there are any plans for that in the future, but i doubt it. It may be possible to issue a print command to the internal webkit browser via javascript though.

  3. #3
    Ext User untunedman's Avatar
    Join Date
    Sep 2008
    Posts
    2
    Vote Rating
    0
    untunedman is on a distinguished road

      0  

    Default It is possible...

    It is possible...


    This is possible with a binary socket and serial proxy.

    Download this: http://download.berlios.de/arduino/s....bin.win32.zip

    Next, update the config file with the specific comport settings... baudrate, etc...

    Running this program will forward all serial port data to a specific tcp port, which you can then bind to within Air, using the air.Socket() object.

    Once you are ready, launch the proxy, then launch your air app. This would be cooler, if adobe let you launch an external program from within air.

    Here is a small example...

    Code:
    var serialPortApplication = function() {
    
        var socket;
        
        var onSocketData = function(event) {
            var data = socket.readUTFBytes(socket.bytesAvailable);
            air.trace(data); 
        };
    
        var createSocket = function() {
        
            socket = new air.Socket();
                socket.addEventListener( air.ProgressEvent.SOCKET_DATA, onSocketData ); 
    
            // this is the port specified in the serial proxy config file
                socket.connect( 'localhost', 5334 );
        
        };
        
        
        return {
    
            run   :   function() {
              createSocket();
            }
        
        };
        
    }();
    
    // Then....
    
    serialPortApplication.run();
    I am working on a pretty big Ext/Air app that interfaces with microcontrollers and sensors... let me know if you need anything else.

  4. #4
    Ext User
    Join Date
    Mar 2009
    Posts
    1
    Vote Rating
    0
    Ruhana is on a distinguished road

      0  

    Default


    I'm not too hot on this subject, but would it not be possible to use Binary Sockets to connect to another app on the machine that could connect to a serial port?

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    yevgen is on a distinguished road

      0  

    Default


    Quote Originally Posted by untunedman View Post
    This is possible with a binary socket and serial proxy.

    Download this: http://download.berlios.de/arduino/s....bin.win32.zip
    Do you know any similar proxy for parallel port. I would like to use it for work with a printer connected to LPT1.

  6. #6
    Ext User
    Join Date
    Jul 2009
    Posts
    1
    Vote Rating
    0
    digitronico is on a distinguished road

      0  

    Default


    Hi to everybody and hi untunedman,
    I've found your trick interesting, since I would like to implement a special controller for robotic servos, within a Flex application, in this case using AIR player.

    Quote Originally Posted by untunedman View Post
    This is possible with a binary socket and serial proxy.
    ...
    I am working on a pretty big Ext/Air app that interfaces with microcontrollers and sensors... let me know if you need anything else.
    I will need to send to COM some strings so I think that this way will be the right one.
    I'm a little bit confused on how to send commands to the soket... Actually I program on FLASH but I'm new in AIR and FLEX.

    Do you have some more example I can start from ? thank you very much!

  7. #7
    Ext User
    Join Date
    Jan 2010
    Posts
    1
    Vote Rating
    0
    aliyance is on a distinguished road

      0  

    Default


    Quote Originally Posted by yevgen View Post
    Do you know any similar proxy for parallel port. I would like to use it for work with a printer connected to LPT1.
    I am also trying to find a TCP/IP proxy to LPT1... (for the same reason as yevgen)

    Anyone have a solution to this?

  8. #8
    Sencha User
    Join Date
    Oct 2011
    Posts
    1
    Vote Rating
    0
    aidanmack is on a distinguished road

      0  

    Default Anyone done this in as3?

    Anyone done this in as3?


    Has anyone tried this in as3?
    When i run serproxy I get a connection was made, but my listener for data ("data recieved") never fires there after. The serial device in question sends out a package each second so i should be picking up on somthing.

    Any ideas?


    My code looks like this....

    Code:
    package com {    import flash.display.Sprite;
        import flash.events.*;
    	import flash.net.Socket;
        import flash.net.XMLSocket;
    
    
        public class XMLSocketSender extends Sprite {
            private var hostName:String = "localhost";
            private var port:uint = 5332;
            public var socket:Socket;
    		private var troot
    		
    
    
    
    
            public function XMLSocketSender(_troot) {
    			troot = _troot
    			socket = new Socket();
                configureListeners(socket);
                socket.connect(hostName, port);
            }
    
    
            public function send(data:Object):void {
                //socket.send(data);
    			
            }
    		
            private function configureListeners(dispatcher:IEventDispatcher):void {
                dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    			dispatcher.addEventListener(DataEvent.DATA, dataRecieved);
    			dispatcher.addEventListener(Event.CONNECT, shakeHand);
            }
    		
    		
    		
    		public function dataRecieved(e:DataEvent) {
    			trace("data recieved");			
    			troot.debugger.text += "DATA RECIEVED";
    		}
    		
    		public function shakeHand(e:Event) {
    			trace("connection made");
    			troot.debugger.text += "A CONNECTION WAS MADE";
    		}
    
    
            private function closeHandler(event:Event):void {
                trace("closeHandler: " + event);
    			troot.debugger.text += "</br>"+ event
            }
    
    
            private function connectHandler(event:Event):void {
                trace("connectHandler: " + event);
    			troot.debugger.text += "</br>connection made  "+event
    			//send("1"+sep+"V1.0"+end);
            }
    
    
            private function dataHandler(event:DataEvent):void {
                trace("dataHandler: " + event);
    			troot.debugger.text += "</br>handling data  "+event
    			//send("3");
            }
    
    
            private function ioErrorHandler(event:IOErrorEvent):void {
                trace("ioErrorHandler: " + event);
    			troot.debugger.text += "</br>  "+event
            }
    
    
            private function progressHandler(event:ProgressEvent):void {
                trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
    			troot.debugger.text += event
            }
    
    
            private function securityErrorHandler(event:SecurityErrorEvent):void {
                trace("securityErrorHandler: " + event);
    			troot.debugger.text += "</br>"+ event
            }
        }
    }

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar