Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Serial Serial Serial
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Serial Serial Serial



At 0:17 -0500 13/3/01, Adam Skwersky wrote:
In that note, it says OT Serial is supported on Carbon for traditional MacOS
only:

* Open Transport serial will continue to be supported on traditional Mac OS,
both for Carbon and non-Carbon applications.

What's the point in making it work in Carbon but not for Mac OS X?

Because we get it for free. On traditional Mac OS, Carbon shims directly through to the underlying OT implementation. As long as OT serial works for non-Carbon applications, it will continue to work for Carbon applications on traditional Mac OS. This applies for other technologies, like AppleTalk.

We could have gone out of our way to stop CarbonLib (ie Carbon on traditional Mac OS) from being able to access providers that aren't present on Mac OS X, but it would have been more work (and it seems a little cruel).

Any thoughts on how to port a serial port application to Mac OS X while
maintaining a version that works in Mac OS 9/8?

There is no serial API that works on both traditional Mac OS and Mac OS X.

Does it make sense to use
OTSerial instead of classic serial if we want to build are application with
Carbon libs?

To some extent yes. To build a serial application that works on both Mac OS 9 and Mac OS X, you need to write your own serial abstraction layer and have the Mac OS 9 implementation call through to either classic serial or OT serial, and have the Mac OS X implementation call through to BSD/IOKit. It's a little easier to do this if you exploit OT serial on Mac OS 9 because you have to mess with fewer function pointers and OT serial is a closer match to BSD serial. But that's not a great advantage.

btw If you're working with serial on Mac OS X you probably need to know about SerialPortSample.

<http://developer.apple.com/samplecode/Sample_Code/Devices_and_Hardware/
Serial/SerialPortSample.htm>

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware


References: 
 >Re: Serial Serial Serial (From: Adam Skwersky <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.