Sometimes, you really need to know if the handheld that your app runs on has a vibrator or a alert LED. These routines can help you:


Boolean hasLED()
{
UInt32 capabilities;
FtrGet(kAttnFtrCreator, kAttnFtrCapabilities, &capabilities);
if (capabilities & kAttnFlagsHasLED)
{
return true;
}
else
{
return false;
}
}

Boolean hasVibration()
{
UInt32 capabilities;
FtrGet(kAttnFtrCreator, kAttnFtrCapabilities, &capabilities);
if (capabilities & kAttnFlagsHasVibrate)
{
return true;
}
else
{
return false;
}
}

These routines worked in both PODS 1.1 and OnBoardC. Feel free to use them in your own apps!

Related posts:

  1. Detecting color screens programatically
  2. Determining if your app runs on a Zodiac
  3. FossilIsWristPDADevice causes (Sys 0505) (0,1092) error on non-WristPDA devices
  4. Determining if a handheld has a rectangular screen
  5. WristPDA button handling made easy

2 Responses to “Detecting vibrators and alarm leds programmatically”

  1. My Treo 650 doesn’t report the vibration bit: 0×00010003 is the capability bit field.

  2. Hi Henk,
    the utter lack of a Treo doesn’T allow me to comment;).
    Best regards
    Tam Hanna

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

© 2012 TamsPalm - the Palm OS / web OS Blog Suffusion theme by Sayontan Sinha