4

I'm working on a Windows Mobile 6.1/6.5 application running on .NET Compact 3.5. This application has been running successfully for years on the old HP iPaq 210, but I'm having some trouble getting it to run on a Socket SoMo 655.

Almost everything works as it should, with the exception of the LargeIntervalTimer feature of the OpenNETCF library. The timer does actually work if the device is left connected to a PC, but otherwise the device falls into a suspend mode that this timer is not able to wake up.

Now, this is the entire purpose of the LargeIntervalTimer. It wakes up a device that has entered suspend mode, so that it can perform a task of some kind. It works correctly on the iPaq, waking it from seemingly any kind of sleep mode as it should. On the SoMo, however, the timer does not fire after the device has been left alone long enough to turn off.

Does anyone have any ideas? Is there another way to wake the device from any power state that I can use within managed code?


Edit:

Thanks for the helpful suggestion, Josef, and for going to the trouble to write a test app. From what I can tell, the event is being added correctly to the database. If I run your application and press Start immediately followed by Stop, I see there is 1 new entry (the one created by the test app itself). However, if I press Start and then open my own application before switching back and pressing Stop, I get 2 new entries. This is true for both devices, the working iPaq and the problematic Socket.

I'm thinking the problem must have to do with the Socket's power state after the device is allowed to go into suspend mode. The LargeIntervalTimer works correctly when the Socket is left connected via USB to my PC, and I think that's because the device never completely goes to sleep while connected. However, if I unplug the device and allow it to enter suspend mode, the timer simply never activates.

Anyway, thanks for your help. I'm still open to ideas, but it doesn't seem like there's a simple solution that I've just overlooked...


Edit 2:

I noticed that the Socket SoMo 655 is running Windows CE, while the Socket SoMo 650 (on which the application works perfectly) is running Windows Mobile 6.5. Could there be a difference between these mobile operating systems that is interfering with the OpenNETCF library?

  • 2
    Have you tried to directly call CeRunAppAtTime or CeSetUserNotification to try to get it to wake? The LIT uses the former internally. Though I've never seen a platform where it didn't work, I've seen OEMs do enough weird stuff in my time that I take nothing for granted. I'd try a quick test using both APIs just to see if they work at all, if they fail then it's an interrupt problem with the hardware and you're unlikely to see a fix, as it would require the OEM to care about it. – ctacke Nov 22 '12 at 00:33
  • Thanks for the tip. It sounds like CeSetUserNotification might be more reliable than CeRunAppAtTime on newer devices (according to [this](http://www.codeproject.com/Articles/55430/Using-CeSetUserNotification-to-start-a-program)), so I'll look into it. I should mention that I don't actually want to run an application when the timer fires, but rather, just a function call within an app that's already running. LargeIntervalTimer is great for this, because all you have to do is initialize it with a function delegate and it'll run as per the set interval. Hopefully I can do the same thing... – user1840477 Nov 29 '12 at 16:27
  • This question is a few months old, but it has just come to our attention at Socket and we are looking into it. Just to clarify, the SoMo 655 ships with Windows Embedded Handheld 6.5, which is based on Windows Mobile 6.5, and the SoMo 650 came with Windows Mobile 6.1. Did you upgrade your 650 to 6.5? – Enrico Feb 20 '13 at 23:17
  • *Update*: We agree this is a bug and we are looking into fixes. I'll post a solution as soon as we've got one. – Enrico Mar 14 '13 at 07:26

1 Answers1

2

the OpenNetCF LargeIntervalTimer uses the notification database and adds a time based event.

If this fails or the notification engine does not fire the event (an alarm), the LargeIntervalTimer will fail.

I have done a test application at https://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk%2FOpenNetCF_LargeTimer (binary also there in bin dir).

enter image description here enter image description here

After the application is started just click on start and a new LargeTimer will be initialized. Then the tool gets a list of the notification events and dumps them to the textbox.

When you click (Stop) the app stops the LargeTimer and does another events list. Then the lists are compared and if there is a new entry, you will get the contents.

 New entry: 889192489, \\.\Notifications\NamedEvents\50f2c337-5b1a-4b78-8923-53df9e009980

OpeneNetCF seems to not delete the old entries, it always creates new unique named event entries.

If LargeTimer will not work on your device, it may be caused by the event is not entered in the database. With the tool you can verify the old and new entries.

~josef

josef
  • 5,951
  • 1
  • 13
  • 24