polling serial port data through javascript

Discussion in 'Javascript' started by Ajinkya, Jan 7, 2008.

  1. Ajinkya

    Ajinkya Guest

    How can I poll for serial port data using javascript ?
    Ajinkya, Jan 7, 2008
    #1
    1. Advertising

  2. On Sun, 06 Jan 2008 20:43:06 -0800, Ajinkya wrote:

    > How can I poll for serial port data using javascript ?


    Within the web browser, you can't.

    Under Windows, there may be access to a scripting object that can access
    the serial ports. I would ask in microsoft.public.scripting.wsh

    If this MUST be done in a web browser, the best option is to run a
    separate program to read in the serial data and write it to a text file.
    The web browser can use HttpXMLRequest to re-read the file as needed.

    Might I ask why you need to do this?
    Jeremy J Starcher, Jan 7, 2008
    #2
    1. Advertising

  3. Jeremy J Starcher wrote:
    > On Sun, 06 Jan 2008 20:43:06 -0800, Ajinkya wrote:
    >> How can I poll for serial port data using javascript ?

    >
    > Within the web browser, you can't.


    Yes, you can. What is required is only a fitting API that provides language
    binding for (the) ECMAScript implementation(s).

    > Under Windows, there may be access to a scripting object that can access
    > the serial ports. I would ask in microsoft.public.scripting.wsh


    And there is no reason why you could not use that "scripting object"
    (actually an ActiveX/COM object) from within MSHTML, may it be Internet
    Explorer or an HTA. There is also XUL to consider for Gecko-based UAs.


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$>
    Thomas 'PointedEars' Lahn, Jan 7, 2008
    #3
  4. Ajinkya

    The Magpie Guest

    Ajinkya wrote:
    > How can I poll for serial port data using javascript ?
    >

    Yes you can, but you need an API to call. I can't give more details,
    but I know a man who can - he did it to poll a serial printer port.
    The Magpie, Jan 7, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roberto
    Replies:
    0
    Views:
    503
    Roberto
    Dec 15, 2004
  2. Pom
    Replies:
    2
    Views:
    1,649
    Bas-i
    Jan 31, 2007
  3. jwamicha
    Replies:
    1
    Views:
    310
    Ian Collins
    Jul 31, 2006
  4. msalerno
    Replies:
    3
    Views:
    409
    Ilmari Karonen
    Jul 14, 2005
  5. jis
    Replies:
    4
    Views:
    156
Loading...

Share This Page