Firefox 控制CR

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Firefox 控制CR

文章 yehlu »

http://stackoverflow.com/questions/5920 ... erial-port

http://www.jsdb.org/

Javascript in particular, or just from the browser with some method? And which browser? (IE or Firefox?) Firefox plugins using XUL + javascript are pretty easy, although you'd still have to implement something in XPCOM (the Mozilla equivalent of ActiveX/COM) to work the RS232.

Alternatively you could use JSDB as an impromptu web server (on an alternate port of the local machine). It's ridiculously easy to use the RS232 port in JSDB:

c:\>jsdb
js>S=new Stream('com1://115200');
com1
js>S.write('\x00'); // send ASCII character 0 to the serial port
1
js>

So your browser-side implementation could just be whatever your favorite bookmark/link/thingy is that links to http://localhost:9999/comport/1 where 9999 is the port # JSDB is listening to, and "1" is the serial port switch. The JSDB code would listen to the port and send the appropriate RS232 command after parsing a GET request from the browser.
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Firefox 控制CR

文章 yehlu »

yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Firefox 控制CR

文章 yehlu »

yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Firefox 控制CR

文章 yehlu »

回覆文章

回到「PHP」