Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is a <a href="http://mail.python.org/pipermail/python-list/2009-April/thread.html#177175" rel="nofollow noreferrer">very similar thread</a> on a Python mailinglist that mentions Windows <a href="http://en.wikipedia.org/wiki/COM_port_redirector#Virtual_Serial_Port" rel="nofollow noreferrer">virtual COM ports</a> and discusses Unix's pseudo-tty capabilities. If the app(s) you want to use let you type in a specific tty device file, this may be the easiest route. (Short of asking the authors to provide a plugin API for what you're trying to do, or buying yourself a <a href="http://www.semsons.com/amabg108blgp.html" rel="nofollow noreferrer">$20 bluetooth GPS mouse</a>.)</p> <p>Are you using OS X?</p> <p>There is a project <a href="http://code.google.com/p/macosxvirtualserialport/" rel="nofollow noreferrer">macosxvirtualserialport</a> on Google code that provides a graphical wrapper around some of the features of a utility called <a href="http://www.dest-unreach.org/socat/" rel="nofollow noreferrer">socat</a>. I'd recommend taking a look at socat if you see potential in the pseudo-tty route. I believe you could use socat to link a pipe from a Python program to a pseudo-tty.</p> <p>Most native Mac apps will be querying IOServiceMatching for a device with kIOSerialBSDRS232Type, and I doubt that a pseudo-tty will show up as an IOKit service.</p> <p>In this case, unless you can find a project that has already implemented such a thing, you will need to implement a driver as described in this <a href="http://lists.apple.com/archives/Darwin-kernel/2006/Feb/msg00090.html" rel="nofollow noreferrer">How to create virtual COM port</a> thread. If you're going to the trouble of create a device driver, you would want to base it on IOKit because of that likely IOServiceMatching query. You can find the Apple16X50Serial project mentioned in that post at the top of <a href="http://opensource.apple.com/release/mac-os-x-1061/" rel="nofollow noreferrer">Apple's open source code list</a> (go to the <a href="http://opensource.apple.com" rel="nofollow noreferrer">main page</a> and pick an older OS release if you want to target something pre-10.6). </p> <p>If your app is most useful with realtime data (e.g. the RouteBuddy app mentioned in the Python mailinglist thread <a href="http://www.routebuddy.com/routebuddy/devices/index.html" rel="nofollow noreferrer">can log current positions</a>) then you will want to fetch updates from your web sources (hopefully they support long-polling) and convert them to basic <a href="http://www.sparkfun.com/datasheets/GPS/NMEA%20Reference%20Manual-Rev2.1-Dec07.pdf" rel="nofollow noreferrer">NMEA</a> RMC sentences. You do not want to do this from inside your driver code. Instead, divide your work up into kernel-land and user-land pieces that can communicate, and put as little of the code as possible into the kernel part.</p> <p>If you want to let apps both read and write to these web services, your best bet would probably be to simulate a Garmin device. Garmin has more-or-less documented their protocol in the IntfSpec.pdf file included with their <a href="http://garmin.com/support/commProtocol.html" rel="nofollow noreferrer">Device Interface SDK</a>. Again, you'd want to split as much as you could into user-space code.</p> <p>I was unable to find a project or utility that implements the kernel side of an IOKit-based virtual serial interface, but I'd be surprised if there wasn't one hiding somewhere out there. Unfortunately, most of the answers I found to that question were like this, with the developer being told to get busy <a href="http://developer.apple.com/Mac/library/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptAbout/about_kexts.html" rel="nofollow noreferrer">writing a kext</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload