View Full Version : Can Adobe AIR accessing serial port?
hayden
05-28-2008, 04:55 AM
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
devnull
05-28-2008, 11:09 AM
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.
untunedman
03-13-2009, 01:05 AM
This is possible with a binary socket and serial proxy.
Download this: http://download.berlios.de/arduino/serproxy-0.1.3-3.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...
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.
Ruhana
03-21-2009, 02:25 AM
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?
yevgen
06-23-2009, 02:54 PM
This is possible with a binary socket and serial proxy.
Download this: http://download.berlios.de/arduino/serproxy-0.1.3-3.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.
digitronico
07-15-2009, 10:37 AM
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. :)
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.=D>
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!
aliyance
01-13-2010, 03:02 AM
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) :D
Anyone have a solution to this?
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.