Decoding Base64 string to image Watchdog Tripped Error - Code Executed Too Long

Hello,

My application receives a String that represents an image in Base64.

I want to decode this String to draw it, but when my code runs, I get the error «Watchdog Tripped Error - Code Executed Too Long».

My image is 2 KB before putting it in Base64, I have already tried to optimize my code and I do not see that we can make threads in Monkey C.

I am with the Connect IQ 6.4.2 sdk and the watch I use for my tests is the Forerunner 935

Is there a solution that could prevent me from making this mistake?

  • CIQ only has one thread.  The watchdog is tripped if you run too long without returning to the VM, and varies based on device.  With the 935 it's

    "watchdogCount": 120000

    while the 965 it's

    "watchdogCount": 240000

    for example

    Search the discussion forum for "watchdog" and you'll see this comes up and how to resolve it

    One solution could be using a timer, and each time that ticks, decode part of the data, next time, the next part, and so on