Results 1 to 5 of 5
  1.    #1  
    I'm trying to write an application that will run in the background. I'm having trouble getting the alarm/timeout to call the application's handleLaunch function again. It seems to set the alarm, according to the log app in novacom, but never sets it again. All this should do is repeatedly set an alarm.

    Anyone have any idea what's wrong?

    function AppAssistant (appController) {
    AppAssistant.prototype.setup = function() {
    AppAssistant.prototype.handleLaunch = function (launchParams) {
    AppAssistant.prototype.setWakeup = function() {
        /* set alarm */
        new Mojo.Service.Request("palm://com.palm.power/timeout", {
    	    method: "set",
    	    parameters: {
    		"key": "key",
    		"in": "00:00:10",
    		"wakeup": true,
    		"uri": "palm://com.palm.applicationManager/open",
    		"params": {
    		    'params': {"action":"asdf"} 
    	    onSuccess:  this.onSuccess.bind(this),
    	    onFailure:  this.onFailure.bind(this)
    AppAssistant.prototype.onSuccess = function(response) {
    AppAssistant.prototype.onFailure = function(response) {
    In novacom, running log, I see this once, but not repeating:
    2009-07-30T19:42:16.971271Z [2058] qemux86 powerd: POWERD-TIMEOUT: _power_timeout_set (net.geekandproud.scores,key,wakeup) in 00:00:10
    Units - Unit conversion for webOS!
    Treo 180->270->600->650->Blackberry Pearl->Palm Pre
  2.    #2  
    Figured it out. Minimum alarm time is 5 minutes. I don't actually want something shorter than that, but it'd be nice to be able to not have to wait all that time for testing. Setting the alarm to 00:05:00 works, though.
    Units - Unit conversion for webOS!
    Treo 180->270->600->650->Blackberry Pearl->Palm Pre
  3. #3  
    Thanks! Still not working for me though. I am trying to schedule an alarm in 10 seconds using the "at" instead of "in". Keeps calling itself right away.
  4. drnull's Avatar
    570 Posts
    Global Posts
    571 Global Posts
    For testing, you can open your app from the command line using:
    luna-send -n 1 palm://com.palm.applicationManager/open '{"id":"","params":{"action":"whatever"}}'
    Granted, this won't test that your "timing" code is correct, but it will allow you to immediately test your handleLaunch function.
  5. #5  
    Thanks drnull! I did find my issue just before reading this.

    The problem is that the alarm uses GMT time. I'm on the east coast, every time I tried setting the alarm I was using local time. So, because of that, it kept getting scheduled in the past.

    new Date().getTimezoneOffset();
    Using that I was able to get the number of minutes that I needed to add to my alarm.

Posting Permissions