MBoxAlert is a USB driver for the Dream Cheeky Mail Box Friends Alert.
Copyright © 2012 Dave Higton
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License version 2 along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
You may contact the author:
by e-mail as firstname.lastname@example.org, or
by snail-mail at 76 Glenfield Crescent, Southampton, Hants, SO18 4RF, United Kingdom.
• This application should work on any RISC OS computer with a USB interface. This means a BeagleBoard, an Iyonix, or a Risc PC with a Unipod or USB podule by Simtec or Castle.
• Clearly you also need a Dream Cheeky Mail Box Friends Alert.
The Dream Cheeky Friends Alert is a very simple device. It has a red, a blue and a green LED in its case, each of which can be set to 64 brightness levels including off. It is intended to alert a user, when e-mail or any other form of message arrives, by lighting up. The MBoxAlert driver makes it easy to make the thing light up, or flash, with any of the colour combinations. This is done by Obey files which only need one line, and are dead easy to write. A selection of Obey files will allow several different alerts to be generated.
The MBoxAlert/zip archive contains:
• The !MBoxAlert application;
• The Licence file (GNU General Publice Licence version 2);
• A !03-00-00U directory;
• An ObeyFiles directory containing several sample Obey files for use with the MBoxAlert application.
• Copy the !MBoxAlert application into a convenient location. I recommend the $.Apps directory. It needs to be a location that is "seen" by the filer before anything wants to run the application.
• If you have a Unipod or Simtec USB podule, copy the !03-00-00U directory into the DevDriver directory, which is probably at $.!Boot.Resources.!USB.DevDriver. There may well be a !03-00-00U directory already there; just copy the supplied one over the top - all it will do is copy some extra files in there.
There are basically four ways to run it:
• It will auto-run on start-up;
• Plug a Mail Box Friends Alert in;
• Double-click on the !MBoxAlert application;
• Run an Obey file containing a suitable command line.
The last one is the most useful, and assumes that you can get your mail system to run an Obey file when mail comes in.
When the application runs, if a Mail Box Friends Alert is plugged in to the USB, you'll see an instantly recognisable icon appear somewhere on the right hand side of the icon bar. If no device is plugged in, you'll just see an error box telling you so.
The Obey file simply has to run the !MBoxAlert application, passing some parameters to control on/off/flash and colours. The command can be any of "on", "flash" or "off". The colours are three numbers, being the brightnesses of red, green and blue respectively. The numbers should be between 0 and 63; any number larger than 63 won't make any difference, because 63 is as bright as each LED can go. Let's look at some examples:
Filer_Run <MBoxAlert$Dir> 63 10 0 on
will turn the device on (steady, i.e. not flashing) with a red colour with a bit of green.
Filer_Run <MBoxAlert$Dir> 0 63 0 flash
will make the device flash pure green. (Which idiot thought it was a good idea to shine green and blue LEDs through red plastic?)
Filer_Run <MBoxAlert$Dir> on
will turn it on with whatever colour you used last, and
Filer_Run <MBoxAlert$Dir> off
will turn it off.
The command, if present, can come either before or after the colour numbers. The colour numbers are in the order red - green - blue, and you must specify all three, or none at all.
• Experiment with Obey files; you won't break anything; you have several sample files in the ObeyFiles directory to use as examples;
• Never set all three colours to zero; you'll get awfully confused when it doesn't light up at all. When you want to turn it off, just send the command "off".
Clicking Select on the icon bar icon will turn the device off if it was on or flashing, or turn it on if it was off. Once you've been alerted, one click is all it takes to cancel the alert. (If you click it again and again and still it doesn't light up, you must have set red, green and blue all to zero.)
Clicking Adjust on the icon bar icon will open the control window, which has three sliders to set the colour, and buttons for off, flash and on, so you can play with the effects "live".
Clicking Menu will open up a menu with "Info" and "Quit" options. The Info window has a button that should open up your browser on my web site.
As you see, the aplication is probably already running when you send a new command. How does that work?
When the application runs, it checks to see if a copy is already running. If not, it just runs as you'd expect. If a copy is already running, though, instead of trying to control the device directly, the second copy sends a Wimp message to the first copy and gets it to do the job, then the second copy quits.
You can download MBoxAlert here.
0.01 2011 February 10 First issue
0.02 2012 September 2 Contact details updated
Page last updated 2012 September 2