cocoaPTT
Kok Chen, W7AY [w7ay [at]
arrl.net]
Last updated: June 27, 2007
Please
see cocoaPTT 2.0 for an updated version
of this application.
Introduction
cocoaPTT is a simple MacOS X application for controlling
the Request To Send (RTS) or the Data
Terminal Ready (DTR) pin of a
serial port.
cocoaPTT is built as a Universal Binary application and
works natively with both PowerPC and Intel based
Macintoshes. You can download cocoaPTT here.
In addition to a control panel interface, cocoaPTT can also
be controlled through AppleScript.
cocoaPTT is not a supported program. The sources are
available for you to adapt to suit your own needs, rather
than my needs.
The application is very small and easily modified if you
know your way around programming. For non-commercial use,
the Xcode project is available by writing to me at
w7ay@arrl.net. There is no restriction on how you can use
the Xcode project -- you can change what the button in the
control panel does, add buttons, use the serial port to
control a CAT interface, add AppleScripts, or just use the
project as example code.
Configuration
Before calling cocoaPTT from another application, you will
need to configure the interface. But first, make sure that
your serial port is plugged into the computer.
The first time you launch cocoaPTT, you will see an alert
panel asking you to select the serial port. Click OK to
proceed.
Select the Preferences... menu item in the cocoaPTT menu in
the Menu Bar (or use the Command-comma keyboard shortcut)
to bring up the preference panel.
Use the popup menu to select a serial port. The popup menu
will be selected to “None” until you have
selected a port. If you don’t see the port you need,
first quit cocoaPTT, recheck the serial port connection and
then relaunch cocoaPTT. The port must be connected before
you launch cocoaPTT.
If you cannot find a serial port port in the System
Profiler application in the Utilities folder of your Mac,
cocoaPTT will not be able to find it either.
The following figure shows the preference panel after a
Keyspan USB PDA adapter is selected.
In addition to choosing which
serial port to use, you can also choose whether to use the
RTS or the DTR pin of the port. You can also choose whether
the polarity of the RS-232 signal is high (positive voltage
at the serial port pin) to key PTT, or low (negative
voltage at the serial port pin) to key the PTT line of the
transceiver. The choice of polarity depends on how
you’ve designed your interface and what the
transceiver needs.
There is a third choice under RTS and DTR. This allows you
to key both RTS and DTR at the same time. You can use this
selection if you are not sure if RTS or DTR is the signal
that is being used and both signals are not being used by
other applications, or if the PTT device has wired-ORed the
hardware RTS and DTR signals, as with the RIGblaster nomic.
Control Panel
When in the idle state, the cocoaPTT control panel looks
like the following.
Click on the Key button to
activate PTT. The interface turns into the following. Click
on the Unkey button to get back to the idle state.
This panel can be closed (use
the red button at the left of the panel’s title bar)
if you don’t need to look at it -- for example when
you are controlling cocoaPTT through a separate application
using the AppleScript interface.
To reopen the control panel, make the cocoaPTT app active
and then select the Show PTT Control Panel menu
item in the Window menu in cocoaPTT’s menu bar.
You can also reopen the control panel by selecting the
Show PTT Control Panel menu item that is displayed
when you hold down the mouse button over the cocoaPTT item
in the Dock (see figure below):
The serial port and RTS/DTR
selections and the control panel position are saved to a
property list file called w7ay.cocoaPTT.plist in
your user Preferences folder when you quit cocoaPTT.
AppleScript Interface
cocoaPTT can be controlled through AppleScript. The
following is a script to activate PTT.
The following is a script to deactivate PTT.