Logged in as Guest   Wed, Jun. 04th, 7:51 PM.      
Visitor Map
Recent Entries:
What I've Been Up To
Debugging Windows Mobile/WinCE Applications Without ActiveSync
LinkedIn
I'm BACK!!!!!!
Code Monkey
Cool 3D Code Snippet From My Former Life
YouTube: The Revival of the Internet Time Killer
WhereMate Released
Palmasaurus Released As Freeware
VM-Plus Beta

Archive:
May - 2008
April - 2008
March - 2008
October - 2007
August - 2007
July - 2007
June - 2007
May - 2007
April - 2007
December - 2006
November - 2006
September - 2006
August - 2006
July - 2006
March - 2006
February - 2006
January - 2006
December - 2005
November - 2005
October - 2005
September - 2005
August - 2005
July - 2005
June - 2005
May - 2005
April - 2005
February - 2005
January - 2005
December - 2004
November - 2004
October - 2004
September - 2004
August - 2004
July - 2004
June - 2004
May - 2004
April - 2004
March - 2004

Handspring Undocumented APIs
So if you have ever developed for the Treos, you may have run into the fact that there are some functions that just aren't available in the PhnLib SDK. One such function that I found missing the other day was a function to hang up a phone call that was already taking place.
So, as is my usual pattern, when I need to find something, I headed to Google groups, the Palm developer site and the PalmSource/Access developer web site. None of these turned up anything. Ugh. I started to get worried. Next, as is my usual custom, I headed to the header files to do some digging.
After poking around for a while in the headers, I found a tantalizingly named trap in HsPhoneTraps.h called 'PhnLibTrapDisconnect'. For some strange reaon, the folks at Palm/Handspring neglected to include this function in the SDK, but included the system trap for it.
This was a fantastic find, and after a bit more poking and testing, I found some code that would work. Simply declare this function prototype somewhere in your headers:

extern Err PhnLibDisconnect(UInt16 refNum, UInt16 line) PHN_LIB_TRAP (PhnLibTrapDisconnect);

And then you will be free to disconnect whichever of the two lines you would like. One caveat that I would offer, however is that there may be additional variables required by this function so to be safe try calling the function like this:

char stackProtector[16];
Err err = PhnLibDisconnect(phnLibRef, 0);

As long as your compiler doesn't optimize it away, the 'char stackProtector[16]' right before you call the function should protect you just a bit from any stack issues that could arise from not having the right function signature.
Of course, you should use this snippet at your own risk, but I do sincerely hope that you find it useful. I certainly have. And as always, if you have additional info or comments about this, feel free to drop me a quick note. I always love good emails.

-Jon
Submitted by bosshogg on Wednesday the 26th of July 2006, at 11:16 pm