Cloud functions
Particle.process()
Using
SYSTEM_THREAD(ENABLED)
is recommended for most applications. When using threading mode you generally do not need to useParticle.process()
. With Device OS 6.2.0 and later, system thread is always enabled. For additional information, see non-threaded system mode.If you are using
SYSTEM_MODE(AUTOMATIC)
(the default if you do not specify), orSEMI_AUTOMATIC
you generally do not need toParticle.process()
unless your code blocks and prevents loop from returning and does not usedelay()
in any inner blocking loop. In other words, if you blockloop()
from returning you must call eitherdelay()
orParticle.process()
within your blocking inner loop.If you are using
SYSTEM_MODE(MANUAL)
you must callParticle.process()
frequently, preferably on any call toloop()
as well as any locations where you are blocking withinloop()
.
Particle.process()
checks for the incoming messages from the Cloud,
and processes any messages that have come in. It also sends keep-alive pings to the Cloud,
so if it's not called frequently, the connection to the Cloud may be lost.
It will also update the ApplicationWatchdog timer using ApplicationWatchdog::checkin()
.