I feel like this must be obvious to others, but where can I find the decoder to turn resetReason() numerical outputs into the text string that’s shown on the reference page?
For example, when I use a statement like String(System.resetReason()); I just get an integer. What step am I missing?
Maybe there’s an ENUM list in particle.h? But where can I find particle.h? It’s not coming up in the library search in the online IDE.
In C/C++ enums cannot be translated into clear text that simple.
But you can find Particle.h at https://https://github.com/particle-iot/device-os.
However, Particle.h is only a collection of more #include statements and the enum you are looking for can be found here
Thanks, this is helpful. I’m trying to create a reviewable log of reset events (and other status info) and thought it would be nice to have the reason code intelligible to folks not as familiar with the Particle documentation. I was considering making the translation to text on the device, but it seems more efficient to publish the codes to a Google sheet and then do the translation there.
It’s always interesting to see how much of a project ends up being stuff related to robustness and crash handling, versus the actual task you wanted to perform.