AttnGrab (Attention Grabber)

AttnGrab (Attntion Grabber)
http://ramsay.webhop.org/attngrab

About

AttnGrab extends the functionality of the Attention Manager. It grabs your attention by emitting a beep, turning on the LED or vibrating periodically when you have pending alerts. This is most useful on a device like my Treo 650 wich does not continuously alert me to the fact that I've missed a call or an SMS, something I was used to from my previous phone.

I created AttnGrab because I could find no free utility that provided this functionality and I don't like paying for software, especially simple hacks.

License

The app binary is freeware. You can do whatever you want with it (including re-distribution). The source code is covered by the GPL v2.

Installing

AttnGrab requires Palm OS 4.0 or above and the Notification Manager. The LED and Vibrator functions require a device with the Handspring extensions or support from the Attention Manager. AttnGrab was developed and tested on a Treo 650.

Simply install AttnGrab.prc onto your PalmOS device and run it.

Notes

AttnGrab relies on the Attention Manager. Apps that don't use the Attention Manager for their alerts will not trigger AttnGrab.

Agendus
There is a preference to use the Attention Manager but it only works when you snooze the alarm (ie. not correctly). The recommended solution (from the Agendus folks) is to turn off the "Agendus handles alarms" option. I think that lets the built-in datebook handle the alarms so they might look and behave differently.

Some newer Treo phones support the Handspring Extension but do not honour the setting of the red LED. Affected devices seem to include anything newer than the Treo 680 (including the Centro).

Features

Buliding

Attention Grabber was developed with OnBoardC. I used Bird to create the UI but it is not required to build.

To start with you should ensure that OnBoardC has been installed. Due to a bug in all released versions of OnBoardC you will need a patched compiler that you can get from here (If you don't do this the build will hang while compiling SetAlarm). Because OnBoardC does not ship with a full PalmOS header you will also need to install all of the files in the Includes folder. Note that most of these files come from here though I did have to modify a few to avoid compile errors. Finally you should install all of the files in the Sources folder.

You can now open the project in OnBoardC and build it. Please note that the source code is provided under the terms of the GPL, version 2 (see COPYING). Before distributing binaries you have built from the source code you should ensure that:

  1. You are able to provide the modified source code in accordance with the terms of the GPL.
  2. You have changed the name and Creator code (get one here) so that your app does not conflict with AttnGrab.

Changes

v3.3 (build 0982)
Fixed (I think) several issues that worked together to cause a reboot when receiving an SMS.
Fixed an issue where clicking on the Ringer State checkbox set the text field to empty but did not redaw it. This makes it easy to accidentally set the seconds value to 0.
Fixed an issue where having a seconds value of 0 when beep or vibrate are enabled. This was setting the alarm for the current time leading to a tight loop. This should not be fatal but when this happened as a result of an SMS coming in the phone rebooted.
As an extra sanity check, always ensure that the alarm is being set for a time in the future and clear it otherwise.
atgdebug now has a useful scroll bar (sadly presented in addition to the list widget's scroll arrows because I can't figure out how to disable those). The scroll bar is handy for navigating through longer debug logs.
v3.2 (build 0954)
Using the debug log, I was able to track down a number of issues with the state machine used by AttnGrab. Mostly this means that useless extra processing is avoided but there were a few cases where invalid state transitions were happening.
v3.1 (build 0937)
A debug log can now be written (it's called 'AttnGrab Debug Log'). This requires the separate ATGDebug app to turn on the pref. ATGDebug can also view the debug log.
Fixed a problem that prevented AttnGrab from deactivating in some cases (requiring a reset to fix).
Fixed a potential problem that might have caused a crash (having an alarm event go off while the GUI is visible).
v3.0 (build 0903)
Settings are now stored in the 'AttnGrab Data' database rather than the system preferences. Preferences from previous versions is imported though there is a slight mismatch between the behavior of 2.3 and 3.0 so you should check your prefs after installing the new version.
Store an arbitrary number of profiles.
Assign names to your profiles.
Each profile can use different settings when the ringer switch is on or off (replaces the previous ringer switch to change profiles feature).
App is now multi-segment (to reduce the amount of locked memory when it is active).
v2.2 (build 0704)
Show the LED state even if the checkbox is disabled.
Found a way around the nasty rebuild case so that a device reset is no longer needed (helpful when you're building AttnGrab from source with OnBoardC while it is doing something).
Use 'hvch' and 'hapl' notifications instead of 'hede' while the alert is active. If you noticed performance problems while AttnGrab was alerting this should help.
Change profile with the ringer switch.
v2.1 (build 0654)
Relocate the buttons on the beep configuration form. It makes more sense now.
Alarm code has been reworked to ensure it is reliable.
Locking code has been reworked to ensure the app is locked into memory only when it needs to be.
Show the LED state while configuring (live updating).
Turning the two LED buttons off now forces the LED off (instead of just nothing). On my Treo 650 the default LED state is blinking so this is visually different (unless you're running LEDOff or similar to turn off the blinking LED).
v2.0 (build 0612)
There are now 2 profiles (called Active and Passive) that can be used to customize the way AttnGrab notifies you.
Profiles can be activated manally or at a set time.
The profile can change while an alert is active and the new settings will apply immediately. The exception to this is the LED colour, which does not change.
Massive code refactoring (I've been wanting to do this and the large changes needed for profile support were a perfect opportunity to do it).
Added a button to let you test the beep parameters without having to create an alert.
v1.9 (build 0505)
Fix memory leaks and other bugs identified while running under POSE.
Beep parameters are configurable.
v1.8 (build 0428)
The seconds were incorrectly initialized (for new installs only).
Use ForceNone instead of ForceOff so that normal LED/Vibrate functions are returned.
v1.7 (build 0420)
Some devices require an extra delay to ensure the beep is played in it's entirety when the device is asleep (and vibrate is turned off).
Fixed a bug where seconds values over 255 would not work (thanks Ken).
The LED color is now configurable (when using the Handspring Extensions).
v1.6 (build 0393)
Emergency release to address 2 crash bugs found in v1.5.
The 'hede' notification is handled with sub-launch again because SysNotifyUnregister won't actually de-register the proc-based notification (leading to a crash).
Fix a crash caused by the second attention attempt.
Added a check to catch a nasty case that can happen when rebuilding from source. It could also possibly happen if you upgrade without using HotSync (eg. with Filez). You'll know if it's happened because you'll hear a beep and the device will reset. The trace log will contain a note as to the cause.
v1.5 (build 0350)
Use AlmSetProcAlarm to avoid the problems with the device not sleeping and/or waking when beeping.
Disable cleanly when deleting AttnGrab (it will beep when you delete it due to some debugging code I left in).
More efficient 'hede' notification handling (not that you should be relying on input events to be fast when you've got a missed call...).
You can't set the "Enable after reset" flag unless AttnGrab is enabled. This isn't displayed well visually but PalmOS doesn't draw disabled controls properly.
Due to a big prefs cleanout you'll lose your prefs. Make sure you run AttnGrab after installing it to set your prefs.
v1.4 (build 0317)
Turns out I didn't get all of the debug code. This time I really have got it all.
It turns out there is a way for newly-installed apps to do something, AttnGrab now re-enables itself after a HotSync, even if you have upgraded it.
v1.3 (build 0314)
Removed all of the debug code (it didn't work properly anyway). Halved the app size.
1.2 disabled AttnGrab during a HotSync but it didn't re-enable it afterwards. Now it automatically re-enables itself unless you're uploading a new release (in which case you'll see when you run it that it has been disabled).
v1.2 (build 0304)
You can now use LED and Vibrator without Handspring extensions (the Attention Manager's special effects are used instead). Note that I can't test this because my Treo 650 does not support these special effects through the Attention Manager.
Stop polling to turn the LED off. Hook the 'hede' notification instead. The hook is cleared when there are no pending alerts.
Allow disabling the beep.
v1.1 (build 0169)
Added support for using the LED and Vibrator. Note that this relies on Handspring extensions and will probably crash non-Treo devices if you turn this on.
v1.0 (build 0109)
Initial public release.