Detecting Vibrators And Alarm LEDs Programmatically

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!

What do you think?

TamsPalm – The Palm OS Blog is a great source for reviews, exclusive screenshots, and updates on all the new, 21st Century mobile technology as soon as it’s news to us!

Article Written by