[Python-bugs-list] [ python-Bugs-674574 ] Access to serial devices through Carbon.CF

SourceForge.net noreply@sourceforge.net
Sat, 25 Jan 2003 06:15:21 -0800


Bugs item #674574, was opened at 2003-01-25 15:15
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=674574&group_id=5470

Category: Macintosh
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Pascal Oberndoerfer (pascal_efi)
Assigned to: Jack Jansen (jackjansen)
Summary: Access to serial devices through Carbon.CF

Initial Comment:
There is currently no wrapper to access serial RS232
devices (e.g. Keyspan USB-serial adaptor) through
Carbon.CF on MacOS X.

This was my short and dirty hack to get a list of
currently available (Keyspan) serial devices:

#!/usr/bin/env python

import os
import string

PRE = 'cu'
#PRE = 'tty'

device_list = filter(lambda s: string.count(s,
PRE+'.USA'), os.listdir('/dev/'))
print device_list


But as Jack said:

Anything that is in CF but not wrapped in the Carbon.CF
module 
should be considered a bug. I know there's still quite
a bit missing, 
but if people put bug reports up on sourceforge that
will influence 
the order in which I add stuff to the CF module. It
would help a lot 
if you mentioned the data structure and/or some of the
routines 
you need.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your
revolution -- Emma 
Goldman -


Dan Grassi supposed (slightly paraphrased) to do the
folowing on MacOS X with IORegistryExplorer (inside
/Applications/Utilities)

> Search for IOSerialBSDClient  with a key of 
> IOSerialBSDClientType 
> with a value of IORS232SerialStream.  
> Then get the value of the 
> IODialinDevice (/dev/tty.*) or IOCalloutDevice
(/dev/cu.*) ...


For a single serial device this can result in:

{
    CFBundleIdentifier = com.apple.iokit.IOSerialFamily; 
    IOCalloutDevice = /dev/cu.USA19QW21P1.1; 
    IOClass = IOSerialBSDClient; 
    IODialinDevice = /dev/tty.USA19QW21P1.1; 
    IOMatchCategory = IODefaultMatchCategory; 
    IOPersonalityName = IOSerialBSDClientSync; 
    IOProbeScore = 1000; 
    IOProviderClass = IOSerialStreamSync; 
    IOResourceMatch = IOBSD; 
    IOSerialBSDClientType = IORS232SerialStream; 
    IOTTYBaseName = USA19QW21P1.; 
    IOTTYDevice = USA19QW21P1.1; 
    IOTTYSuffix = 1; 
    ParentKey =
"KEXTBundle?com.apple.iokit.IOSerialFamily"; 
}


So maybe return a list of dictionaries?

Pascal (MacOS X, MacPython 2.3a1 [Framework Install])


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=674574&group_id=5470