Application Watchdog example broken

Hello :slight_smile:

I have tried the watchdog example as it is stated here:

https://docs.particle.io/reference/device-os/firmware/photon/#sts=Application%20Watchdog

Instead of success message I get this:

“request for member ‘checkin’ in ‘wd’, which is of pointer type ‘ApplicationWatchdog*’ (maybe you meant to use ‘->’ ?)”

Any ideas why this happens?

ApplicationWatchdog *wd;

void setup() {
  // Start watchdog. Reset the system after 60 seconds if 
  // the application is unresponsive.
  wd = new ApplicationWatchdog(60000, System.reset, 1536);
}

void loop() {
  while (some_long_process_within_loop) {
    wd.checkin(); // resets the AWDT count
  }
}
// AWDT count reset automatically after loop() ends

The code in the sample is wrong and yes, that is why this happens.

It should be

     wd->checkin();

A correction to the docs should be online soon.

3 Likes

It has been corrected, thank you :blush:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.