Recent Entries: |
|
|
|
|
|
|
Documenting Wrongs (PalmOS)
|
One of the purposes for me having this blog is that I use it as a personal reference for quirks and oddities that I find while developing for PDAs and Smartphones. When I find something, I'll write a short blog about it. Then, later, when I'm trying to remember how to do something, I can actually search for it on the blog. This is one of those times.
So, I'm working on a little utility for my Treo 650 that has to know when an incoming phone call arrives. Now, I've worked with these APIs before (as I've documented in other posts here) and I thought that I knew how to be notified when a call comes in. It should be pretty simple; you have to 1. Load/Open the phone library, 2. Call PhnLibRegister, and then 3. Check for the phnLibLaunchCmdEvent in your PilotMain.
I sat down one evening and quickly wrote the code to do it. It all went pretty smoothly until I actually went to run it. According to my asserts and debug statements, everything loaded and registered correctly, but for some reason, I wasn't receiving any notifications.
Naturally I went to the web. I Googled everything I could. I looked in the PalmOS newsgroup archives. I looked in the Palm Inc. developer site. I looked in the sample code put out by both PalmOS and Palm. I couldn't figure it out. I was doing everything that they were. Why wasn't mine working? I struggled to rework the tiny bit of code in numerous different ways, all to no avail. Finally, through persistence and thanks to the magic of Google, I found
this bizarre chat transcript that (in a round-about way) describes how the value for phnLibLaunchCmdEvent used to be '2bad'. According to the transcript, it had to be changed from '2bad' to 'abad' because '2bad' isn't a valid value according to the PalmOS rules for custom launch codes. Weird.
I went and looked at the value defined for it in my header files and sure enough, it was '2bad'. Apparently, I have a very old version of the Handspring SDK. Ugh. If I had gone with a clean install of the SDK from Palm's site, I would not have run into this. So, now that I have a valid value, I'm up and running. However, I do have a question if anyone knows: "Are there any Treo devices that actually use the value '2bad' for phnLibLaunchCmdEvent?" Since my only reference is that weird chat transcript, I would love to know the full history behind it. Ok, back to my code now.
-Jon
|
Submitted by bosshogg on Tuesday the 27th of December 2005, at 04:11 pm
|
Unintended Consequences
|
About seven years ago I wrote some code to do Mu-Law and A-Law compression. About six years ago, I decided to publish an article along with the source code for it. You can find it here. Anyway, the other day I received an email from someone who had taken it and modified it for what he was doing. In doing so, he found a piece of misinformation that has been in my article since I originally published it. Not a big deal, and I intend to rectify the issue. However, as we chatted over email, I asked him what he was using Mu-Law/A-Law compression for. Here is a clip from our email:
> So if you don't mind me asking, what are you working on that has 13 bit
> unsigned audio input?
Sure. I am designing a system that monitors lots of radio stations to capture and
detect Emergency Alert System activations - those ugly tones and occasional
voice messages you hear on the radio. The system has some rather incredible
shortcomings for a critical system in 2005. When the emergency management
office triggers an alert they have no way of knowing whether or not radio stations
actually broadcast the alert. Sometimes the system fails - too often. So our
system listens to the stations and sends a report back to Emergency HQ. In
most cases an exception report that shows which stations did not properly
send out the alert. So if the dam is breaking or the nuke is going critical they
can try again, use the phone, send a helicopter or something.
Whoa. Code that I originally wrote to compress audio in children's games is now being used to help monitor Emergency situations. Talk about your unintended consequences!
-Jon
|
Submitted by bosshogg on Wednesday the 14th of December 2005, at 10:15 pm
|
|
 
|
|