According to "Palm Developer Guide, Palm OS Platform, Rev. F [page]
39", the following devices will send these values;
DEVICES: Treo™ 650, Treo™ 680, Treo™ 700p, and Treo™ 755p smartphones,
Tungsten™ T5 and Tungsten™ E2 handhelds and LifeDrive™ mobile managers
VALUES: Power notification == 0x0008. Serial notification == 0x0040,
USB notification == 0x0010
Further discussed at "Palm Developer Guide, Palm OS Platform, Rev. F
[page] 287".
I believe the UserDataP doesn't point to anything. Instead, the value
is passed cast as a pointer. Casting it back to UInt16 should give you
the correct value. A quick test would tell you.
On Thu, Jul 31, 2008 at 11:15 AM, Christopher Stamper
<[EMAIL PROTECTED]> wrote:
>
> I'm writing an application that uses the sysExternalConnectorAttachEvent
> notification. When I respond to the notification, I need to determine what
> kind of device was connected.
>
> The docs say:
>
> "The notifyDetailsP field points to a UInt16 that identifies which type of
> device was attached."
>
> So, I've done something like this in PilotMain:
>
> UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
> {
>
> UInt16 DeviceType = 1;
>
> switch (cmd)
> {
> case sysAppLaunchCmdNotify:
> If (((SysNotifyParamType*)cmdPBP)->notifyDetailsP == &DeviceType)
> //Do action for that device 1
> and so on...
> }
> }
>
>
>
> Is this how I should do it?
>
> If so, what values should I use for DeviceType? I've searched the headers,
> and I can't find any references to this. Shouldn't there be some constants
> that I can use? Or do I really have to use the trail-and-error method for
> determining device type numbers(isn't working so far)?
>
> Basically, I only want to be sure that the device is a sync cable (usb,
> serial, etc) and not just a charger/modem/whatever else.
>
> Thanks!
>
> --
> Christopher Stamper
>
> Email: [EMAIL PROTECTED]
> Web: http://tinyurl.com/2ooncg
> gTalk: http://tinyurl.com/6e359r
> Skype: cdstamper
>
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe,
> please see http://www.access-company.com/developers/forums/
--
[Jeff Loucks, Gig Harbor, WA, USA]
Power notification == 0x0008
Serial notification == 0x0040
USB notification == 0x0010
As of that document, these devices;
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/