Hello folks,
I have just run into a really really weird thing on my Sim and wanted to
share this.

I have an app that turns itself on every 15 seconds while the device is
running(a status reader) via an alarm and then resets the next alarm, until
a poweroff notification comes by. When the Power off notification comes by,
the alarms are disabled as to allow the device to sleep:

void notificationReceived(MemPtr cmdPBP)
{
        SysNotifyParamType *pNotifyParams = (SysNotifyParamType *)cmdPBP;
        UInt16 cardNo;
        LocalID dbID;
        
        SysCurAppDatabase(&cardNo,&dbID);

        switch (pNotifyParams->notifyType)
        {
                case sysNotifyLateWakeupEvent:
                        AlmSetAlarm(cardNo,dbID,0,TimGetSeconds()+15,false);
                        break;
                case sysNotifySleepNotifyEvent:
                        AlmSetAlarm(cardNo,dbID,0,0 ,false);
                        break;
        }
}

However, the device still wakes up at the once specified time - apparently,
the OS clears the alarm from its alarm manager, but does not update the RTC.

My fix was to set the alarm time ten years into the future...which is then
programmed into the RTC. However, its unlikely that the device will still
exist then...so sayonara, RTC. Good luck waking up on the garbage dump.

Working code:
void notificationReceived(MemPtr cmdPBP)
{
        SysNotifyParamType *pNotifyParams = (SysNotifyParamType *)cmdPBP;
        UInt16 cardNo;
        LocalID dbID;
        
        SysCurAppDatabase(&cardNo,&dbID);

        switch (pNotifyParams->notifyType)
        {
                case sysNotifyLateWakeupEvent:
                        AlmSetAlarm(cardNo,dbID,0,TimGetSeconds()+15,false);
                        break;
                case sysNotifySleepNotifyEvent:
        
AlmSetAlarm(cardNo,dbID,0,TimGetSeconds()+60lu*60*24*365*10,false);
                        break;
        }
}

Anyone have any ideas re this?

All the best
Tam Hanna


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to