/*
 * dct-channel
 * Copyright (c) 2003 Jim Paris <jim@jtan.com>
 *
 * This is free software; you can redistribute it and/or modify it and
 * it is provided under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation; see COPYING.
 */

dct-channel - switch channel on a DCT-2000-seris cable box connected
to the serial port and print the new channel, or just print the
channel if no arguments are passed.

Tested on a Motorola DCT-2244 from Comcast.

Attempts to be smart about changing the channel.  It will check and
make sure we're not already on the channel, to avoid pulling up the
OSD unnecessarily.  It will also ensure that the box actually
switches, attempting to exit menus and even power the box on if it
doesn't appear to switch.

Known bugs:

If the box is off and on the correct channel, it will remain off.
I don't know how to tell if the box is on or off except by
noticing that it doesn't respond to a channel change request. 
If this is really a problem, using this program to change to 
a separate but valid channel and then back should ensure that
the box turns on.

If a channel doesn't exist, the box will not switch to it,
so this code will wrongly assume the box is off and send
the power button, therefore turning it off.
